Written on: 19. 02. 2013 [22:25]
|
lennart
Lennart Carlsten
Topic creator
registered since: 19.02.2013
Posts: 2
|
I want to scale -200 to 1372 degrees.
The device manual say this.
Temperature A 16-bit signed integer value with resolution of 0.1°C/lsb.
For example, a value of 12059 is equivalent to 1205.9°C,
a value of –187 equals –18.7°C. The maximum possible
temperature range is –3276.8°C to +3276.7°C.
As soon as I go under 0. I have the crazy numbers. 65354
Anyone who nows how to solve this problem.
|
Written on: 20. 02. 2013 [07:00]
|
almaz
Almaz Karimov
Contributor
registered since: 25.09.2008
Posts: 516
|
if (in > 32767) out = (in-65536)/10; else out = in/10;
(65354-65536)/10 = -18.2°C
21 век - век повсеместной автоматизации. Главное - во благо всем людям.
|
Written on: 20. 02. 2013 [08:31]
|
roman
Roman Savochenko
Moderator Contributor Developer
registered since: 12.12.2007
Posts: 3750
|
"lennart" wrote:
Temperature A 16-bit signed integer value with resolution of 0.1°C/lsb.
But ModBus register is 16-bit unsigned. For 16-bit signed use suffix "_i2": http://wiki.oscada.org/HomePageEn/Doc/ModBus#h871-16
Learn, learn and learn better than work, work and work.
|
Written on: 20. 02. 2013 [21:52]
|
lennart
Lennart Carlsten
Topic creator
registered since: 19.02.2013
Posts: 2
|
Thanks, that solved my problem! Great program but much to learn!
[This article was edited 1 times, at last 20.02.2013 at 21:53.]
|