DUEMMEGI
MCP 4 – User's manual
Contatto
11.3.3- Function 3: Reading the registers (RAM memory)
The MODBUS function 3
is the most used
, because of general use, and it allows to read the content of the
RAM memory of MCP 4 with all information about the status of the system.
The following parameters have to be specified:
a starting point (Start)
; this value
is the address of the Word into the RAM
starting from which the
registers have to be read. Allowed values:
from 1 to 30143
(in hexadecimal from 0x0001 to 0x75BF)
how many Words have to be read (Number)
; allowed values:
from 1 to 125
.
MCP 4 will answer with a number of Words equal to the specified Number (that means
a number of bytes
equal to the double of the specified Number
).
The MODBUS function 3 can be used to read the status of the real inputs and outputs, the status of virtual
points, the content of counters, etc.; in practice, any information mapped into the MCP 4 RAM can be
required, included the current date and time of the internal timekeeper.
Example 1:
Read the
output status
of module 25, for instance a MOD8R; alternatively to function 1, the function 3 can
be used. The location of the Word in the RAM containing the status of the output module
i
(channel 1) is
i+512
, therefore, concerning the module 25, the following parameters will be passed to MODBUS driver:
Start:
537
Number:
1
MCP 4 will answer with a Word whose most significant byte is zero and the less significant byte is contains
the status of the output points of module 25, in binary code (1=out ON, 0=out OFF). The less significant bit is
related to the output point 1, the most significant bit is related to output point 8.
Example 2:
Read the
input status
of module 43, for instance a MOD8I/A; alternatively to function 2, the function 3 can
be used. The location of the Word in the RAM containing the status of the input module
i
(channel 1) is
i
,
therefore, concerning the module 43, the following parameters will be passed to MODBUS driver:
Start:
43
Number:
1
MCP 4 will answer with a Word whose most significant byte is zero and the less significant byte is contains
the status of the input points of module 43, in binary code (1=input ON, 0=input OFF). The less significant bit
is related to the input point 1, the most significant bit is related to input point 8.
Example 3:
Read the
input status
of module 57, 58, 59 and 60, for instance all MOD8I/A modules, using the function 3.
The following parameters will be passed to MODBUS driver:
Start:
57
Number:
4
MCP 4 will answer with 4 Words (8 bytes), each one having the most significant byte equal to zero and the
less significant byte containing the status of the input points of modules 57, 58, 59 and 60, in binary code
(1=input ON, 0=input OFF). The less significant bit is related to the input point 1, the most significant bit is
related to input point 8.
DUEMMEGI
s.r.l. - Via Longhena, 4 – 20139 MILANO
Tel. 02/57300377 - Fax 02/55213686 –
www.duemmegi.it
Rel.: 1.2 October 2018
Page 73 of 87