7DATA COMMUNICATIONS USING BIDIRECTIONAL PROTOCOL

(2)Arrangement of receive data

MELSEC-Q

The following example illustrates the arrangement of data received from the external device when it is stored in the receive area.

1)The receive message is stored to the Q series C24 buffer memory (receive data storage area).

2)The data is stored to the receive data storage area in low address (L) (H), next address (L) (H) order.

If the received data is "ABCDEFG123", it will be stored as shown below (for the CH1 side):

Q series C24

 

Receive area

 

 

 

Receive data (response message)

 

 

 

 

 

 

 

 

 

 

 

(buffer memory)

 

 

 

 

 

 

 

 

 

 

 

 

 

Receive

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(00H)

5

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

data count

(05H)

 

 

Data

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Sum

 

 

 

 

 

 

 

 

 

 

 

length

A

B

 

C

D

E

F

G

1

2

3

check

 

 

 

 

 

 

B

A

 

 

 

 

 

 

 

 

 

 

storage area

 

 

 

 

 

 

 

 

 

(42H)

(41H)

 

ENQ

(0005H)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

code

 

 

 

 

 

 

 

D

C

 

 

L

H

 

 

 

 

 

 

 

 

 

 

 

 

 

 

L

H

 

 

 

 

 

 

Receive

(44H)

(43H)

 

 

05H

00H

41H

42H

 

43H

44H

45H

46H

47H

31H

32H

 

33H

47H

02H

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

F

E

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

data storage

(46H)

(45H)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

G

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

area

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(31H)

(47H)

 

 

 

 

Transmission data (response message)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3

2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(33H) (32H)

 

 

 

 

 

 

 

 

 

 

ACK

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

External device

 

 

 

 

 

 

 

 

 

 

 

 

 

 

06H

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(Normal completion)

When the data length unit is in bytes, 00H is stored in the higher byte of the last data storage position in the receive area when the data length of the message is an even byte.

(3) Contents of receive data

The contents of receive data, including the receive data as indicated in

Section 7.2.2, are explained below.

(a)Control codes

The types of control codes are shown in the table below.

Signal

Code

Contents

Application

name

(hexadecimal)

 

 

ENQ

05H

Enquiry

Code for starting data transmission.

ACK

06H

Acknowledge

Response code to the opposite side when data was

received normally.

 

 

 

 

 

Negative

Response code to the opposite side when data could

NAK

15H

not be received normally. (Error code is sent

Acknowledge

 

 

immediately after the response code.)

 

 

 

1)For data communication from the external device to the Q series C24 the Q series C24 checks and processes the control code received. It cannot be read from the sequence program.

2)For data communication from the Q series C24 to the external device The control code to be transmitted is added by the Q series C24.

7 - 6

7 - 6