LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do i creat a waveform (peak and time) detection using DAQ6009?

Labview ver:2011

 

Hardware:DAQ6009

 

  

I'm currently monitoring an LED that is on for 1sec and off for 3 sec. I'm monitoring the signal via a LDR (light dependent resistor) into one of the AI (analogue Input)  channels.

 

Every time the light comes on I can see a peak in the graph plot.

 

 

I now want to detect if the LED on/off pattern changed ie: if LED is on for 4sec and off for 3 sec etc.

 

 

any suggestions will be appreciated

 

 

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

First you need to choose a threashold of what voltage you concider "ON".  Then simply pass your analog voltage array into a Greater Than with the chosen threshold.  This will yeild a boolean array.  From there you should be able to check for your ON/OFF pattern.


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 7
(2,621 Views)

Sorry if I didn’t make it clear, at the moment I can detect when a light comes on/off. 1V representing the LED on and 0V representing LED off.

 

 

 

The difficult part is recognising if the On/Off pattern is outside the quiescent condition.

 

 

 

Eg: if the light is on for 1 sec and off for 3 sec that means everything is ok (quiescent condition), however if the on/off period  changes (eg if the light comes on for 4 sec and off for 1 sec,  or vice versa) beyond the quiescent then I want to know an event has happened.

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

I would use the Search 1D Array to find when the signal transitions from low to high and back.  Subtract these to get the pulse width in number of samples.  You will have to multiply by the sample rate to get the actual time in seconds.


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 4 of 7
(2,611 Views)

when you say sample rate, is it for the DAQ because my signal is coming in directly from the DAQ (on-Demand)?  

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

@D Raz wrote:

when you say sample rate, is it for the DAQ because my signal is coming in directly from the DAQ (on-Demand)?  


Yes, the sample rate is the rate at which the DAQ is acquiring samples.  On demand is probably not the way you want to acquire your data.  You should use continuous and just grab what data is available and process what you have.  Since you are dealing with seconds, I would use a sample rate of something like 100Hz.


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 6 of 7
(2,587 Views)

I find your method interesting, although I have sorted this issue out (not 100%) but I tried your method I can't get it to work. I have attached what I have done.

 

Appreciate your reply

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