LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Question about non-continuous DAQmx sampling

I am a new Labview user, and there is a confusion in my DAQmx concepts.
I use a loop structure. Within the loop, I put one motion VI to read the current position of my motion stage. Also, I put a DAQmx Read VI to read force.
 
For every loop execution, I want to get just one position value and one force value for that specific time, and the data should be as following :
 
Time        Position            Force
-----------------------------------------
t1             p1                     f1
t2             p2                     f2
t3             p3                     f3
............................................
 
I have no problem for getting position of that time. However, I am not sure whether the foce data is associated with that time.
 
I plan to set "samples per channel"=1 for the DAQmx Read VI, and use "finite sapmles" mode.  Now I do not know whether the data I read is associated with that time, or it is just a data stored in buffer and is associated with a little earlier time, which is not what I want.
 
Since I am not using continuous sampling, I do not need to use Timing VI, right? If no timing VI, is there still any data in the buffer?
 
Maybe I need to use triggering VI?  Software triggering?
 
In summary, the point of my question is: How can I get the exactly current daq value of the time instead of data stored in buffer and related with earlier time?
 
Hope to get suggestions to clear away my concept confusion. Thanks a lot.
 
SIncerely,
Dejun
 
 
 

Message Edited by Dejun on 10-14-2005 02:13 PM

0 Kudos
Message 1 of 4
(2,776 Views)
Right-click on the DAQmx Read.VI and do a "Select type.... Waveform". (see attached)
 
 
In the returned waveform will be the time that sample was acquired.
 
Your data point will be th one and only element in the the "Y" array part of the waveform.
 
Ben

Message Edited by Ben on 10-14-2005 03:03 PM

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 4
(2,762 Views)

This is just set DAQmx Read VI, but this VI still read data from buffer, right?

How can I make sure therre is only one data in the buffer when Read VI retrieve it?

WIthout Timing VI, no data will be accumulated in buffer? and The system do AD conversion only when Read Vi is launched? Thanks.

0 Kudos
Message 3 of 4
(2,753 Views)
Dejun,
 
Ben was correct in the advice he gave you. If you do not use the DAQmx timing VI, and you acquire only a single point, LabVIEW will grab the value of the Analog Input when the DAQmx Read VI is run. You do not need to worry that you might be retrieving an old value from a buffer. In this case, when you run the DAQmx Read VI, the A/D conversion will occur and the value will be retrieved by LabVIEW.
 
Keep in mind that this is known as Software Timed Data acquisition. As Ben stated, you can get a timestamp of the data if you use a waveform, but this timestamp will not be exact as it is not generated by the DAQ card. It comes from the operating system, which means it is non-deterministic.
--
Michael P
National Instruments
Message 4 of 4
(2,730 Views)