Shayan Posted September 15, 2020 Report Share Posted September 15, 2020 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. Quote Link to comment Share on other sites More sharing options...
MVP 2022 kratmel Posted September 15, 2020 MVP 2022 Report Share Posted September 15, 2020 For understand how to set timer - please use Load timer/counter preset function for 1, 5, 10....360 min timer preset. You see in ML numbers that you must to calculate for this purpose. Quote Link to comment Share on other sites More sharing options...
MVP 2022 Flex727 Posted September 15, 2020 MVP 2022 Report Share Posted September 15, 2020 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. Quote Link to comment Share on other sites More sharing options...
MVP 2022 Flex727 Posted September 15, 2020 MVP 2022 Report Share Posted September 15, 2020 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. Quote Link to comment Share on other sites More sharing options...
MVP 2022 Flex727 Posted September 15, 2020 MVP 2022 Report Share Posted September 15, 2020 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. Quote Link to comment Share on other sites More sharing options...
Gabriel Franco Posted September 15, 2020 Report Share Posted September 15, 2020 The rung you show is disabled, then is not asigned preset to T0 Quote Link to comment Share on other sites More sharing options...
Shayan Posted September 15, 2020 Author Report Share Posted September 15, 2020 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! Quote Link to comment Share on other sites More sharing options...
Shayan Posted September 15, 2020 Author Report Share Posted September 15, 2020 4 hours ago, Gabriel Franco said: The rung you show is disabled, then is not asigned preset to T0 I only disabled after I observed it wasn't working. Quote Link to comment Share on other sites More sharing options...
MVP 2022 kratmel Posted September 16, 2020 MVP 2022 Report Share Posted September 16, 2020 I test your code in v350 and in V570 - work without problem. Please test it. 570_timer_test.vlp Quote Link to comment Share on other sites More sharing options...
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.