Jump to content

Recommended Posts

This logic works for (MI 3) values between 1-5 minutes, but after that the timer will always be preset to about 5 and a half minutes. I'm assuming this issue has to do with the timer not having enough bits? I want to be able to store preset values ranging from 1-360 minutes, any way to do this?

PLC is  a V570.

Thanks.

Visilogic Example.png

Link to post
Share on other sites

That logic you're showing is correct and absolutely should work. Trust me, there is no shortage of bits with the timer preset. Do a Find on MI 3, ML 0,  ML 1, & TD 0 to confirm they are not being overwritten somewhere else in the program.

Link to post
Share on other sites
Just now, kratmel said:

For understand how to set timer - please use Load timer/counter preset  function for 1, 5, 10....360 min timer preset.

You see numbers that you must to calculate for this purpose.

Shayan's calculation for the timer preset is correct.

Link to post
Share on other sites

Another thing that occurs to me is that a 16-bit number (MI) has a maximum size of 32767, which translates to a little over 5 1/2 minutes on a timer preset. That is suspiciously close to the time you state is causing the problem. Your first calculation uses MI 3, but the result of the multiplication, and the rest of the calculations go to MLs, so there is no problem there at all. I would be looking for other instances of those MLs to make sure no other MIs are involved.

To be clear, your logic is fine and WILL work as is. There is a problem elsewhere in the program.

Link to post
Share on other sites
4 hours ago, Flex727 said:

Another thing that occurs to me is that a 16-bit number (MI) has a maximum size of 32767, which translates to a little over 5 1/2 minutes on a timer preset. That is suspiciously close to the time you state is causing the problem. Your first calculation uses MI 3, but the result of the multiplication, and the rest of the calculations go to MLs, so there is no problem there at all. I would be looking for other instances of those MLs to make sure no other MIs are involved.

To be clear, your logic is fine and WILL work as is. There is a problem elsewhere in the program.

Ya not sure what's going on and this is the only net I use all those operands. I ended up just creating a timer display value on the HMI screen and enabling the timer to be set via the controller's keypad. Should've done that at the start!

Link to post
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...