Trying to scale a 4 to 20 signal to read temp. I am using a banner radio gateway using Modbus protocol. I'm using an unsigned integer and when I try to scale it says it must be a signed integer. How am I supposed to scale this?
Trying to scale a 4 to 20 signal to read temp. I am using a banner radio gateway using Modbus protocol. I'm using an unsigned integer and when I try to scale it says it must be a signed integer. How am I supposed to scale this?
Not sure what your hardware will produce but you can convert a USINT to a SINT to get the conversion for your logic.
I assume your data coming across looks like something in the range of (0-23767) or similar.
If this is the case it will work.
If the data coming across is in the range of -32767 to +32767 you may have some issues.
Though I think horner uses a 32000 as a limit and anything over is an overflow.
Think I got it. Math functions will let me use this as an unsigned integer. I can divide it in half and then scale it with a min. value of 0 and max value of 32767.