Squirrel Posted September 2, 2024 Report Posted September 2, 2024 Hello all, Does the TIME_OF_DAY date type not work on HMI like it does on NX? I'm trying to setup a modify value on HMI that set TOD to current time, Thanks for the help Quote
photovoltaic Posted September 3, 2024 Report Posted September 3, 2024 No, the HMI doesn't recognize TOD. To work with TOD you convert seconds to TOD. If you're referring to the PLC clock it's the DATE_AND_TIME datatype that you need - use SecToDt to convert seconds to DATA_AND_TIME. The instruction reference will guide you - I think I have some FBs laying around that do it for you - I'll check Quote
Str8jCkt Posted September 4, 2024 Report Posted September 4, 2024 (edited) @Squirrel Not sure if you are just wanting to pull the Current time-of-day from the HMI system clock or you are wanting to make changes to the system clock. To pull time of day there are a couple ways you can do this. First put the Current time in a holding variable of type Date. Then you can strip just the TOD (HH:MM:SS) out of it and put it into a string variable. To edit you can use the integrated keypad to edit the holding variable DateTime and update the "TOD" variable as needed. You can trim the Keypad to just allow edit only to the hour/min/Sec components if desired. Program file is too large to attach but could be something like below Edited September 4, 2024 by Str8jCkt Quote
Squirrel Posted September 6, 2024 Author Report Posted September 6, 2024 That is basically what I was stuck on, I was trying to make the HMI editable through TOD. But I forgot to make it a variable to a TOD, it's for a auto on/off PLC start up. I didn't want to have be only one knowing how to modify a variable, but thanks for the information! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.