PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

NI XNET and UTC Timestamps

I'm trying to compare a timestamp obtained on a PXI RT with the Get Date/Time In Seconds function vs. an XNET Timestamp. I convert the XNET timestamp with a VI I found in the XNET Logging Examples, and I sample a DAQ AI at 500Hz and get the Date/Time In Seconds when I measure it above 5V. I'm expecting to see a time of about 500ms between the two events, but I'm seeing about 300ms. So, I'm curious where this 200ms would be coming from and do I need to use the RTSI synchronization stuff? 200ms off is too much and 1ms accuracy would be what I'm looking for.

0 Kudos
Message 1 of 7
(4,973 Views)

Hi kevin.key,

 

Have you looked at the Synchronize PXI-CAN with DAQmx Analog Input example? You can find this in the example finder under: Hardware Input and Output>>CAN>>NI-XNET>>Synchronization>>""

 

If you want to get 1ms accuracy you will need to synchronize the AI start trigger and sample clocks.

 

As to the delay, I'm not sure I understand, you are seeing 300ms, expect 500ms but want 1ms?

 

DylanC

0 Kudos
Message 2 of 7
(4,967 Views)

I'm seeing 300ms, but I'm expecting 500ms. That is an error of 200ms, but I'd like an error closer to 1ms. I've glanced at that example before, but I'm not sure how that would address the issue of calling the Get Time In Seconds vi or do I have to get the timestamp from the DAQ somehow?

0 Kudos
Message 3 of 7
(4,964 Views)

How are you currently getting the timestamp? A comparison to >5 and if true get current date/time? This could be where the delay is coming from. I would try getting the timestamp array from the waveform and finding the element which corresponds to the Y value that is >5.

 

DylanC

0 Kudos
Message 4 of 7
(4,955 Views)

That's how I'm doing it, but I was hoping that there wouldn't be that much delay by the DAQ. So is there ~200ms delay when you read an analog voltage?

0 Kudos
Message 5 of 7
(4,949 Views)

Hi kevin.key,

 

The delay of that much wouldn't be coming from the daq, depending on what DAQ device you are using (PCI, USB, PXI) but neither of those would come close to 200ms (http://www.ni.com/white-paper/3509/en). I believe the delay is coming from between the reading of +5V and when you call the Get Date/Time. Try using the waveforms timestamp, there is more information on delay with waveform timestamps in the link below.

 

http://digital.ni.com/public.nsf/allkb/5D42CCB17A70A06686256DBA007C5EEA

 

DylanC

0 Kudos
Message 6 of 7
(4,946 Views)

I'm using the PXI card with the RTOS so I wouldn't expect the 200ms existing between the call to read the analog channel and the call to get the date/time, but I'm thinking that the best test will be to try getting the timestamp from the waveform call.

0 Kudos
Message 7 of 7
(4,943 Views)