03-25-2016 11:38 PM
Good evening, I have a question:
You can enable, disable and re-enable an event in an event structure in Labview ?, I managed to turn it off but I do not know how to re activate it in the same run, I thank you a sample program that can guide me,
Thanks.
Solved! Go to Solution.
03-26-2016 05:16 AM - edited 03-26-2016 05:17 AM
Maybe this example not very simple.
You can register event with empty constants. In this case event never become.
03-26-2016 09:35 AM
Why not make it simpler? Create the event. Create a flag (global/fgv/whatever). Put a case structure in the event structure. Use the flag to make it run when you want it. Otherwise, the event triggers but does nothing.
03-26-2016 10:08 AM
Of course case possible, but it have two minuses:
1) you need frame in frame.
2) event may has big data, so it memory leak.
But this variant real simpler.
03-26-2016 10:26 AM
1) You have a frame in frame using your solution.
2) You're also using an event. If there's a memory leak, it's due to your poor programming and not the event structure. You'd want to take a look at resolving THAT problem.
The problems you cite both exist in your implementation. You've just added complexity to something needlessly. You don't address either with your design.
03-26-2016 10:41 AM
03-26-2016 10:45 AM
natasftw wrote: 2) You're also using an event. If there's a memory leak, it's due to your poor programming and not the event structure. You'd want to take a look at resolving THAT problem.
Actually, not being registered for the event fixes this issue. If the event has a lot of data in it, each event structure that is registered for it has a copy of the data. By unregistering for the event, you are eliminating a copy of the data. With using the flag, you still have that copy happening.
Personally, I do not see one any more complicated than the other. But I would say the unregistering for the event is the more efficient one.
03-26-2016 10:46 AM
1)I have frame only in one frame (on/off).
If you will check in all events you will check many cases.
2) If you generate big data (array 10000 points), this memory frame will allocated and deallocated.
And your variant generate unnecessary events.
This simpler but not always better.
For controls on FP much better use enable/disable property
03-26-2016 11:42 AM
1. Ok, Sorry but I don't understand "the flags", anyone has an example or where can I learn about it?.
2. Thanks for your answers, but I don't know which of the proposed solutions is best for my application: I need to move through the rows of the multicolumn box, and pressing "ENT" listbox appears, and pressing "DOWN" selection moves in the listbox, NOT in the multicolumn box, for this I need to disable the event "Ok Button 2 : Value Change "... I attached the vi to you understand me better.
Pd: Sorry for my bad english, I speak snpanish.
03-26-2016 11:47 AM
Artem.SPB please, can you change the version of LabVIEW to 2014? I can't see the vi, Thanks..