Jump to content

Recommended Posts

Posted

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

Posted (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

 

 

Subroutine.jpg.04eaecdeadc587e2029e63c33

 

DateTime_Main.thumb.jpg.ad892aedd3bdd498

 

ChangeTime.jpg.44b271124c476a339f0322637ChangeDate.jpg.1a5fdd2de06d83ab12c069675

 

 

 

Edited by Str8jCkt
Posted

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!

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...