Sign in to follow this  
Followers 0
Squirrel

NA5

4 posts in this topic

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

@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

 

 

Subroutine.jpg.04eaecdeadc587e2029e63c33

 

DateTime_Main.thumb.jpg.ad892aedd3bdd498

 

ChangeTime.jpg.44b271124c476a339f0322637ChangeDate.jpg.1a5fdd2de06d83ab12c069675

 

 

 

Edited by Str8jCkt

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0