LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Determine when a signal changes state and then evaluate second channel

Ok, I need some help from you math geniuses (or those that remember calculus).

 

I am recording two signals to a TDMS file, one is a pressure measurement and the other is a trigger monitor channel (basically it records a voltage change when the device is triggered).

 

So what I want to do is when the device has been triggered (voltage changes from around 1 V to around 0 volts), I want to evaluate my pressure channel to see how quickly it gets above a certain threshold.

 

I am thinking I need to integrate the trigger channel and somehow correlate that to the pressure channel, but I could be wrong.

 

I attached a sample dataset.

 

Thanks for the help.

Kenny

0 Kudos
Message 1 of 7
(2,783 Views)

Could you not find PSI when on/off first reaches about 0 in your table, then grab the corresponding time, then find your PSI threshold, grab the time and subtract the two to get the elapsed time?  Or maybe I am missing something - I'm no math genius.  😉

 

Edit:

Oh, maybe you are evaluating them in real time and not from the table?

 

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 7
(2,773 Views)

Correct on most of it.  What I am looking for is a way to "know" when the on/off signal goes from 1 to 0.  now I could do a while loop and compare the current value to the previous value and if the difference is greater than say 0.75 V, it must have been triggered and then do my further analysis.  But on a long dataset that could take some time.

 

I am pretty sure that there is a less brute force mathematics way to do this, but I cant think of it off the top of my head.

Kenny

0 Kudos
Message 3 of 7
(2,768 Views)

Hmmm, maybe one of the threshold VIs could help you there.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 7
(2,753 Views)

Kenny,

 

Are you trying to do the analysis as you are acquiring the data or are you opening a file and doing the analysis while looking at the file?

 

Kira T

Applications Engineer

National Instruments

0 Kudos
Message 5 of 7
(2,735 Views)

I could do either, but it is intended to be after the fact, with a file.

Kenny

0 Kudos
Message 6 of 7
(2,723 Views)

Hey Kenny,

 

If you are trying to read it from a file I would suggest just doing it the brute force way, but I would suggest using a For Loop and wiring the size of the array to the number of iterations.  Using a For Loop or a While Loop should not take too long to do the calculations you are trying to do.

 

Kira T

0 Kudos
Message 7 of 7
(2,695 Views)