01-07-2016 04:30 AM
hi
may i know about any limination have even strucure add event case .bcase i am using more than 50 add event in even strucute.
Solved! Go to Solution.
01-07-2016 04:37 AM - edited 01-07-2016 04:38 AM
Hi Gokul,
there are no (practical) limits - except you maybe lose overview and if one event case executes slow it may prevent other event cases to be executed…
Often you can handle more than one event (source) per event case: you have a lot of "value change" events and you should try to group them in event cases…
01-07-2016 04:47 AM
You can also use dynamic registration and register for the value change event of multiple (Controls[].Value Change) - this will give you a single event and inside the event it gives you the control reference which you can use to get the 'label' of the control that was changed.
01-07-2016 04:55 AM
sorry i don't understand clearly.how can i reduce multiple add event case in my program.
01-07-2016 05:06 AM
and also what are the problem will come use lot of event case.and this is not a right program?
01-07-2016 05:14 AM - edited 01-07-2016 05:16 AM
I posted on the forums about how to register for the value change on multiple controls here and here.
There is no real problem with having lots of event cases, but it takes a long time to create each one so because I am lazy I try to find ways to speed up my LabVIEW programming - if you have lots of event cases that do the same thing then you can save time by having one piece of code handle multiple events.
01-07-2016 09:53 AM
I have almost 50 events in one of my applications and everything runs great. The one caveat is that I don't put any big code segments inside the event structure, as this will tie up the UI until the event finishes. The ONLY code that I run there is the sending of messages to my state machine, which handles the actions associated with the events.
01-07-2016 10:22 AM
jcarmody wrote a neat utility called "Case Select" which lets you work with large case/event structures a little more easily: