integer to floats

dbh6

Lifetime Supporting Member
Join Date
Jan 2013
Location
Central, NJ
Posts
552
PLC SLC5/04

i am doing some limit comparisons based on ranges coming from an analog input card. Thing is the analog input card will have a raw count value from 0-32767, and im scaling that to 0-10.

My limit comparasions however are decimal values like limit ranges between 5.5 & 10, 4.5 and 1.2 etc.

So what i did was use a MOV instruction to move the raw I register into a Float register ex. F8:0, then use that F8:0 to do my comparisons.

Would this be the correct way to convert signed integers to floating points basically decimals???
 
You can use the "SCP" instruction to scale your raw data 0-32767 to 0.0 to 10.0 with a floating point data type as the destination of your "SCP" instruction instead of an integer.
 

Similar Topics

Hi. I'm using a Modbus ProSoft where I basically map data to a big INT array. Example, where GX_I_63HPU is a REAL, MNETC.DATA.WriteData[200] an...
Replies
21
Views
436
Good morning all, I'm integerating a device with a Rockwell PLC with V34 Studio 5000. The device reports error codes using a single integer to...
Replies
19
Views
1,293
Ex If I Read from Integer file N7:0 N7:0 is an 8 point input card , input 0 and 2 are on , rest off When I look at : N7:0 -7 6 5 4 3 2 1 0 I...
Replies
5
Views
749
The analog array has 16 individual bits and each bit is an alarm. SCADA is having issues getting the BIT bool value. However they can get the...
Replies
9
Views
1,025
I set up a Mitisubishi test system on the bench. Q03UDSPU Q173DCPU MR-J3-40B HF-KP43 HMI is a LS XP50 TTA/KP43 I am trying to use a signed...
Replies
1
Views
396
Back
Top Bottom