Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronized Counter and Analog Input

Greetings,

Before I begin my environment is as follows:

Software: Labview 7.1
Driver: DAQmx v7.4
Device: 6025E Multifunction DAQ (PCI)

I am having trouble acquiring synchronized counter input and analog input. I recieve a DMA error: "Error -200251 occurred at DAQmx Start Task.vi"

I am aware that my card has only 1 DMA channel and I am assuming this is why I recieve this error. Is there a way to acquire counter input (count edges) and analog input using the same clock? The code is attached.

Thank you,
Himesh P.
0 Kudos
Message 1 of 6
(3,808 Views)
 
0 Kudos
Message 2 of 6
(3,787 Views)
1. Set your AI data transfer mechanism to Interrupts. Leave the counter data transfer mechanism alone (or set it to DMA).
2. Start your counter task first. It is using the AI task sample clock so must be ready when the AI sample clock starts ticking.
3. Use counter 1 (ctr1) instead of counter 0.
0 Kudos
Message 3 of 6
(3,774 Views)
Hi Himesh,

There are a number of points to remember with the restriction of the 1 DMA channel. If you wish to do buffered analog input, you can do that, but then you don't have the DMA channel available for counter/timer operations or analog output. So whichever is your slowest buffered operation is the one that should use interrupts. You will need to call Set DAQ Device Info to change the transfer method to interupts, as DMA is used by default of all buffered operations. I hope this information helps.

Regards,
0 Kudos
Message 4 of 6
(3,769 Views)
Thanks for the help.

I used the "Multi-Function-Synch AI-Read Dig Chan.vi" example and modified it the digital IO part to counter input instead and specified interrupts as the transfer method for the counter input. This worked!! Now I am getting counter and analog input data which is synchronized.

My main problem is solved though I have 1 more question. It seems that the "data" output of the DAQmx Read vi (for the counter input) seems to not be timestampped. I can get around this by using the timestamps from the analog input but I'm hoping there is a way to get timestamps for the counter input as well.

Once again thanks for the help!!

~Himesh P.
0 Kudos
Message 5 of 6
(3,752 Views)
Hi Himesh,

I'm glad you were able to get that to work. The counter data is not of a waveform data type, so it doesn't have any timestamp information along with the data. You can write code to get the current time every time the data value changes. The function for this is the "Get Date/Time In Seconds" from All Functions >> Time & Dialog on the block diagram.

Thank you and good luck,
0 Kudos
Message 6 of 6
(3,737 Views)