Convert INT array to FLOAT (while scaling it - dividing it by 10 at same time)

darkesha

Member
Join Date
Nov 2007
Location
Calgary
Posts
107
Hi, I read a modbus map in array of 350 elements.
The destination is integer.

Now I want to copy this array into floating point array while scaling it at the same time (dividing it by 10).

Is this possible to be done in one instruction, such as DIV or compute or something more advanced ?

Something that would look like this ?

-div-
source A: INT[0]
source B: 10
destination: FLOAT[0]
length: 350

Otherwise I will have to go manually and divide every integer by 10 and store it into next subset of array.
Thanks
 
Last edited:
Yes, CtrlLgx platform.

Thanks, I will give it a go in 5 min.

---maybe not that fast though.
This plant goes down once every 2-3 years.
And since this has chance of major fault, I have to test it first.
 
Last edited:
see attached file

Inside your routine you will have:

INT[INDEX]/10 = FLOAT[INDEX]

source A: INT[0] (your modbus array)
source B: 10
destination: FLOAT[0]


Index is going to be from 0 up to 350.
initial value = 0
terminal value = 350
Step size is 1.

For.jpg
 
Last edited:

Similar Topics

I have a Structure in my project which has a few nested UDTs. They are ultimately of type DINT. What I would like to do is copy the values out of...
Replies
5
Views
2,244
Thank you so much for your help! I am trying to use an INT or DINT as a setpoint for my remote device using Modbus TCP/IP. My code is...
Replies
2
Views
2,369
I use CompactLogix L32E and bar-code scanner. The read data of scanner is mapped to array of DINT. The read data almost ASCII, so I want to use...
Replies
21
Views
26,853
Hi all. Me again still learning Rockwell. So I'll be polling an INT data array from a Modbus SE power meter with a L82 (with a Modbus ProSoft in...
Replies
56
Views
1,341
Hi guys I have a barcode scannes which gives me some numbers (SINT) that I want to convert into ASCII, so that I can see that ASCII char insted...
Replies
6
Views
2,757
Back
Top Bottom