LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sync Rio to realtime clock?

I had forgotten that the  cRio 9075 contoller/chassis doesn't  have a battery backed RT clock.

 

We are about to start developing a system that will be powered down completely, then started up in the field from a battery bank. Anybody have any suggestions for a realtime clock we can use to set the internal clock on startup?

 

The 9075 chassis has a serial port we aren't using, but I haven't found any small clock units that have RS-232. I have seen several really cheap clock modules that use I2C comms. 

 

Our NI-9381 Multifunction module has a 4bit LVTTL port, could we use that for I2C comms with a clock module? Anybody tried that?

0 Kudos
Message 1 of 12
(3,511 Views)

Do you have access to a network?  If so, you could synchronize to an SNTP server:

http://digital.ni.com/public.nsf/allkb/F2B057C72B537EA2862572D100646D43

Applications Engineer
National Instruments
0 Kudos
Message 2 of 12
(3,449 Views)

No network. It will be in the cargo area of an airliner, powered up just before takeoff, running on batteries.

0 Kudos
Message 3 of 12
(3,434 Views)

If that's the case then likely it's best to use the NI 9467 which is a GPS module that can be used for time sychronization.  If you are able to start running the device before takeoff, this should work great.  However, if synchronization needs to occur during flight, the speed and altitude could cause connectivity issues.

Applications Engineer
National Instruments
0 Kudos
Message 4 of 12
(3,412 Views)

Thanks for the suggestion, but there's no GPS signal in the belly of an airliner. Spending that much money, and then having to install an antenna system, which the airline isn't going to do, to get signal, when all we want is for this thing to wake up knowing approximately what time it is, is not practical.

 

 

At least to start with, we'll have to make a provision to set the clock from the Labview app we'll use to display data for troubleshooting. Until we figure this out we'll just have somebody to set the clock from a laptop and have it stay powered after that.

 

I guess the easiest thing is to get an RS232 to I2C converter and one of the $12 I2C clock modules and tuck them in somwhere.

 

Since the RIO is all about embedded autonomous operation, why on earth didn't NI put a battery backed clock  in there? Or do some of the more expensive controllers have them?

0 Kudos
Message 5 of 12
(3,401 Views)

Hello Bill,

 

Specifically, the cRIO 9075/6 and sbRIO 9605/6 don't include a battery backup for the RTC- this is noted in the product specifications and user guides for these models.  This KnowledgeBase article has additional information and recommendations for operation where maintaining relative time is a factor:

 

KnowledgeBase 5R7AJIES: System Time On sbRIO-9605/9606 And cRIO-9075/9076

http://digital.ni.com/public.nsf/allkb/D6734E48D0705B9386257942005DEA30

 

As you noted, if you have no access to an external network or GPS then a standalone external clock may be the most appropriate option. There are plenty of these available on the market, the only caution I'd give you is that a large number of the cheapest ones are just oscillators- you'll probably want something that returns an actual timestamp of some sort.  I've had good experiences with iButtons in the past, although I've not used them with cRIO or the VxWorks OS.

 

Best Regards,

Tom L.
0 Kudos
Message 6 of 12
(3,392 Views)

Sorry, shouldn't complain, the specs were there to be read, and we probably couldn't have used antthing else due to budget and space limitations anyway. 

 

Here are links to a couple of the I2C clock boards for anybody who's interested:

 

https://www.sparkfun.com/products/99

 

https://www.futurlec.com/Mini_DS3232.shtml

 

Also an I2C conerter that looks like we  might be able to screw it down right on the serial connector of the 9075:

http://www.coptonix.com/_en/html/i2c-slave_rs232_ad.html 

Message 7 of 12
(3,380 Views)

This project has been on hold for some time, but I think about it now and then. It just occurred to me that maybe there's an easier way to accomplish this. Anybody know offhand of a microcontroller board like Beaglebone, Arduino, RasPi, etc. that would have a battery backed RT clock and an RS 232 port?

 

I'm thinking it could be a one piece solution to this problem (RIO without RT clock). We could just program it to spit out the time every second, or in response to a query from the RIO. Only really needed at powerup to get close to real time and date. I'll probably find it eventually, but any thoughts are welcome.

Thanks

BG

0 Kudos
Message 8 of 12
(3,226 Views)

Do you have any spare digital lines and a little extra FPGA space?

 

You could always implement a SPI port on the FPGA through them: https://decibel.ni.com/content/docs/DOC-26411

 

You could read some SPI data, calculate the time based on the data packets, and call the RT Set Time function during the init of your RT code assuming you had an external SPI master or slave device that could broadcast the time as you mentioned previously.

 

I don't know of any timekeepers that natively broadcast RS232, but this would be even easier.

 

EDIT: Similarly, there a good library for I2C here as well: https://decibel.ni.com/content/docs/DOC-26410

Craig H. | CLA CTA CLED | Applications Engineer | NI Employee 2012-2023
0 Kudos
Message 9 of 12
(3,213 Views)

I just want to throw out another idea in case it is useful. If there are any clocks available that can act as a 1588 master, then NI-TimeSync can be used to synchronize the time on the cRIO with <1ms accuracy.

 

There are standalone clocks that can be purchased with this capability, but not sure how low budget they would be.

0 Kudos
Message 10 of 12
(3,185 Views)