LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to avoid race condition in event loop?

Solved!
Go to solution

@JKSH wrote:

@easyXAFS wrote:

 

1) throw the whole thing into a while loop and use just 'run'.

or keep using 'run continuous'


Some side notes:

 

  • Under most circumstances, "Run Continuously" cooks your CPU. Don't do it!
  • Under most circumstances, running a while loop without a "wait" cooks your CPU. Remember the wait node!
  • In this particular case, your CPU was saved by the fact that the event node forces your code to wait.

Worse, RUN CONTINUOUSLY means the only way to stop your VI from running is to use the abort button and that doesn;t leave you a good way to clean up code when your VI should end such as clearing DAQ tasks, closing Com ports, or closing open files.

0 Kudos
Message 11 of 11
(716 Views)