S7300 Unsigned and signed values

SIMATIC S7-200/300/400, Step7, PCS7, CFC, SFC, PDM, PLCSIM,
SCL, Graph, SPS-VISU S5/S7, IBHsoftec, LOGO ...
Post Reply
RandolphC
Posts: 11
Joined: Mon Sep 12, 2011 9:31 pm

S7300 Unsigned and signed values

Post by RandolphC » Fri Mar 15, 2013 12:50 am

Good afternoon everyone :D, I have S7300 PLC with 4 CP 341 to 4 differents Modbus networks. No problem with polling data, just in the kind of data I'm getting. Slaves bring to me unsigned data in 16-bit (volts, just for say), although in my DB's I'm receiving signed data :( , for example:

On slave #9 I'm watching 13734 volts on its panel, but on my PLC I'm obtaining -1281 value.

Don't know :? if I have to do another kind of configuration or programm to convert this kind of data in another one or do some shift of bits. (I found 16-bit has 1, indicating its a negative number, a signed integer). This happen when I'm polling DINT.

Slave's manual just gives the scaling factor of 10 (if you're receiving 1534 as DINT or INT, then you'd scale it as 153.4)

Using Modbus Poll tool, I found the same thing (values from Slave's panel don't correspond to values showed on Modbus Poll)

(oo) Hope you support me.

Thanks in advance :D .

PS1: Slaves are ION 7330, from Schneider. According to Modbus map register, they already bring integer values.
PS2: I'm new on Modbus RTU protocol , but I don't have problem on its frame.

PLC_ITA
Posts: 246
Joined: Sat May 27, 2006 6:46 am
Location: Europe

Re: S7300 Unsigned and signed values

Post by PLC_ITA » Sat Mar 16, 2013 9:28 am

hello, try to move your value from Int to Dint

L DB.DBWxxxx
T DB.DBDxxxx

regards
PLC_ITA

kaa1979
Posts: 42
Joined: Sat Mar 27, 2010 8:14 am

Re: S7300 Unsigned and signed values

Post by kaa1979 » Sat Mar 16, 2013 12:32 pm

Try to swap BYTEs in WORD, and after move your value from Int to DINT:

L DB.DBWxxxx
CAW
T DB.DBDxxxx

Post Reply