7 DATA COMMUNICATIONS USING BIDIRECTIONAL PROTOCOL

7.2 Sending Data to the External Device

MELSEC-Q

This section explains data transmission from the PLC CPU to the external device.

7.2.1 Transmission methods

The following shows the method of sending data to the external device through data communication using the bidirectional protocol.

PLC CPU

 

 

 

Q series C24

 

 

 

 

 

 

PLC program

 

 

 

Buffer memory

 

 

 

 

 

 

External

 

 

 

 

 

 

 

 

device

 

 

 

 

Transmission area

 

 

 

 

 

 

 

 

 

 

 

Any data

 

 

3)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1)

 

2)

 

 

 

 

 

 

 

 

 

 

Write

Data

 

 

 

 

Sum check code

 

Data portion Data length

ENQ

 

(BIDOUT

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

instruction)

(00H to FFH)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(00H to FFH)

 

 

4)

 

 

 

 

 

 

 

 

 

(When normal)

 

 

ACK

 

 

 

 

 

 

 

 

 

 

 

 

 

 

5)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Transmission

 

 

 

 

 

 

 

 

 

 

(When abnormal)

 

 

 

 

 

 

NAK

Error code

 

completed

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Contents

CH1/CH2

Control timing

Send instruction

BIDOUT instruction completion device

BIDOUT instruction

 

 

BIDOUT

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1)Data such as control data and transmission data are stored in the device designated with the BIDOUT instruction and then the BIDOUT instruction is executed.

2)The transmission data count and transmission data are written into the transmission area of the buffer memory.

3)The Q series C24 sends data by adding the control code ENQ at the beginning of the data.

When "Sum check" is designated with GX Developer, the Q series C24 adds the sum check code calculated by internal processing to the end of the message and then transmits the message.

When "No sum check" is designated with GX Developer, no sum check code is sent.

4)A response for the data transmission (for normal completion: ACK message; for

abnormal completion: NAK message) is received.

5)The execution of the BIDOUT instruction completes with the transmission processing completion of the Q series C24.

7 - 15

7 - 15