From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
05-08-2007 04:23 AM
05-08-2007 04:48 AM
05-08-2007 05:01 AM
05-09-2007 04:45 AM
Thank you very much! now I understand better the situation
I thought that the code inside the while loop but outside the event structure wasn't care.
So if I want to do something continuosly (for example continuosly comparing two integer values to have a real-time boolean led indicator on front panel), do I put the code in the middle? This is a bit confusing thinking about the "timeout event"....
Use the timeout event or put in the middle (=outside event structure but inside while loop.... at which CPU rate is executed?? too fast?) ??
thanks
05-09-2007 05:26 AM
@Slyfer wrote:
I thought that the code inside the while loop but outside the event structure wasn't care.
So if I want to do something continuosly (for example continuosly comparing two integer values to have a real-time boolean led indicator on front panel), do I put the code in the middle? This is a bit confusing thinking about the "timeout event"....
Use the timeout event or put in the middle (=outside event structure but inside while loop.... at which CPU rate is executed?? too fast?) ??
Just a suggestion. The timeout event for the Event Structure [ES] is equivalent to that of providing a small delay inside the while loop.
But it is not mandatory. If you dont wire some value to the timeout terminal, but still want to something, like comparison, you can very well put that code outside the ES but inside the while loop. It ll execute.
Else you can wire a value like 50 or 100 to the timeout terminal [ this gives enough time for the execution of the various codes inside the various events configured for the ES], so that the ES times out for every 50 or 100 ms when none of the other events occurs. If you put your comparison code here, it ll be doing the comparison all the time or whenever the ES waits and crosses the specified ms after an event has happened.
I hope this gives you a clear idea about eventstructures.
See the below links for more details on Event Structures.
http://zone.ni.com/devzone/cda/tut/p/id/3331
http://zone.ni.com:80/reference/en-XX/help/371361B-01/lvconcepts/using_events_in_labview/
http://zone.ni.com/reference/en-XX/help/371361B-01/lvhowto/caveatsrecmndtnsevnts/
05-09-2007 06:53 AM
05-09-2007 09:43 AM
05-10-2007 05:50 AM
Hi Slyfer,
About closing a vi, my personal idea is that there are some different "philosophies" or "strategies" some of which belong to personal attitude.
About the way you used in your vi and showed into the "the_way_I_use_with_a_button.jpg" I think it is ok but, I would suggest you to make a little change: try creating a specific "stop event" into the Event Structure instead of doing the polling into the While Loop as you do. I attached a screenshot that should be helpful about that.
However your solution is right, so the change I've suggested is only the approach I would use if I was in your situation.
Have a nice day!
carlo>