03-20-2008 01:25 PM - edited 03-20-2008 01:32 PM
03-20-2008 06:05 PM - edited 03-20-2008 06:06 PM
Hi Rex,
Just for everyone else, your referring to the article: Using the SMB Connector for Digital I/O on cRIO-901x Controllers correct? To be clear the SMB pin on the cRIO-901x can be used for two purposes:
1. A general purpose DIO line
2. As an input for a PPS signal to help correct for drift of the system clock.
The general purpose DIO line requires the code attached to the above article. To use the SMB input to help correct for drift of the system clock you only need to configure the ni-rt.ini file and you do not need to implement any software/VI code yourself as the 901x controllers have the drift correction code already built into the software. You are just required to enable it by configuring the ni-rt.ini file with the following keys:
Time Sync]
source.rtc.enable=True
source.dio.enable = True
source_priority=dio;rtc;
source.dio.hz = 1.0
I haven't looked at your VI above yet, but if your using the SMB read/write VIs you should remove those as you must either use the SMB line as a General purpose DIO or as an iput for the PPS signal. Doing that may help you control the drift better. I do think that application is interesting and I would be interested to see what you come up with. How is the GPS serial stream coming to the controller? I would think you should be able to wait on a read and set the RT clock in the msec range.
Hope that helps. Let me know how it goes after updating the VI.
Basset Hound
03-20-2008 06:09 PM
Oh by the way,
An easy ( relative ) way to post an image of your code is:
Basset Hound
03-25-2008 01:31 PM - edited 03-25-2008 01:41 PM
03-26-2008 12:51 PM
Rex,
I think I understand what your trying to do. First couple of things to make clear: the SMB pin can only be used as either a general DIO pin OR for drift correction, not both at the same time. What this means is you cannot use it both as a DIO line and also use it to help correct for drift by inputing a PPS as you've described. Basically, if your going to use it as a general DIO then the lines in the ini file are not going to do anything for you. Also, if your inputing a pps signal into the the SMB pin ( and not using as a DI input ) it will just correct for drift, and will not give you synchronization between different the different RT systems. The drift correct will not be setting the time in any way at all.
Currently there is not an interrupt method you can use with the SMB pin and polling is the fastest way of checking the pin. I wouldn't recommend the SMB pin to be used for synchronizing systems especially if your using it as just a general DIO line. The is mainly because its just software timed when used as a general DIO. However, you can write/read the pin in the range of 100 usec per write/read.
For synchronizing multiple cRIO systems I would normally recommend adding a DIO module (9401, 9403) to the cRIO to allow synchronization of the FPGA by sharing a start trigger or scan clock. This solution provides synchronization down to microsecond levels.
If your looking for synchronization in the usec level the a DIO module is the way to go. If you need in the 10 of ms range, a NTP time sever will work. If in the seconds range, then normal ethernet communication should be sufficient.
Let me know if that helps at all.
Basset Hound
03-26-2008 01:09 PM
03-27-2008 09:24 PM
03-28-2008 09:53 AM - edited 03-28-2008 09:54 AM
04-09-2008 01:08 PM
04-10-2008 10:03 AM
Hi rex1030,
Thanks for the information! It seems like you have all your questions answered.Good luck with the application!