Jump to content

Change preset timer from hmi


Recommended Posts

There isn't a direct way to limit the users input, but it is possible to regulate it using functions within the logic.

 

To implement this you can use the "Load Timer/Counter Preset" function. This will load the value of a timer into an ML operand with a resolution of 10ms. All of the load/store functions related to times work with values of 10ms (eg. a value of 1 = 10ms)

 

For example: A timer with a preset value of 30.00 (30 seconds) will load a value of 3000 into the ML. A timer with a preset value of 1:30:00 (1 minute 30 seconds) will load a value of 9000.

 

You can then use this value in the ML in a comparison statement so that if a value is above or below a desired amount, to re-load a value into the timer to enforce a limit.

  • Upvote 1
Link to comment
Share on other sites

There isn't a direct way to limit the users input, but it is possible to regulate it using functions within the logic.

 

To implement this you can use the "Load Timer/Counter Preset" function. This will load the value of a timer into an ML operand with a resolution of 10ms. All of the load/store functions related to times work with values of 10ms (eg. a value of 1 = 10ms)

 

For example: A timer with a preset value of 30.00 (30 seconds) will load a value of 3000 into the ML. A timer with a preset value of 1:30:00 (1 minute 30 seconds) will load a value of 9000.

 

You can then use this value in the ML in a comparison statement so that if a value is above or below a desired amount, to re-load a value into the timer to enforce a limit.

 

 

 

 

 

 Thanks for your help

Link to comment
Share on other sites

  • 2 years later...

Just found this thread,

I seem to have an issue setting the preset of a timer via the HMI. I'm using the HH.MM.SS (I have also tried HH.MM.SS.hh) option on keypad entry however when i run my project and view the timer in the watch window the preset always stays at 00.00.00.00, yet when I do a LD TP block the ML value changes when i change my timer on the HMI.

Unfortunately I am unable to post my code on here, but I would assume the 'timer preset' HMI function would then transfer the value to the Timer and would start to run when you call the Timer Coil in the code? The timer coil has [00.00.00.00] written next to it and it seems that when I call the timer to run after presetting it, the 00.00.00.00 value from the coil is overwriting the timer and instantly resetting the timer to 0.

I have a feeling I am missing something obvious here but any help is greatly appreciated.

Thank you

Jon

Link to comment
Share on other sites

  • MVP 2023

Which of the 3 types of timers are you using? Just working from memory, a new timer preset will not take effect until a timer coil is called in the ladder, or if a timer reset coil is activated. Are you certain the timer coil is actually being activated (i.e. is the subroutine being called, etc)?

Link to comment
Share on other sites

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.   Paste as plain text instead

  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...