LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

cRIO System Configuration time zone issue

Solved!
Go to solution

I'm using LabVIEW 2017 to set a cRIO 9065 time and time zone with the Set Time VI under the System Configuration palette. After getting a few incorrect times, I probed a little deeper and found the System Hardware's Time:Time Zone property doesn't match what's reported in MAX, Linux RT shell, or the LabVIEW time stamp itself.

 

For example if I use Set Time to set the cRIO's time zone to Etc/GMT+10, MAX reports the time zone has been set to GMT-10 (note the minus sign). Similarly if I use MAX to set the timezone to (GMT-6) Pacific Time (US & Canada), Mexico City, reading the Time:Time Zone property reports GMT+6 (again note the negated sign). If the time stamp is read and converted to a time string (%c), it shows the same -06 offset as MAX.

 

If I SSH into the controller and run a date command, it reports the same time zone as the one shown in MAX.

 

See the attached picture showing the three agreeing time zones, and the seemingly incorrect one from Time:Time Zone. Is this the expected behaviour of the Time:Time Zone property? I could negate the sign for this property, but it feels wrong...




Certified LabVIEW Architect
Unless otherwise stated, all code snippets and examples provided
by me are "as is", and are free to use and modify without attribution.
0 Kudos
Message 1 of 5
(3,338 Views)

Oops, make that a cRIO 9068, not a 9065.




Certified LabVIEW Architect
Unless otherwise stated, all code snippets and examples provided
by me are "as is", and are free to use and modify without attribution.
0 Kudos
Message 2 of 5
(3,316 Views)
Solution
Accepted by topic author MichaelBalzer

Looks like things are working as expected. I had naively assumed the Etc time zone was a general catch-all (rather than using a country/city code to specify the time zone), but it is a special designation. From Wikipedia:

 

"In order to conform with the POSIX style, those zone names beginning with "Etc/GMT" have their sign reversed from the standard ISO 8601 convention. In the "Etc" area, zones west of GMT have a positive sign and those east have a negative sign in their name (e.g "Etc/GMT-14" is 14 hours ahead of GMT.)"




Certified LabVIEW Architect
Unless otherwise stated, all code snippets and examples provided
by me are "as is", and are free to use and modify without attribution.
Message 3 of 5
(3,296 Views)

NI need to update their time zone KB article with the reverse sign info, as it makes the same (incorrect) assumption I did:

 

"Time Zone strings need to be of the form Etc/GMT-X or Etc/GMT+X where X represents the offset from GMT. For example Etc\GMT-6 is the equivalent to Central Standard Time in the US"

 

Etc/GMT+6 is Central Time in the POSIX format, though is 6 hours behind GMT.

 

As an aside, these new KB changes lack the ability to provide ratings and written feedback on KB articles. Now there's just a silly thumbs-up/thumbs-down with no option for error reporting.




Certified LabVIEW Architect
Unless otherwise stated, all code snippets and examples provided
by me are "as is", and are free to use and modify without attribution.
0 Kudos
Message 4 of 5
(3,269 Views)

Hi MichaelBalzer, 

Thanks for drawing the incorrect information to our attention. We have updated the KnowledgeBase article to show the correct signs to align with the Etc/GMT format. Sorry for the confusion!

If you are in need of any more information regarding the inputs for the Set Time VI please see the Set Time VI help, as it provides more details than the KnowledgeBase article. I've also added the help link to the KnowledgeBase article in hopes of helping anyone who may run into similar problems in the future. 

Thanks again for providing feedback on the article and helping us correct the information!

Carli S.
Troubleshooting & Maintenance Digital Business Manager - NI
Message 5 of 5
(3,226 Views)