NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change cRIO system time without MAX/WebMAX

Solved!
Go to solution

When building up a new cRIO, I have to use MAX format the disk and install NI Software. This resets the system time zone to UTC, but our requirements need it to be set to the local time zone. I run several bash scripts to install other components after I'm finished with MAX, so I want to add one that ensures the device is using the correct time in the local time zone.

I see that RT Linux maps /etc/localtime to /etc/natinst/share/localtime, which then maps to one of the standard /usr/share/zoneinfo/ directories. I know that /etc/natinst/share/ni-rt.ini holds the time zone used by MAX and Sys Config. I expect that if I change the system time zone, I'll have to use /usr/local/natinst/bin/nirtcfg to modify the LVRT:RTTarget.TimeZone key so it matches reality. How do I get my change in the INI file to update the /etc/natinst/share/localtime symlink? Is it safe to just do that myself with rm and ln -s?

Is there anything else I should do to prevent conflicts or disaster?

Edit: Fixed path to the tool that modifies ni-rt.ini

0 Kudos
Message 1 of 3
(3,493 Views)
Solution
Accepted by topic author Staab_Engineering

That should be fine, just a couple of comments:

Use nirtcfg to work with the .ini file. Run without arguments for usage info.

Use ln -sf to more-atomically update a symlink (this replaces the two-step rm and ln)

Message 2 of 3
(3,254 Views)

Thanks. I had a copy-paste error when I called for nilvrt earlier. I've edited the post to correctly call for nirtcfg.

0 Kudos
Message 3 of 3
(3,254 Views)