This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Strange modbus scaling
#1
Hello,

I have a modbus device that scales values in a strange way and I don't know how to make it work, if possible, with LM5.
Basically the formula is: (value+5)*2+30, in other words it reads values from -20 to 100 and represents values from 0 to 240

so, for example, if the value read by the instrument is -20, via modbus I will read 0.

Any ideas on how to integrate it in a json modbus profile?
Reply
#2
value_base = -20
value_multiplier = 0.5

Formula:
value = value_base + value * value_multiplier
value = -20 + value * 0.5

If read value is 0 the resulting value is -20. If read value is 240 the resulting value is 100.
Reply
#3
thanks! I've tried it before but I must have done something wrong
Reply


Forum Jump: