LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

et and get control value

Dear all,
1.when I use "get all control value" property to get all control in a VI, and then I attempt t to use "set control
value"property to set control value which is read from a file. my problem is:as defferent type control exist a VI and I
got many type control,I can't set a value type to fit the different type control.for example, I set a string control
value now,but the next control is a boolean,so my program will be error.
Could I set a value to fit the different control when I use "set control value" property to set control value which
is read from a file or you have any other way to complete this?
 
2.when I use "get all control value(variant)" property to get all control in a VI, and then I attempt t to use "set
control value"property to set control value which is read from a file. I can't pass a value which read from the file
to control in the VI.how can I pass the value to the control in the VI.
 please advise.Thanks!Attach my program for your reference.
 
Best regards,
Jimmy
0 Kudos
Message 1 of 6
(2,660 Views)

Hi Jimmy,

      The simple answer to "1:" is don't use a loop - use a different "Set Control Value" for every input parameter.

Easier might be to bundle all the values in a Cluster - and pass one cluster instead of multiple values,

However, check-out the "Dynamic Load Example.vi" (in Examples) which uses "Call by reference node" - which is a really "Clean" Smiley Wink

cheers!

When they give imbeciles handicap-parking, I won't have so far to walk!
0 Kudos
Message 2 of 6
(2,654 Views)
hello Dynamik,

But the value was read from a file, so they should be all string type and the control may be any type. i would like to
convert string value to fit any type value. But it looks impossible, because i only can pass one type value to control.
How can i do this? in the other words, i want this VI to became general.it can set any type control value whichever VI
you call.
Best regards,
Jimmy
0 Kudos
Message 3 of 6
(2,631 Views)
Hi Jimmy,
 


i would like to convert string value to fit any type value. But it looks impossible, because i only can pass one type value to control.
Best regards,
Jimmy


Here are some ideas, though, I'll suggest once again to translate the array of strings into one or more "objects" represented by clusters.  I usually create a VI just for reading/translating the parameters file, then pass a nice cluster-object around. Smiley Happy
But to address your question... 
You could convert the string to a unique-type on every iteration (see pic.)
... or, instead of using the loop-index to select the type-case, you could pass in a type-selector the same way you're passing-in parameter-name and value.
 
ya think?
 

Message Edited by Dynamik on 01-04-2006 10:38 PM

When they give imbeciles handicap-parking, I won't have so far to walk!
0 Kudos
Message 4 of 6
(2,624 Views)

Hi Dynamik,


it is heared that it is a great idea to convert input string value into cluster, but I don't how to complete.
Could you attach the program to my reference? thanks!

Best regards,
Jimmy
0 Kudos
Message 5 of 6
(2,616 Views)

Hi Jimmy,

      Please supply an example of the text file - that I can better help you. Smiley Happy

When they give imbeciles handicap-parking, I won't have so far to walk!
0 Kudos
Message 6 of 6
(2,611 Views)