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. Link to comment Share on other sites More sharing options...
MVP 2023 kratmel Posted September 15, 2020 MVP 2023 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. Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted September 15, 2020 MVP 2023 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. Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted September 15, 2020 MVP 2023 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. Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted September 15, 2020 MVP 2023 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. 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 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! 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. Link to comment Share on other sites More sharing options...
MVP 2023 kratmel Posted September 16, 2020 MVP 2023 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now