LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

pass unit in a VI

Hello, I seek a method to pass to a VI value with several units.

from a main VI I want to parameter a VI with values and units differents, but I still want use the conversion charts introduced into Labview into the second VI...I have also to get values already with units
Moreover
This VI is based on the units of the orders to establish scales.

 However one cannot that to pass either a value without units or a value having the same units that the entries from this VI....

The aim is thus to be able to pass any values and any units to commands of one VI....with the constraint to use the conversion charts introduced into lABVIEW RIGHT CLICK ON LABEL UNIT of a command

French explanation are welcome (as I am frenchi...Smiley Tongue)
Julien
Conception Informatique et électronique
CNRS LCSR Web
Orléans la Source FRANCE
0 Kudos
Message 1 of 23
(5,068 Views)
Yop

Find a little method but not the solution,

The main VI have to pass a String (the unit) and value (the number  unitless), to  make it in form in the second VI...and so use the table of conversion internal of Labview

But the myster still continue...

Message Edité par Ecosmose_CNRS le 12-22-2005 11:37 AM

Julien
Conception Informatique et électronique
CNRS LCSR Web
Orléans la Source FRANCE
0 Kudos
Message 2 of 23
(5,055 Views)

Hi

I'm not sure, but this may help you a little.

Open both vis and run UnitMain.vi. There you enter a value (represented as m) and in UnitSub.vi you will see the same value as cm.

Thomas

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Download All
0 Kudos
Message 3 of 23
(5,052 Views)
You understand my request for his architecture and the main function but I would like to build a polymorph VI.

It will be used to parameter several scale (but one per run) .....

I think I use my purpose over this post.....two parameters, one for the unit and the other for the value.....

Another question, Is it possible to use the table conversion in run mode as in conception mode, right click then "build an unit".....

to choice in a list of units and to no write an unit in a string (which would be wrong syntax )

Maybe in a list or something else, but I don't imagine to list all the units and the conversion....
Julien
Conception Informatique et électronique
CNRS LCSR Web
Orléans la Source FRANCE
0 Kudos
Message 4 of 23
(5,038 Views)
I'm not so into this unit-topic (I never used them up to now), so I can't give you any advice about building polymorphic vis.
 
I also don't know if there is a table available at runtime, but you could use the "Conver unit" function, as attached.
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 5 of 23
(5,036 Views)
Thanks to answer me....

I know this function "convert unit" but it would the same problem, because of ther choice of the users...the users have to know how to write the unit, and too to know this units exists.....

Well , it appears the solution is to not use the units, I get some problem of compatibility and so I have to add many "convert unit" fonctions to use only the values...

I think I will resolve the issue just using the units in presentation of the program,  and then use only the converted value in S.I. all in the program...too sad....

The myster persists about the list of the units...(select what unit is proper at Labview, to run the self conversion)



Julien
Conception Informatique et électronique
CNRS LCSR Web
Orléans la Source FRANCE
0 Kudos
Message 6 of 23
(5,030 Views)
Units are stored in the type descriptor of the wire.  I feel that it should be possilbe to use Type Cast to change the units, but I have not messed around with type descriptors before and my flu-thickened brain is having a hard time trying to figure it out.
0 Kudos
Message 7 of 23
(5,016 Views)
the nodes of property are a solution for reading and writing the units of a value, but an error (1128 by ex.) appears for an incompatibility of unit....

Indeed Labview is used for of its internal conversion chart to directly calculate the values according to their units...

..

 BUT the aim of the "play" is to make it possible to the user to choose this unit, because of the exact syntaxe compatibility0
 
Go just for the fun a millimetre of mercury (quite useful unit of pressure for the thermometer) is written mm.Hg...  very hard to find isn't?

 The users are not worried that, they want to have a list to choose while being compatible with syntax.... But this list of unit is only consultable under the mode execution (right click etc... higher)

 What I seek it is the means of making it appears on the front face, or better, to visualize this list to the user then to apply his choice... then to be useful to me of the nodes of properties... one agrees


Please notice that a same post but in  french exists
Julien
Conception Informatique et électronique
CNRS LCSR Web
Orléans la Source FRANCE
0 Kudos
Message 8 of 23
(5,011 Views)
Ouaip

Ben en attendant la version 9, Smiley Very Happy

Plus sérieusement,  je viens d'appeler les Services de NI et effectivement, la fonction n'est pas accessible depuis le mode exectuion, dommage....

De plus, on ne peut utiliser ou trouver les tables de conversions et comme tu dis raoul, il va falloir que ce soit à la main...

MAIS nous (NI et moi, ca fait deux ) tentons de trouver the fichier qui contiendrait ces tables pour charger son contenu (les unités) dans une liste....et enfin acceder à la liste des unités, dont les syntaxes, je le rappele, doivent rester compatible avec Labview. (les mêmes)

En attendant, J'ai trouvé à plusieurs endroits des listes de table très complètes sur le net mais je ne laisse pas les liens puisqu'elles restent payantes.....ou protégées en droit d'auteur

Décidement chacun veut rester dans son système d'unité...et je noterai personnellement

A QUAND UN SYSTEME UNIQUE ?????

PS : ca nous a quand même couté Mars Explorer ces histoires de conversions, des miles en km (ou l'inverse je ne me rappele plus) et pouf un crash de sonde spatial à beaucoup de francs euh.... pardon euro j'ai oublié de convertir ..Smiley Very Happy

Smiley Sad..fatigué moi je vais me rentrer tot ce soir...Smiley Very Happy
Tchao et merci à tous
Julien
Conception Informatique et électronique
CNRS LCSR Web
Orléans la Source FRANCE
Message 9 of 23
(5,000 Views)

Translate from a website : soory I haven't enough time for english version...thanksd to understand my behaviour ! regards

Following a discussion with the Ni services, the solution definitively remains to be programmed, dixit the malls which I received, the American R&D assure me that it is not possible of uitliser the conversion system of units of labview directly by this software...

in runtime, However by changing the label of the units of a value, conversion is automatically not made Labview...but  to be rigorous and quite simply so that the prog does not plant, it is necessary to use the same syntax of labview (origin of my problem) and to remain in the same field of measurement... (distance, weight, speed, etc...)

This solution seems being the best: By using these bonds (conversions are constantly the same ones but syntax must be exact below the bonds proposes the syn, tax of the units of labview!)

 



 tables of units of labview (bonds above) stored in a file one can reutiliser the tables in drop-down lists then by building the label of unit, one then applies the conversion included in labview.... into changing this etiquette, labview converts the value, thus 1 meter becomes 100 centimetre when one changes ' m' into ' cm'

 --------ATTENTION NOT TO MAKE the REVERSE, applied an already converted value then changed the unit... Good I work there and would provide soon one VI on the forum

 THANK YOU VERY MUCH A Benjamin Mavel of Ni France which provided me the bonds...and which called and exposed my problem to the Ni R&D

To be continued...

 
Julien
Conception Informatique et électronique
CNRS LCSR Web
Orléans la Source FRANCE
0 Kudos
Message 10 of 23
(4,930 Views)