LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

recalculate button?

Just a quick question I hope.

I have a program that seems to be working using events. The executor chooses which calculations are to be done to the data from the event buttons. For each of the different events there is a series of calculations carried out which are then output to a csv file. However, thesholds and the repeat number for the for loops need to be changed according to the data which is best checked after the averages and cuts have been made so I was thinking of creating a recalculate button. This was my logic-

- create a case structure which contains the code in the true case. WHen the button is pressed the code executes.

 

- Not sure what to put in the false case - did have a quick attempt at this and it seems to be getting stuck in the false case.

ANy suggestions would be appreciated.

0 Kudos
Message 1 of 2
(2,138 Views)

It would help if you could show is some code!

 

If there is a common final recalculation from several events, I typically place it inside the timeout case and modifiy the timeout via a shift register in each event case. For all events that need a recalculation, set the timeout to a small value and in all other events (including the timeout event) I set the timeout to infinite (-1).

 

(If the final recalculation takes a few milliseconds, this technique also automatically discards stale events from the event queue because the timeout will not happen until all accumulated events have fired. (Of course I assume that the events alone execute much faster).)

0 Kudos
Message 2 of 2
(2,134 Views)