LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to obtain a list (string) of all elements within a Global Variable?

Something like this,

I'm not sure if i'm on the right track with the polymorphic VI's

The LLB has two vi's one for traversing throught controls (clusters/arrays/table)
and one for VI's (global/normal/polymorphic/facade)

Ton


Message Edited by TonP on 09-27-2006 08:59 PM

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 11 of 47
(1,981 Views)

Hi Ton,

I'll have a look at it tonight.  - Thanks -

OK... now part 2 of the exercise..

I want to write a value (from a list) to each element within the Global Variable.  I now have each name.  I can create Property Node, etc..  But...  How do I index the element?

In other words, how can I use the list I obtained earlier to index the element I want to write the value to?

Thanks,

RayR

 

0 Kudos
Message 12 of 47
(1,971 Views)
Basically, how do you mimic "Select Item"?
0 Kudos
Message 13 of 47
(1,969 Views)

Hi Ray,

If the above has obtained all of the names OK then you are most of the way there!

Modify Ton's examples such that you are building an array of reference in parallel with the names.

You can then use the two arrays (one of names one of refernces) in tandem.

Use a "Serach 1-d array" to find your name. The returned index can then be used to select the proper reference.

NOTE:

Since the refences will be in an array they will be of a generic type. Thise means your "value" property will be a variant. This should not be a problem. Just wire it up.

Limitation:

Clusters of arrays of clusters of ... get very complicated! AS long as your data types are simple, the above should get you there.

Have fun!

Ben

LVC meeting @ 10:00 CST. You gonna show?

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 14 of 47
(1,953 Views)
I'm at work so I can't post LLB's/zips Smiley Mad

But My examply returned of each control a cluster with a reference and a name such as tabcontrol.page1.array.cluster.control

now if you modify the output cluster to have the name then the reference and you sort the array and then do a threshold 1d Array (shoot, this doesn't work. I thought the threshold 1d array was polymorphic for an array of clusters Smiley Mad)

I figured that the vi traverse i build in the llb should also handle control VI's since this are just .ctl files.

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 15 of 47
(1,952 Views)

touche Ton!

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 16 of 47
(1,957 Views)

@Ben wrote:

@LVC meeting @ 10:00 CST. You gonna show?


Wish I could...  I've been waiting > 1 month for the updated NDA from Sarah...  I can't access the forum..  😞

Thanks guys...  I was on the right track, but failed to create an array of references..  I was trying to re-build it from another vi..  Needless to say, it was getting messy!

RayR

0 Kudos
Message 17 of 47
(1,955 Views)

Thanks Ton,

I forgot to mention that I'm using LV7.1...  That's 2 versions down from your posted example..  I'll try building the same from the info provided.  But if you do get a chance to convert, that might be great!

Thanks buddies!

RayR

0 Kudos
Message 18 of 47
(1,949 Views)

Thanks guys!!

It works great!  Ya gatta luv LV!! 

😄

Message 19 of 47
(1,939 Views)

I'm on to the next stage...

I now need to read the value within each control of the calling vi and compare them with the values from the Global Variable.  Basically, I need to identify all the changes in value and prompt the user/operator before writing them to the Global Variable.

The info discussed earlier worked up to one point.  I can compare the values...  I can probably write them (not there yet).

However, I need to convert the values to string to display the parameter and the values changed.  Unfortunately, the "variant" is not cooperating with this one.  Yep, I did a search and it seems that others are looking for the same solution..  I tried what was proposed, but to no avail!!..  I tried flatter to string, typecasting, drinking stronger coffee, even considered beer!!! 😮

Do you guys have a suggestion on this one?  Till then, I'll continue to explore.

BTW:  The value in from the propoerty node is correct!  One observation..  Although a numeric value, a probe shows that there is a carriage return as part of the value, which is why I also tried setting the type to string..  Oh yeah.. I tried numeric type, etc.. As well as unbundle cluster, etc..

See attached image for typical error message.

Thanks,

RayR



 

Message Edited by JoeLabView on 09-29-2006 08:59 AM

0 Kudos
Message 20 of 47
(1,924 Views)