Function Description

The ADDMX function is used to convert a character string respecting the Control Expert device address syntax into an array of integers in order to manage (e)X80 serial link modules in an Ethernet I/O drop.

The ADDMX function can be used directly by the following communication functions with a local Modicon M340 CPU or a remote M340 module in a Quantum system:

  • READ_STS_QX

  • WRITE_CMD_QX

  • EXCH_QX

  • READ_REG_QX

  • WRITE_REG_QX

  • PRINT_CHAR_QX

The ADDMX function can be used directly by the following communication functions in an M580 system:

  • READ_STS_MX

  • WRITE_CMD_MX

  • READ_PARAM_MX

  • RESTORE_PARAM_MX

  • SAVE_PARAM_MX

  • WRITE_PARAM_MX

  • INPUT_CHAR

  • PRINT_CHAR

  • READ_VAR

  • WRITE_VAR

  • INPUT_BYTE

  • DATA_EXCH

  • SEND_EMAIL

The additional parameters EN and ENO can be configured.

FBD Representation

LD Representation

IL Representation

ADDMX (

IN := InputADDMX

)

ST OutputADDMX

ST Representation

OutputADDMX := ADDMX (IN := InputADDMX);

Parameter Description

The following table describes the input parameter:

Parameter

Type

Comment

IN

Character string

String complying with Control Expert device address syntax that contains the path from the CPU module to the EIO drop module and the path inside the EIO drop module to reach the targeted module. Each path is separated by \\ characters inside the string.

To address a BMX CRA 312 •0 or BME CRA 312 •0 module directly with its IP address, the IN parameter takes one of the 2 following forms:

  • ‘r0.s0.ch0.{ip.ip.ip.ip}’

  • ‘r0.s0.ch0.{ip.ip.ip.ip}TCP.MBS’

To address a Modbus server or slave using Modbus protocol, the IN parameter takes one of the 2 following forms:

  • ‘r0.s0.ch0.{ip.ip.ip.ip}TCP.MBS\\r1.s1.ch1.d’

  • ‘r0.s0.ch0.{ip.ip.ip.ip}TCP.MBS\\r1.s1.ch1.d.MBS’

Detailed description of Control Expert device address syntax string content:

Field

Value

r0.s0.ch0

Topological address of the Quantum CRP or Quantum NOE module or M580 Ethernet port that will send the TCP/Modbus request (rack, slot, and channel number).

NOTE: In a Quantum rack: r0 = 1 and ch0 = 1.
NOTE: For a M580: to configure a communication through the CPU Ethernet port, set channel number to 3 (0.0.3).

{ip.ip.ip.ip}

BMX CRA 312 00 or BMX CRA 312 10 module with ip.ip.ip.ip address (protocol TCP port 502, default IP protocol, and port).

TCP.MBS

Optional, used to address a Modbus server

\\

Separator

r1.s1.ch1.d

Modbus server module rack, slot, channel, and Modbus slave number

Depending on the addressing mode, the parameters can be partly used as described:

r1.s1

Module server addressing mode: module server topological address in a rack with a BMX CRA 312 10 module.

NOTE: Modicon M340 first rack number = 0 (r0 = 0).

r1.s1.ch1

Channel server addressing mode: channel server address in the rack.

NOTE: Modicon M340 first channel number = 0 (ch1 = 0).

r1.s1.ch1.d

Modbus slave addressing mode: address Modbus slave n° d, using channel ch1 Modbus Master from a NOM module located in a rack with a BMX CRA 312 10 module.

MBS

Optional. To address a Modbus server if the NOM module is not a Modbus master.

Examples of Quantum drop:

Device to Address

ADDMX Syntax

Module server of drop #5 CRA

ADDMX('1.4.1{192.168.100.31}SYS

Module server of BMX NOM in drop #5

ADDMX('1.4.1{192.168.100.31}\\0.3')

Modbus device #15 on serial link of BMX NOM in drop #5

ADDMX('1.4.1{192.168.100.31}\\0.3.1.15')

Examples of M580 drop:

Device to Address

ADDMX Syntax

Module server of drop #5 CRA

ADDMX('0.0.3{192.168.100.31}SYS

Module server of BMX NOM in drop #5

ADDMX('0.0.3{192.168.100.31}\\0.1')

Modbus device #15 on serial link of BMX NOM in drop #5

ADDMX('0.0.3{192.168.100.31}\\0.1.1.15')

The following table describes the output parameter:

Parameter

Type

Comment

OUT

ANY_ARRAY_INT

Array containing at least 2 ADDM_TYPE arrays. Each ADDM_TYPE array represents the address of a device (more details provided hereunder).

This parameter can be used as an input parameter for several communication functions.

The ADDMX block analyses the addressing string syntax (IN parameter) and puts the result into an array of array which defines the destination address. The destination address can be provided either by the OUT parameter of the ADDMX function or directly by an array of array (n x 8 INT objects). However, it is strongly recommended to use the ADDMX function to address a communication EF.

Detailed description of ADDM_TYPE array:

Field

Size

Value

Type

1 byte

reserved (2)

ClientID

1 byte

0 if not specified

Rack

1 byte

module rack number

Slot

1 byte

module slot number

Channel

1 byte

channel number inside the module

ProtId

1 byte

This byte can have the following values:

  • 0: Modbus protocol

  • 2: user protocol

  • 3: SMTP

AddrLen

1 byte

This byte can have the following values:

  • 0: No optional field

  • 1: Modbus address content

  • >1: Ethernet address content (AddrExt is used)

UnitId

1 byte

Optional: Device address or UNIT-ID

AddrExt

Array[7]

Optional: Ethernet destination address extension