362
17 COMMUNICATING WITH ASCII CODE (ASCII-BIN CONVERSION)
17.6 Data Communication Using Bidirectional Protocol
Example of data reception
Data reception example (ASCII-BIN conversion is enabled)
The following shows an example of data reception when ASCII-BIN conversion is enabled.
■Program example
For information on the module FB to be used, refer to the following manual.
MELSEC iQ-R Serial Communication Module Function Block Reference
Category Label name Description Device
Module label C24_1 Target module
C24_1.stnCH1.bSet_Req_ReceptionRead CH1 Reception data read request X3
Label to be defined Define the global label as shown below.
X3
M0
M1
BIDIN
ON
ON
06H
A
C
K
6DH
LH
04H
1
31H
2
32H
3
33H 34H 35H05H
4
D
43H
C
44H30H
(0004H)
41H 42H
LH
0
40
0
34H 30H 30H
5BA 0
30H
0
30H45H 46H
FE0
44H
D
30H 41H
A
E
N
Q
00H , 04H
34H , 12H
BCH , 5AH
0AH , 0DH
F0H , DEH
00H , 04H
34H , 12H
BCH , 5AH
0AH , 0DH
D3
D10
D11
D12
D13
F0H , DEH
*
Sum
check
code
Data areaData length
Target
device
Set to even byte except for additional code
C24
Two bytes of reception data is read to the C24
as one-byte data (excluding additional code).
Reception data
read request
Data length (receive data count): Excluding additional codes
CPU module
Word units
Number of bytes after ASCII-BIN conversion: (8)/2=4
Byte units
Completion device
Number of bytes after ASCII-BIN conversion: (8)
Abnormal
completion
Status display device
at completion
The following diagram
is for word unit
Normal
completion
1 scan
Data
length
Un\G1536
Un\G1537
Un\G1538
Data
area
Un\G1539
Un\G1540
Buffer
memory
Program
device memory