From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing state machine data cluster from another loop

Hello,

 

I have a .vi containing a state machine whose main data cluster has a handle for a camera I am using. The user needs to be able to set the brightness, shutter speed, etc. on the fly, so I have another loop containing an event structure waiting on changes to these values. However, to use the camera's API, I need its handle, which is in the other loop. What's the best way to access this data? The data cluster, right now, is not a control or indicator, so I can't make a local variable. I suppose I could write the camera handle to an indicator, then access it with a local variable, but I'd rather not clutter up the front panel with data the user doesn't need.

 

Also, I currently have the brightness, shutter speed, and gain controls inside a cluster (is it good pracice to keep controls inside clusters?) However, I'm concerned that if I put the terminal for this cluster inside the event structure loop but outside the event structure itself, the old value will be read for the variables it contains. For example, if you had not a cluster but a stop button in this position, then the value would be read as soon as the loop began, so when you wired it into the event structure, you would get the value before the change. But the cluster has variables useful for 3 separate events, so I have to put it outside. If I unbundle it INSIDE the event structure, will I get the new values, or the old ones? I could use a local variable for two of the events, but that would be ugly.

 

Thanks!

0 Kudos
Message 1 of 3
(2,578 Views)

Check out Data Value References.

 

Example_VI_BD.png

=====================
LabVIEW 2012


0 Kudos
Message 2 of 3
(2,560 Views)

show us what you have done, upload your VI...you could mean "po taaah toh" and we hear "po taaay toh"....Smiley Indifferent

0 Kudos
Message 3 of 3
(2,540 Views)