DUEMMEGI
MCP 4 – User's manual
Contatto
the setting up of the communication between the MASTER system and MCP 4 will be reduced to the
configuration of the communication driver provided by the manufacturer of the MASTER system, therefore
refer to the user's manual of the same system.
The following notations, unless otherwise specified, have to be intended in decimal format.
11.3.1- Function 1: Reading the digital output status
The MODBUS function 1 allows to read the output status; the following parameters must be specified:
a start point (Start)
; this value
must be multiple of 16
. This value identifies the number of the digital
output (normally called coil) starting from 16 and arranged by channel as follows:
Output
Number of the output
(coil)
Non usato
0
O1:1.1
16
O2:1.1
32
...
...
O127:1.1
2032
Non usato
2048
O1:2.1
2064
O2:2.1
2080
...
...
O127:2.1
4080
Non usato
4096
O1:3.1
4112
O2:3.1
4128
...
...
O127:3.1
6128
Non usato
6144
O1:4.1
6160
O2:4.1
6176
...
...
O127:4.1
8176
The general formula is: said
Add
the address of the real module of
Contatto
system, starting from which
the status of the outputs has to be read and
CH
the channel, then the value of Start will be:
(
Add x 16) + 2048 x (CH – 1)
Allowed values:
from 0 to 8176
.
how many output points have to be read (Number)
; in practice, how many modules having
consecutive address have to be read. To avoid confusion, this value is suggested to be
multiple of 16
and equal to the number of modules to be read multiplied by 16. Allowed values:
from 16 to 8176
.
MCP 4 will answer with a number of bytes equal to Number divided by 8
.
Example:
Read the output status of module 25, for instance a MOD8R that, as known, features 8 output points and a
single channel (1). The parameters to be passed to MODBUS driver are:
Start:
400
Number:
16
MCP 4 will answer with 2 bytes containing the status of the output points of module 25, according to the
binary code (1=out ON, 0=out OFF). The less significant bit of the lower byte is related to the output point 1,
the most significant bit is related to the output point 8; the higher byte will be, in this case always 0x00 (zero).
DUEMMEGI
s.r.l. - Via Longhena, 4 – 20139 MILANO
Tel. 02/57300377 - Fax 02/55213686 –
www.duemmegi.it
Rel.: 1.2 October 2018
Page 71 of 87