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...
Replies
8
Views
9,331
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...
Replies
5
Views
4,639
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...
Replies
3
Views
2,012
Jees... Continuing from this thread... http://www.plctalk.net/qanda/showthread.php?t=85341 I now have the correct pressure in Torr and mBar...
Replies
24
Views
7,363
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...
Replies
6
Views
4,522
Back
Top Bottom