LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Analog Waveform Measurements

Hey Guys,

 

I need some help coming up with a solution for my project.

 

So, lets start with what I am trying to achieve. I have some analog signals that I am trying to monitor for errors. The signal is normally 5V Or 0V based on the Output being Normally closed or open.I am monitoring to see if there is any intermittence in the signal and if it drops down or goes up over a period of time with some load on it.

 

1) What I would like to be able to do is, have an error counter that increments when a trigger is detected. ( I have achieved this). But I would also like to check and see if the signal has returned to its normal state after a trigger, every second, if it hasn't then increment the error count (Need help with some ideas here). This is to analyze if the output  dropped down for example from 5V to 0V and stayed there.

 

2) Also, when a trigger is detected, I would like to record a chunk of data, for example 100ms before the trigger and 100ms after or in samples, that way when i look at the data and plot it later on for analysis, I can see the transition.(ideas?) I can export this into a .tdms file.

 

Picture of what I am expecting the signal would be in case of failures.

PGgautam1_0-1587522224618.png

 

 

I have started a VI and trying some things.

 

Please see attached.

 

Thanking you for taking the time to read the post.

 

Paul..

 

 

 

 

0 Kudos
Message 1 of 3
(2,047 Views)

1. Since you are using Continuous Samples, leave the Samples Per Channel on the DAQmx Timing VI unwired.  You are just needlessly limiting the buffer.

2.Give the DAQmx Read an actual amount of data to read.  I would tell it to read 100ms worth of data (ex: 100 using your sample rate of 1kS/s).

3. Get rid of the wait in the loop since the DAQmx Read will now limit your loop rate.

4. Since you now have 100ms of data each time you read, you can just store that in a shift register.  So when the trigger is detected you create your file, write the data that is in the shift register (the previous 100ms), write the current data, and I would probably also use a shift register to flag the next iteration to also save that data and close the file.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 3
(2,003 Views)

Hello,

 

Thanks for the response. 

could you provide an example please. I am fiddling around and have been unsuccessful to come up with a working code for logging before and after trigger. 

Thanks. 

0 Kudos
Message 3 of 3
(1,990 Views)