01-25-2021 04:16 PM
I apologize if this is an easy fix, but I've searched quite a few posts already and nothing seems to do the trick. Plus they are all from like 2008 and whatnot, so I'm hoping there has been an easy fix since then.
Anyways, when I try to display the time, it is incorrect. For example, it is currently 3:02 pm here, and my VI is showing 10:42 am. It does display the correct date.
My laptop's time setting is UTC-7 Mountain Time. I went into Measurement and Automation Explorer and set my cRIO's time zone to be GMT-7 Mountain Time, saved it, and reset the controller. I also restarted labview.
In my block diagram, I'm using a Seconds to Date/Time with an indicator, a Get Date/Time String with indicators, and a Get Date/Time in Seconds with indicator. All 3 are showing 10:42 am.
I attached my VI to this post. This is my first labview program, so I apologize if it's messy or I used any wrong terminology.
01-25-2021 05:24 PM
A timestamp is just a timestamp, which is simply "seconds since whatever epoch time". The LabVIEW indicators simply format it into something readable by a human. You can set the properties of the indicator to display UTC, if you like.
01-25-2021 08:42 PM
After you set the timezone on the cRIO did you set the time?
01-26-2021 12:08 PM
I did not! I didn't see the option to! I will see if I can find out where to do that.
01-26-2021 12:33 PM
You should be able to do that within MAX.
01-26-2021 02:37 PM
Negative, that is not an option.
01-26-2021 05:32 PM
You don't have a Time Settings Tab for it in MAX?
Which of the Ethernet ports on the cRIO are you plugged into? I think I once read that you don't get full control off the second port, only the first. On mine they are labelled 0 and 1. So if you are in the second port, try plugging into the first and try again.
01-26-2021 07:04 PM
After following this topic, only now did I realize that I misunderstood the issue. Sheesh.
01-27-2021 09:48 AM
@David99999 wrote:
Negative, that is not an option.
This should be editable. Changing the timezone does not normally adjust the clock for the difference of the timezone.
01-27-2021 09:58 PM
I'm not sure that all RIOs can have their time set by MAX -- I recall having trouble doing this with a myRIO. However, if the RIO is connected to a PC, you can use the PC to set the (my)RIO's time. You need to know the RIO's IP (you can write code to find this out), then use System Config's Set Time to set the time to, say, the TimeStamp returned from Get Date/Time in Seconds. You can find Set Time in the Real Time\RT Utilities\System Configuration Palette.
I confess that I was surprised when this worked!
Bob Schor