At a Glance
That example
deals with 2 Modicon M340 processors which communicate via Modbus
serial link. The Modbus master PLC must read internal words %MW100
to %MW109
of the Modbus slave PLC.
Description of the Example
The values of the words that are read are sorted on the basis
of the internal word %MW10
.
The following example
uses unlocated variables, and covers the reception of data in an unlocated
10-word table named Tab_recp
(declared as an ARRAY [0..9] OF INT
). The management parameters are located
in a table of 4 integers called Management_Parameter
(declared as ARRAY [0..3] OF INT
).
In that example, the Modbus slave’s number is 7, so the input ADDM parameter is ‘0.0.0.7’:
0: rack number of the processor equal to 0
0: slot number of the processor within the rack, equal to 0 as the slot number of a Modicon M340 processor is always 0
0: channel number, equal to 0 as the serial link of a Modicon M340 processor is always channel 0
7: configured slave number is 7.
Illustration
The two Modicon 340 processors are connected via a Modbus link:

Programming
Programming in LD:

The request parameters are as follows:
Parameters |
Description |
---|---|
ADDM(’0.0.0.7’) |
|
’%MW’ |
Type of object (internal word) |
100 |
Address of the first object to read |
10 |
Number of consecutive objects to read |
Tab_recp |
Contents of the response |
Management_Parameter |
Management table |