Jump to content

Recommended Posts

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

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

  • Upvote 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.