Vidmas30 Posted December 18, 2015 Report Share Posted December 18, 2015 Good day, everybody, Never been in such situation before: communicating with Omron PLC's. To minimize number of modbus operations Omron programmer gives us information about control bits in 16-bit registers. We are reading and storing them in Unitronics 16-bit registers (MI). But now came thought that Vision MI max value is 32767(in case 15 of control bits are set to 1). But if all 16 bits are set, then value becomes 65535. All messed up in the head.. Vision is using signed 16bit registers and Omron unsigned, I think. Do we have to use DW or ML variables in such case? Thank you for help. Link to comment Share on other sites More sharing options...
dan Posted December 18, 2015 Report Share Posted December 18, 2015 Hi Vidmas30, It appears the issue is with signed and unsigned 16 bit registers. A MI is signed 16 bit register, with a range of -32768-32767. A unsigned 16 bit register would have a range of 0-65535. A 65535 for a Unsigned register will result in a value of -1 for a signed register. The bits will still translate directly, however. You can read the value, and break the value down into bits using the function block Vector > Numeric to bits. It will take the MI, and break it does into MBs. Alternatively, a DW is a 32 bit Unsigned register. I hope you find this helpful. Dan 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