Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Use digital trigger in pause mode - read when paused?

Is it possible to just read DAQ data when a digital trigger is paused? I'm using a PCI-6251, NIDAQmx 9.2.1, LV2010.

Maybe I should describe what I want to do.

Start acquisition when PFI0 goes high.

Stop acquisition and read the data when PFI0 goes low.

This will happen continuously until stopped by the user. There is only 140 usec between the start and stop trigger.

 

I've sort of implemented this with start and reference triggers, but it's not all that clean. I was wondering if any advances have been made to make this easier. If I used the Digital pause trigger can the data be read when paused? If so, how do I know when the acquisition is paused?

 

George

0 Kudos
Message 1 of 6
(3,758 Views)

Hi George,

 

According to p. 4-38 of the X Series Manual, the pause trigger will actually pause the sample clock of an acquisition.  While you may be able to call the DAQmx Read function while the Acquisition is paused, this will be reading the data from the PC RAM on your computer, not from the DAQ card itself.  You will only be reading the last sample obtained by the DAQ device.

 

There are two sub-systems you have to think about here: the DAQ card, which stops taking data immediately when the pause trigger arrives, and the PC, which can read data from the DAQ card, regardless of the pause trigger.  For instance, say you're acquiring an analog voltage in an AI task, and it is set up with a pause trigger.  If the sample clock for the AI task last sees 4.3 volts, and the voltage changes to 4.5 volts, when you call the DAQmx Read VI, you will get all the data up to the 4.3 volts, but nothing after it.  So it's theoretically possible that you can "read" data from PC RAM when the DAQ task is paused, but the data you "read" will only be data that was already taken before the pause trigger arrived.  Then, when the pause trigger is de-asserted, the DAQmx Read will begin reading any new values obtained at this point, because the AI sample clock has resumed taking samples.

 

I hope this helps clarify.  If you need an example, you might search around ni.com.  It sounds like what you're trying to do is feasible, because the acquisition pausing operates separately from how you manipulate the data in LabVIEW.  Feel free to post back if this doesn't answer your question, though.

 

-Andrew

National Instruments
0 Kudos
Message 2 of 6
(3,734 Views)

Thanks. How do I know when the acquisition is paused so that I can read the data up to the pause point? Is there something I can poll or is there an interrupt? Can the DAQms Create Timing Source VI be used to monitor a line?

 

I need to be able to detect the pause and read the data within 140 usec. Is that even feasable?

 

George

0 Kudos
Message 3 of 6
(3,729 Views)

Hi GS,

 

You should be able to create a Digital Input channel on PFI0 to poll the state.  You probably need to set the DI.Tristate Channel Property to False so that you can still use PFI0 as the Pause Trigger for the AI task as well.  It may work if you don't do that, though; I don't have a setup handy to try it out.

 

I can't think of a good way to receive a LabVIEW event when it pauses.

 

Good luck!

------
Zach Hindes
NI R&D
0 Kudos
Message 4 of 6
(3,719 Views)

I think the concern sounds like you want to make sure to keep the groups of AI samples separate, but the pause is very short (~140 us) so polling or handling an interrupt in software might not suffice.  Is this correct?

 

If so, and you have a counter available, you could configure an implicitly-timed, buffered pulse width measurement.  From the M Series User Manual:

 

        2011-02-16_125248.png

 

The Gate would be the PFI line that your external pause trigger signal is connected to, and the Source would be your AI Sample Clock.  You can set both with a DAQmx Channel Property Node:

 

        2011-02-16_125458.png

 

The result from reading the counter task (configure the task to return values in terms of "ticks") would be an array that tells you the number of samples that occurred during each pause trigger. This would be a deterministic way to tell which AI samples occurred during each pause trigger.

 

 

Best Regards,

John Passiak
0 Kudos
Message 5 of 6
(3,693 Views)

Thanks for all the tips. Fortunately the requirements changed and now I have a signal available that makes it much easier to use a start/stop trigger configuration

 

George

0 Kudos
Message 6 of 6
(3,668 Views)