From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Triggering a non-aquisition event on voltage threshold

Solved!
Go to solution

I am collecting and plotting a single voltage channel, and need to have a pause in the procedure until the voltage rises to a certain threshold.  I made a loop as seen below that I think will work, but it feels odd as I have a continuous read in a loop- should it be some other read function?  Is there a way to use DAQmx Edge if I am NOT triggering measurement?  I am new to labview and am not sure if there is a more common way for what I would think is a frequent task.

 

Thanks!

0 Kudos
Message 1 of 5
(3,217 Views)

Hello,

 

When it comes to DAQmx triggering, it would be good to know what device you are using as well as what kind of signal you are trying to capture. The device affects which types of triggering is available to it, which can be explained below. 

 

Tips and Techniques in Data Acquisition Triggering - NI-DAQmx

http://www.ni.com/tutorial/4329/en/

 

As far as having a read in a while loop, that is generally good behavior. 

 

In addition, I believe we have what you are looking for in retriggerable tasks. Check out the link below and see if the examples there help out.

 

Retriggerable Tasks in NI-DAQmx

http://www.ni.com/tutorial/5382/en/#top

 

Best,

 

Shamik C

Applications Engineer 

National Instruments 

http://www.ni.com/support 

0 Kudos
Message 2 of 5
(3,148 Views)

I will be monitoring voltage (0-1V) with a USB-6001.  The user will set the critical value for the voltage to rise to, and then when that voltage is hit, the VI moves to the next state.  The code is my first full VI and very much a work-in-progress.  The part in question is under the "wait for TCD" state.

 

Looking at those examples, perhaps I could use DAQmx Triggering VI and just have the error out lead to the state change?  All of the examples use it in conjunction with a DAQmx Read so I am not positive this will work.

0 Kudos
Message 3 of 5
(3,126 Views)
Solution
Accepted by topic author bgalfond

Looking into the specifications of that device, it looks as if it does not have retriggerable tasks available to it. However, upon seeing the application, it looks like you are not trying to gather DAQmx data all the time, but rather are using this to trigger the next state of your state machine architecture. For that kind of application, what you have seems like a fine way to compare the values.

 

However, I noticed that your DAQmx task continues to run during the other states. This can cause the buffer of the DAQ device to overflow since it is not being read all the time. I recommend starting the task just before you need to check, and then stop the task before moving on to the next state. This will decrease the load on your DAQ devices, as well as prevent some errors from occuring.

 

 

 

 

0 Kudos
Message 4 of 5
(3,107 Views)

I think I was comitting a bigger sin actually now that I follow what you are saying.  I now have 3 loops running in parallel:

 

  • Event log dequeuing
  • Waveform graph generation
  • State-based machine

The trigger I have set now uses a local variable to read the waveform generated by the other loop, so I think it should avoid the problem you mention.  Thank you for your help!

0 Kudos
Message 5 of 5
(3,100 Views)