LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Log down the accumulated on/off time and number of cycles

Solved!
Go to solution

A queued producer/consumer architecture would definitiely be your best bet.  I've attached a vi with a couple of suggestions.  At the top of the block diagram I show an easier way to make the initialized timing array.  The bottom portion shows you what the producer can look like.  Everytime there is a trigger it takes the trigger array along with the data array and combines the two to be queued up.  On the consumer side you can split the array apart and then run it through the for loop to see which switches need new timing data.  Also, on the producer side you can set up your DAQ assistant so that it will control the timing of the consumer loop by setting it up as follows:

 

Timing

 

The rate will determine how fast the producer loop runs.  The code you attached will have the while loop containing the DAQ Assistant running as fast as it can, eating up your computer's processing power.  I bet you don't need to be reading it that fast, so it is a good idea to throttle it back some.

0 Kudos
Message 11 of 11
(788 Views)