LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event structures in parallel

Hello,

My labview skills barely exceed the CLAD level, and I miss some more advanced architecture concepts. I develop alone lab applications in a research environment.

I have a question for you regarding best practices for event structures. I read that it is discouraged to put them in parallel inside a loop, however I would find it could help designing a more logical diagram and I do not know what would be the correct practice.

Specifically in the main loop of my application the event case is handling all the GUI elements. This event case has 5 inputs and 5 outputs but only 6 of the events interact with them. All the other 30+ cases do something independent but I still have to wire across these 5 terminals one by one.

This is why I was considering to make two parallel event structures. Each one dealing with an omogeneus set of cases (splitting those who need inputs and those who doesn't) both with a timeout not to stop the loop. Is it a bad idea? What would be the way to go if the number of inputs and cases grows?

Thanks

0 Kudos
Message 1 of 3
(178 Views)

It's a bad idea to have 2 event structures in parallel because both structures need to run before they can "reset" and be ready to run again.

 

If you need to wire something across in every case you right-click the right-side terminal and select "Linked Input Tunnel >> Create and wire unwired cases. This works on case structures as well."

 

Typically, if you have data that needs to be maintained (like your 5 data elements), you bundle those into a cluster so that you only have to deal with one wire / shift register.

0 Kudos
Message 2 of 3
(173 Views)

You can have two event structures in parallel in the same loop as long as each is "transparent", i.e. has a short timeout and no slow code in the event cases. This is NOT recommended!!!

 

For your case, you should do a separate while loop that does the UI stuff, making things much more manageable, scalable, and maintainable.

 

We can probably give much more specific advice once you show us your code.

0 Kudos
Message 3 of 3
(149 Views)