CarlosMDC Posted November 12, 2018 Report Share Posted November 12, 2018 Hello fellow users, I'm quite new to Unitronics so please have some patience. I am in the process of re-purposing an old PLC implementation. I wanted to know how the Vision 130-33-TA24 PLC handles a full, 32 bit double word operand when it tries to increase past it maximum value. I am currently using this operand to count the pulses of an analog flow meter to log the accumulated m3 of water. Do I have to reset the operand to 0 in the ladder logic before the max is reached or will it reset itself ? or will it show an error that it can't increase past its max value? I must admit I can't seem to figure out how to search for this condition in the help guide. Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted November 12, 2018 MVP 2023 Report Share Posted November 12, 2018 Are you talking about a DW or an ML operand? The value when the register overflows is slightly different (the ML will go to the max negative value since it is a signed 32-bit integer, and will count up from there). In either case, no error will be generated. −2,147,483,648 to 2,147,483,647 is the range for an ML (32-bit signed integer) 0 to 4,294,967,295 is the range for a DW (32-bit unsigned integer) 2 Link to comment Share on other sites More sharing options...
CarlosMDC Posted November 12, 2018 Author Report Share Posted November 12, 2018 Thank you for the reply Flex, I'm using the DW operand. Will this operand overflow in the same fashion? Meaning it will start once again from its minimum possible value of Zero. Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted November 12, 2018 MVP 2023 Report Share Posted November 12, 2018 I can't remember the last time I tried to count to 4,294,967,296, but I believe that's the case. It's simple enough to test in online mode. Link to comment Share on other sites More sharing options...
CarlosMDC Posted November 12, 2018 Author Report Share Posted November 12, 2018 Thank you Flex for your insight on the matter! Link to comment Share on other sites More sharing options...
MVP 2023 Ausman Posted November 12, 2018 MVP 2023 Report Share Posted November 12, 2018 Alternatively do some maths before your overflow condition is reached, with the "tipping point" then adding 1 to another DW which is the count for the much larger amount, and then resetting the primary count to 0. Depending on how quickly this all happens, sometimes you even cascade this sort of thing down through a series of DWs. I arrange the maths so that the cascaded DWs etc are all in simple to work with numbers, like exactly 1,000,000,000. Each time this condition is met at the primary count, the +1 addition is done to the next DW and the primary count is reset to 0 and starts again. So you might end up with primary of 984,455,654 and the next one in line being 123,456 which means your total count is 984,455,654 + (1,000,000,000 X 123,456) = 123,456,984,455,654. The final maths is done in whatever external program is used to monitor the results, but doing things the way I have said above also makes it easy to do things in your head if necessary. cheers, Aus 1 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