convert float into integer in S7

Real to Integer:
DBD/MD (Real) to DBW/MW (Int):

A(
L Real
RND
t MD 3400 (you select)
an OV
save
clr
a br
)
jnb MW3402
t INT

Depending on the processor, you may not have MD up to 3400, that is based on what you have. I use this as a basic FC that I call everywhere.
 

Similar Topics

I have a Float that is F45:10 and I need to convert it to an integer to display on an HMI that is in VB.net and we can't change. I look on the AB...
8
Replies
12,088
Views
Hi all, Going to use a ML1400 to talk to a Krohne gas meter via Modbus. Krohne's totals come as doubles (64-bit floats). I was wondering if...
5
Replies
6,126
Views
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...
3
Replies
2,766
Views
Jees... Continuing from this thread... http://www.plctalk.net/qanda/showthread.php?t=85341 I now have the correct pressure in Torr and mBar...
24
Replies
9,622
Views
Hi all, I'm communicating with a modbus device which sends data in 32 bits data. You can see the structure in this example: N7:4...
6
Replies
5,928
Views
Top