EasyManua.ls Logo

LS Industrial Systems GLOFA G7M-DR60U - Function Block

LS Industrial Systems GLOFA G7M-DR60U
367 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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 arra
y
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.

Table of Contents

Related product manuals