LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting data from event data nodes

Solved!
Go to solution

Hello all

 

I have a while loop with an Event Structure and a Case Structure inside. The Event Structure has a lot of cases and each one is controlled by a diferent object (buttons, sliders, graphs, etc.). Sometimes, I have to use the data from the Event Data Nodes to feed a Case Structure that works like a State Machine in my code. To keep the block diagram clean, I would like to "export" the data from Event Data Nodes using a single wire, but this is not possible because there is data conflict, since I get data from CtlRef in one case, and from Coords in other (for example).


To solve this issue I am feeding data into a Bundle to create a cluster and feed it to the Case Structure. Nevertheless, the process is so painful because I have to feed the Bundle function with constants of all kind of data connected to it.

 

Find attached an example. It's not the actual code but shows what I need to do.

 

Thanks

 

Dan07

Message Edited by dan07 on 03-25-2010 05:07 PM
0 Kudos
Message 1 of 3
(3,145 Views)
Solution
Accepted by topic author dan07
Why don't you pass a variant to the case structure. In your event cases simply make a variant of the appropriate data that you want to pass along. I assume that the appropriate case of the case structure will get invoked for the event. Since you should know the type of data this case is expecting in can use the Variant to Data VI and now you have the desired data.


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 2 of 3
(3,135 Views)

Perfect idea. It worked great for me. Find attached the new code.

 

Thanks

 

Dan07

 

 

0 Kudos
Message 3 of 3
(3,132 Views)