LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Looking for something like Ref-Num to Control/Indicator

Hello, Robot Sad
I try to find out if I missed something in working with references.
I want to pass data and attributes from a main-vi to a sub-vi and vise versa.
Lets say that I have a cluster of : Number1, Number2, Boolean1 and Boolean2.
I know, that it is possible to have a reference to a cluster, can split it to controls[] and than manipulate each of the
and do it similar to the data.
BUT
I could not test the sib-vi on it's own.
What I am looking for is something like "refnum to indicator or control".
Assumed my cluster is a definied data typed or whatever, then I want a RefNum- Input, change this input to a cluster
control (or indicator) manipulate data and attributes and everything is manipulated at the same reference, that is passed
to my sub-vi.
So the main-vi "knows" about the manipulation (because it is the same reference.
Is there a way of doing it so, or do I have to go the way with:
Control- refnum- controls[]- select the right number- change attributes
and
Control- refnum- controls[]- select the right number- change data
Best regards Ruedi
0 Kudos
Message 1 of 5
(2,810 Views)
You need to pass the values back and fourth using control or indicator references.  The attached program sends the data back from the sub.vi to the main.vi every second, but you can change this to meet your application.
0 Kudos
Message 2 of 5
(2,802 Views)
I don't know if I understood correctly what you asking but try the simple vi attached.
Keep in in mind that from this point of view (property node manipulation) Controls and Indicators are the same thing, in fact a Class named "Indicator" doesn't even exist
From a Property Node you can distinguish if a control is actually an indicator if the "indicator" property is set to TRUE..

Hope this helps
bye,
manga

0 Kudos
Message 3 of 5
(2,799 Views)
Hi,
thanks for the quick answer, but I think that I did not explain my problem good enough.
Yes, in principle I want to pass data and properties from a main-vi to a sub-vi and back.
So I thought it might be bessible for two controls to point to the SAME Reference (no matter if the are in the same vi or not).
Let me give a new try:
Is it possible to have two controls (in the same vi or in differenc vi's), that behave like the are the same, by only exchanging the reference (somehow in a way that I don't know).
So If I change the attribute of one control to i.e. blinking the other control starts blinking as well.
Best regards Ruedi
0 Kudos
Message 4 of 5
(2,790 Views)
You might want to try DataSockets.  It sounds like that may serve your needs.  There should be examples in the help files.

-R
0 Kudos
Message 5 of 5
(2,768 Views)