Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

RT Set Date Time and Fractional Seconds. Also NTP directly to target.

Question 1:  Is it possible to use fractional seconds with the "RT set Date and Time.vi" on a PXI chassis.  The input only allows an I32 from 0 to 59 for seconds. 

 

Question 2:  We have an NTP server on our lab network.  I am setting the hosts time with it and periodically having it update the PXI's time using the above mentioned VI (this limits accuracy to at least 1 second + loop times).  Is there a way to synch an NTP server time on the target directly (not passing through the host)?

 

 

 

0 Kudos
Message 1 of 13
(6,573 Views)

Answer1: It is not possible to set the fractional seconds using "RT set Date and Time.vi". It has a precision of seconds.

 

Answer2: The VI in the link below can be run on target which directly communicates with the specified NTP server.

 

http://zone.ni.com/devzone/cda/epd/p/id/3264

 

I looked at the BIOS settings of PXI if we can sync to a NTP server  but could not do that. Let me know if you have any questions.

Message Edited by GaneshN on 09-04-2009 01:33 AM
Message 2 of 13
(6,541 Views)

Thanks GaneshN.  That is unfortunately what I was afraid of. This will degrade the 2-3msec accuracy of the NTP signal with the 1 sec accuracy of the PXI set time VI (and DLL). 

 

We also tried using a PXI-6608 card with our available IRIG-B signal, but had hardware compatibility issues (long and painful story about using an analog IRIG to digital IRIG converter and it's compatibility with the 6608). So we found an NTP server that utilizes the analog IRIG as an input and are synching our devices to it's NTP output.  But it seems the PXI chassis will be off by up to a second.  We will have to use a digital line synch signal; if we could get the full accuracy of the NTP server, we could have forgone that effort.  Bit of a bummer.

 

Thanks for the link - but it is for DAYTIME protocol (a simpler but different protocol than NTP) and still has the underlying problem that it uses the "RT Set Time.VI" which has a 1 second accuracy. Thanks though, we might be able to modify it for NTP

 

 

0 Kudos
Message 3 of 13
(6,526 Views)
Hey there's a question - how does a PXI-6608 card effect the chassis's clock based on it's resolving of an IRIG input.  There has to be someway then to set the clock accurately (or is too low level to get to)?
0 Kudos
Message 4 of 13
(6,522 Views)
Sorry.  Replied to the wrong thread.
Message Edited by Justin_P on 09-04-2009 03:23 PM
Justin Parker
National Instruments
Product Support Engineer
0 Kudos
Message 5 of 13
(6,512 Views)

Have you tried just routing the internal PXI 10 MHz clock to one of your counter/timers?  This seems to work for me, certainly within 2-3 ms accuracy.

 

The clock isn't perfect (I normally see about 1 ms of drift every 10 minutes), but regular NTP synching keeps it in check nicely.

 

Ian

0 Kudos
Message 6 of 13
(6,413 Views)

Ian ,

 

The problem is that the PXI is one of many devices in our laboratory.  If I follow you, using NTP and the 10Mhz clock keeps accurate relative time on the chassis, but the accuracy of the time can be off by up to a second because to the outside world because of the NTP VI (and DLL) uses only whole seconds. 

 

In our lab we have numerous subsystems using NTP to get their clocks relatively synced (other video and data systems).  But the problem we see is that the PXI chassis when it uses the NTP time, it rounds the seconds (kinda defeats the purpose of using an accurate absolute time signal eh).

 

Still don't know how I can externally set the PXI's clock to accurate absolute time..........

Message Edited by bradh on 09-14-2009 03:20 PM
0 Kudos
Message 7 of 13
(6,409 Views)

Have you all looked into this?

 

http://zone.ni.com/devzone/cda/tut/p/id/8278

 

There is a section at the bottom about NI-Sync for PCI and PXI hardware modules.

0 Kudos
Message 8 of 13
(6,400 Views)

Sorry, my first message wasn't very clear.

 

I agree that the system clock is next to useless for accurate timing, because you can only update it to the nearest second (AFAIK).  For this reason I'd suggest that you ignore it and keep track of your own clock instead - your PXI-6608 card should be ideal for this.

 

The method I use is:

 - Set a 32-bit counter running at 10 MHz using the PXI clock (or the more accurate clock from your PXI-6608?)

 - Store a 64-bit integer in software (in my case in an Action Engine) which I add to the current counter value to convert it to an absolute time

 - Modify the available NTP examples so they will update this stored offset

 

The only other thing to beware of is to handle overflow on the counter (i.e. add 2^32 to the offset whenever overflow occurs).

 

Hope this helps,

Ian

0 Kudos
Message 9 of 13
(6,387 Views)

rgodwin - Thanks for the link.  I am going to keep my eye on it.  We looked into the PXI-6682 initially.  Unfortunately (and rather oddly) it does not have RT drivers (odd in that it is a deterministic ethernet driver, even our local NI engineers were surprised at this).  We are using RT.

 

Ian - In your first step, are you saying that I should connect the PXI-6608 discrete lines to an external device that encodes the millisecond count?    The reason I ask is that more than needing the time to be percision the  PXI, I want it to match other devices in my lab (as I mentioned who get their time from the NTP server).

 

 

0 Kudos
Message 10 of 13
(6,319 Views)