09-02-2009 04:07 PM
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)?
09-04-2009 01:24 AM - edited 09-04-2009 01:33 AM
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.
09-04-2009 08:24 AM
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
09-04-2009 08:34 AM
09-04-2009 03:20 PM - edited 09-04-2009 03:23 PM
09-14-2009 03:02 PM
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
09-14-2009 03:18 PM - edited 09-14-2009 03:20 PM
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..........
09-14-2009 04:38 PM
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.
09-15-2009 01:49 AM
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
09-21-2009 02:40 PM
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).