LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass refnum, error cluster, and say, image data between subdiagrams (different events) of a LabVIEW event structure?

I have an event structure in my LabVIEW 7 VI which handles certain front panel events. I need to be able to communicate parameters and data (refnum, error cluster, and image data) from a subVI in one subdiagram (event handler) of the event structure to another subVI in another subdiagram of the same event structure. I don't know how to do this. I've tried lots of things, but still don't have it. Event structures don't have sequence locals like stacked sequences have. when I try to pass data out tunnels in the event structure, and try to route them back into the appropriate subdiagrams, I get wiring errors. Can anyone help me. Thanks!

Lase
rfun
0 Kudos
Message 1 of 2
(2,495 Views)
It sounds like your event structure is inside a while loop (not sure).

You can right click on the edge of a while loop and create a shift register. A shift register is a special type of terminal in LV that can be both written to and read from! There is nothing else quitelike it it in LV.

It can do this because it actual has the terminals, one on the left side of the loop (for reading) and the other onthe right for writting.

Once you create the shift register you cnawire your data out of you event structure (via a tunnel like you where trying) and into the shift regisiter. For the events cases that need to read thsi information, they can be wired from the left terminal.

Any events that do not modifiy the data, should just pass the wire in from the lef
t edge of the event structure and back out the tunnel on the right. THis way you are tell LV not to change the data sitting in the shift register.

You will find tha the shift register act a lot like the seq locals except you can read or write them in any case (frame).

THe reason you were getting a broken wire was you created a loop that LV could not determine what order things were supposed to happen.

Shift registers get around this issue.

Other methods of accomplishing your task woulduse Gl bal variables, Functional Globals (a fancy implementation of shift registers), queues, and notifiers. Depending on the complexity of your code, you may want to explore those options.

Trying to help,

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 2
(2,495 Views)