08-26-2013 04:25 PM
Hello, I am currently using DAQmx to read a PWM signal and calculate the pulse width using the implicit timer. Is it possible to also get the timestamp of each pulse width measurement? I have been able to do this with an analog signal by using a waveform output, but I can't figure out how to do this with a counter measurement. Thanks in advance for the help!
08-27-2013 11:50 AM - edited 08-27-2013 11:51 AM
I think that you have asked a great question. Something that many engineers may not be aware of is that the DAQ device itself does not actually create the time stamp. It is created by the comptuer system when the data is retreived from the DAQ card. Because of this, the time stamp is actually delayed by a significant amount. This delay may be less than the resolution for time stamps (one millisecond) but it can sometimes be greater than that. This Knowledge Base article discusses it this in more detail: http://ae.natinst.com/public.nsf/web/searchinternal/5d42ccb17a70a06686256dba007c5eea?OpenDocument
If your pulses are closely spaced, the generating a timestamp for each aquisition is not practical. But, if your pulses are spread apart by a significant amount (more than 0.1 seconds or so depending on the specifics) then the timestamp might be accurate enough to be practical. One way to do that with counters would be to use the Get Date/Time in Seconds VI in LabVIEW just after the DAQmx Read VI. Then, once the Counter Input measurement is complete, LabVIEW will create that timestamp very quickly afterward. Please notice that there will be some time delay between the completion of the read and the creation of the time stamp.
Jeremy P.
08-27-2013 01:58 PM
I figured this would be the case when using a separate timestamp block with each DAQmx Read block. The pulses I am reading are between 1 and 2ms - is there a way to get a more accurate timing value? Is there a way to get a count number reading with every pulse width measurement directly from the DAQ instead of getting a timestamp from the system?
Thank you for your help!
08-28-2013 10:27 AM
I believe what you want to use is the CI Pulse Time Channel. This will measure the high and low time of each period. You can configure it to return N Samples of high/low pairs. I would recommend that you try this out and test it to make sure that it doesn't skip any pulses. Here is a link to another forum post in which another user did something similar. http://forums.ni.com/t5/Counter-Timer/Implicit-pulse-measurement-and-Digital-Input-on-X-series/m-p/1...
Jeremy P,
08-28-2013 01:06 PM - edited 08-28-2013 01:07 PM
You didn't mention what hardware you are using but CI Pulse Time only works on STC3 devices (like X Series or cDAQ). For other devices, you can do something similar with a Semi-Period task, which will return a sample for each high and low time (the cumulative sum of semi-period times would be computed in software and is the timestamp relative to the start of the task).
Best Regards,
08-29-2013 12:49 PM
Thanks, John, for clarifying that. I forgot to mention that important detail.
Jeremy P.