Two Modbus Integers to Real in S7-300?

SIMATIC S7-200/300/400, Step7, PCS7, CFC, SFC, PDM, PLCSIM,
SCL, Graph, SPS-VISU S5/S7, IBHsoftec, LOGO ...
Post Reply
alansal
Posts: 58
Joined: Mon Sep 24, 2007 1:03 pm
Location: Somewhere in Europe

Two Modbus Integers to Real in S7-300?

Post by alansal » Mon May 23, 2016 9:10 am

Hello everyone,

The question is simple but for me the answer is a little cloudy.

1) I have two registers i can read from a flowmeter to form a floating value. One is R2610 and other is R2611.I need to place them such that they need to form a floating value however siemens keeps converting (only the high value to a form of float so i do not have any decimal value for ex;
R2610 : 17457
R2611 : 4090

However my value is converted like; 708.0 in fact it should be; 708.24963 sth.

With which block/blocks can i see the actual value?(Btw i am connected with Modbus over TCP/IP)
(i checked/read the values with a modbus slave program)

Thanks for help

dehell
Posts: 104
Joined: Sat Jun 13, 2009 12:25 pm
Location: Europe

Re: Two Modbus Integers to Real in S7-300?

Post by dehell » Mon May 23, 2016 11:45 am

Hello,
Which sofware? TIA? Step7?

http://hpics.li/8e364e8

alansal
Posts: 58
Joined: Mon Sep 24, 2007 1:03 pm
Location: Somewhere in Europe

Re: Two Modbus Integers to Real in S7-300?

Post by alansal » Mon May 23, 2016 3:12 pm

dehell wrote:Hello,
Which sofware? TIA? Step7?

http://hpics.li/8e364e8
Step 7 it is... V5.5 SP3

Merging two integers and forming a floating number is my problem....

Thanks for your kind interest...

dehell
Posts: 104
Joined: Sat Jun 13, 2009 12:25 pm
Location: Europe

Re: Two Modbus Integers to Real in S7-300?

Post by dehell » Mon May 23, 2016 8:37 pm

In few word:
If your first register is for example DB10.DBW2 and your second register DB10.DBW4, in that case the real value is available into DB10.DBD2

If your register are not consecutive, copy them into two consecutive register...

Schtiel
Site Admin
Posts: 1101
Joined: Wed Sep 06, 2006 12:03 pm
Location: CIS

Post by Schtiel » Mon May 23, 2016 10:35 pm

You don't need to merge anything, just access two words as floating point:
Image

alansal
Posts: 58
Joined: Mon Sep 24, 2007 1:03 pm
Location: Somewhere in Europe

Re:

Post by alansal » Thu May 26, 2016 3:12 pm

Schtiel wrote:You don't need to merge anything, just access two words as floating point:
Image
thank you.... this will surely work... will try asap....

Post Reply