Chapter 8. Communication Function
8-68
8.3.4 Function block
1) MOD0102
Function block
Description
Input
REQ: Execute function block when it’s 1(rising edge)
CH : Set communication channel (0 ~ 1)
SLV_STNO:
Input the number of the slave station
FUNC: Input the function code. It supports function code 01 and 02
SLV_ADDR: The address to read from the slave station
NUMH: The data size to read from
the slave station
Output
RD_DATA: A variable name to save the data that is read (The number of array is
to be declared as same as or bigger than data size.).
NDR: If it ends without error, output 1 and keep the value till the call for the next
function block.
ERR: If an error occurs, output 1 and keep the value till the call for the next
function block.
STATUS: When an error occurs, output an error code.
(1)
Function
This is a function block that can execute either function code 01 or 02 for reading bits in Modbus protocol
communication. Function code 01 reads Coil Status data and function 02 reads Input Status data.
(2)
Error
It outputs error codes to output STATUS. Refer to “Error codes” for the detailed.
(3)
Example of the program
z
It’s supposed that GM7U main unit is the master and it reads Coil Status of the station no. 17, a Modicon
product.
z
The master reads status of the Coil 00020 ~ 00056 of the slave station no. 17. The Coil of the slave station is
supposed to be as follows and the data that are read is saved in any array variable RD_DBD of the 40 sized
BOOL type.
Coil
59
58
57
56
55
54
53
52
51
50
49
48
47
46
45
44
43
42
41
40
Status
X X X 1 1 0 1 1 0 0 0 0 1 1 1 0 1 0 1 1
Hex
1 B 0 E B
Coil
39
38
37
36
35
34
33
32
31
30
29
28
27
26
25
24
23
22
21
20
Status 0 0 1 0 0 1 1 0 1 0 1 1 1 1 0 0 1 1 0 1
Hex
2
6
B
C
D
<Data status of the Modicon product’s Coil 00020-00059>
z
The status of Coil 57, 58, 59 is redundancy.
z
Data is sent starting from the low bit by byte unit. If the deficient bit of a byte is filled with 0. An example of
sending the above data is as follows.
Содержание GLOFA G7M-DR20U
Страница 28: ...Chapter 4 Names of Parts 4 3 2 G7M DRT60U N 3 G7M DT60U N 4 G7M DT60U P...
Страница 29: ...Chapter 4 Names of Parts 4 4 5 G7M DR60U DC 6 G7M DRT60U N DC 7 G7M DT60U N DC...
Страница 30: ...Chapter 4 Names of Parts 4 5 8 G7M DT60U P DC 4 1 2 40 point main unit 1 G7M DR40U 2 G7M DRT40U N...
Страница 31: ...Chapter 4 Names of Parts 4 6 3 G7M DT40U N 4 G7M DT40U P 5 G7M DR40U DC...
Страница 32: ...Chapter 4 Names of Parts 4 7 6 G7M DRT40U N DC 7 G7M DT40U N DC 8 G7M DT40U P DC...
Страница 33: ...Chapter 4 Names of Parts 4 8 4 1 3 30 point main unit 1 G7M DR30U 2 G7M DRT30U N 3 G7M DT30U N...
Страница 34: ...Chapter 4 Names of Parts 4 9 4 G7M DT30U P 5 G7M DR30U DC 6 G7M DRT30U N DC...
Страница 35: ...Chapter 4 Names of Parts 4 10 7 G7M DT30U N DC 8 G7M DT30U P DC 4 1 4 20 point main unit 1 G7M DR20U...
Страница 36: ...Chapter 4 Names of Parts 4 11 2 G7M DRT20U N 3 G7M DT20U N 4 G7M DT20U P...
Страница 37: ...Chapter 4 Names of Parts 4 12 5 G7M DR20U DC 6 G7M DRT20U N DC 7 G7M DT20U N DC...
Страница 38: ...Chapter 4 Names of Parts 4 13 8 G7M DT20U P DC...
Страница 159: ...Chapter 7 Usage of Various Functions 7 52 c Program...
Страница 183: ...Chapter 7 Usage of Various Functions 7 76 c Program...
Страница 253: ...Chapter 8 Communication Functions 8 27 b When uses Ch 1 Built in RS 485...
Страница 355: ...Appendix 1 System Definitions App1 8 5 PID parameters 1 PID Auto Tuning Parameter 2 PID Parameter...
Страница 356: ...Appendix 1 System Definitions App1 9 6 Position Parameter...
Страница 357: ...Appendix 1 System Definitions App1 10 7 High Speed Counter Parameter...