LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

trigger

Hello.  Does anyone know how I can continously scan an analog channel and trigger some code if a certain threshold is detected? 

 

I am looking for 5V pulses that have a width of few microseconds.  I am using the 8205 Analog card.

 

Thanks!

 

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

I also have a 9401 Digital Input Module.

0 Kudos
Message 2 of 3
(2,274 Views)

Hi seascan,

 

It sounds like you need to set up some kind of trigger or threshold within your software. 

 

In LabVIEW, if you're acquiring data continuously, then you should be able to set up a case structure within a while loop. Set the case on the case structure to recognize when the data is over 5V and have the code you want to run within the case structure. I've attached a super simple example of this. When it's over 5, the boolean turns on.

 

If you need it to wait and see if it stays at 5 for a certain amount of time before your code executes, then this gets a little more tricky. One way can I think of right off that you could do this is just set it so it has to stay 5 a certain number of iterations of the loop. Test the loop iteration number when it first comes on and then have it test to see how many iterations have gone by (have another case statment). When it reaches a certain number of iterations over 5, have the code run. There's also things you can do with keeping record of the data and testing for statistical thresholds.

 

Good luck!

0 Kudos
Message 3 of 3
(2,253 Views)