Real values in AVEVA communication Modbus

Hello,

I established a Modbus TCP/IP communication between AVEVA Plant SCADA and a M221 PLC from Schneider.

Everything works correct until I want to exchange some Real values. I use MODNET30 Protocol and use %MW to determine the addresses but I think it's necessary to swap somehow the values in SCADA, because:

My Real TAG in Aveva have the address %MW38 when I write value 1 from AVEVA to M221 I receive in M221 at the address %MW39 value 16236

AVEVA value: %MW39 = 1.1 in PLC at %MW38 = -13107 and %MW39 = 16268

Can somebody offers me some support on this problem?

Also if I need to comunicate with M240 what Protocol it's necessary to use? MODNET30 ?

  • MODNET30 is the protocol derived from the MODNET family, as shown below. 

    PLC Model

    Protocol

    TSX Quantum

    MODNET20

    TSX Premium

    MODNET30

    M340

    MODNET30

    You can use MODNET for the word swapping of a real tag with parameter [MODNET]FloatMode that is locked in zero and not applicable for MODNET20 and MODNET30.

    Please refer to the online driver help

    MODNET Protocol Variants

    MODNET Driver Parameters

    Hope this would help.

  • I'm a bit confused from your second example: do you have a REAL variable definition with address %MW39 as well as %MW38?
    REALs take up two consecutive modbus registers, so a REAL at %MW39 should not exist if you already have a REAL at %MW38.

    I'm not too familiar with M221 PLCs, but with modbus devices in general you first have determine whether you have
    a) a register shift problem (0-based addressing vs. 1-based addressing)
    b) a byte order problem
    or both...

    To determine if you have a register shift issue, you should define an INT variable on both sides at equal address, and test with small and large values (say 1 and 10000). If writing to these variables from SCADA results in value changes in other addresses (N + 1 or N - 1) in the PLC then you have to switch to a MODNET variant with a different base address, in your case from MODNET30 to MODNET20.

    If your INT variables work fine, but your REAL and/or LONG values are garbled, then you have a byte-order problem, which you can fix using [MODNET] parameters. For REALs you can use [MODNET]FloatMode (as Jacky mentioned) and for LONGs you can adjust [MODNET]LongDataType.

    Please pay attention to Jacky's note however: both parameters mentioned here cannot be used for MODNET30 and MODNET20 protocol variants. You will have to switch to a standard MODNET, MODNET1, MODNET2, or MODNET3 variant in this case, and you have to change your variable address notation as well because these standard variants do not support %MW notation (change %MW38 to 400038 in your example).