Example Of Data Reception - Mitsubishi Electric MELSEC iQ-R Series User Manual

Serial communication module
Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

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

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents