LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I register an event as a value in an array?

Solved!
Go to solution

 

I have a boolean which is True whenever data I am recording exceeds a certain value. What I want to do is keep a log of every time this happens and store it into an array, preferably in a way that each event has a new number (e.g. first event is logged as 1, second as 2, etc.).

 

The aim is that every time this condition is met, an output signal is sent to another DAQ card, and the signal is dependent on the current event iteration (the computer reading from the other DAQ card can interpret this with if statements for the voltage ranges, which seems to work).

 

I would be very grateful if you had any input as to how to go about this.

 

Thank you very much!

 

 

0 Kudos
Message 1 of 4
(2,507 Views)

Well "registering an event" has a special meaning in LabVIEW. I don't think your problem has anything to do with an event structure.

 

Do you want to record whenever the boolean goes from false to true, or anytime the value is true?

 

All you need is a case structure. Keep an array in a shift register and append a new element (using build array) whenever a new elements needs to be recorded. You could make the array element a cluster [sequence number, timestamp, value] for example. 

0 Kudos
Message 2 of 4
(2,477 Views)
Solution
Accepted by topic author Arisf

Try something like this ...

0 Kudos
Message 3 of 4
(2,463 Views)

This is excellent, thanks! 

0 Kudos
Message 4 of 4
(2,458 Views)