scaling analog input in Cscape touchscreen

nosajnil

Member
Join Date
Apr 2017
Location
USA
Posts
20
I am trying to display an analog input on the screen, but it is not scaling properly.
The pressure sensor is a Setra_Model_264. that measure 0 to 0.1 " of water column. then output 0 to 5 Voltes.
In the debug mode, the number seems to scale correctly to -0.01045.
But the display on the screen is showing -17825 (it fluctuate from -24326 all the way up to 31038).
You may see the register I used in the attachment.

2.jpg 3.jpg IMG_6931.jpg IMG_6937.jpg
 
Real number can also be negative with decimals right? (is Real number the same definition in PLC vs math world? )
 
Thank you everyone. I changed the analog input to 16 bit, the rest to be 32 bit for real numbers. display as real with decimal and works!
 
So it was working fine displaying 32 bit on a number display.
I wanted to show on a circular gauge which takes 16 bit as input.
I convert the number using real to int. But now both the 32 bit and 16 bit number goes to zero. why is that?

q 1.JPG q 2.jpg
 
sorry misread your post it's possible the 32 bit takes up two memory slots and you are overwriting part of it with you real to INT function

%R01011 may be part of your 32 bit %R01010

Move you real to INT to %R01012


from manual
32-bit values (DWORD, DINT, UDINT) occupy 32 consecutive bits of data, or two (2 consecutive 16-bit
registers. For example, if a DINT is defined at Register %R43, the 32-bit value is contained in %R43 and
%R44.
 
Last edited:
Thanks, that did the trick! I remember professor warn us about similar things in C programming language class. I never bother about it assuming there is unlimited memory.
 

Similar Topics

Dear all Iam using three load cells connected in parallel to calibrate the weight of a product but in don't have a weighting module in my...
Replies
4
Views
3,488
Hello everyone, I have a plc 5 input card receiving an input from a conductivity Transmitter where 0ma=0 uhms and 20ma= 20,000 uhms The raw min...
Replies
8
Views
3,631
Hello everyone, I have a plc 5 input card receiving an input from a conductivity Transmitter where 0ma=0 uhms and 20ma= 20,000 uhms The raw min...
Replies
2
Views
1,832
Hello! I am new at PLC programming. I am using TM221CE16R PLC with TM3AI8 analog input module and SoMachine Basic v1.6. I am trying to scale...
Replies
8
Views
7,072
Hello, I have a Micrologix 1400 PLC and using RSLogix 500. Using a Multi Ranger Ultra Sonic Level Sensor and the input is moved to N7:11, then...
Replies
15
Views
3,896
Back
Top Bottom