DVP-ES2/EX2/SS2/SA2/SX2/SE Operation Manual - Programming
3-204
3. When data receiving is completed, M1123 will automatically be ON. When data processing on
the received data is completed, M1123 has to be reset (OFF) and the PLC will be ready for
communication again. However, DO NOT continuously execute RST M1123, i.e. it is
suggested to connect the RST M1123 instruction after the drive contact M1123.
MOV D1120
H86
M1002
SET M1120
MOV D1129K100
X0
M1123 RST M1123
RS D100 K10 D120 K10
Pulses for
sending request
Pulse
Receiving
completed
Set up communication protocol as
9600, 7, E, 1
Retain communication protocol
Set up communication time-out as 100ms
Write transmitting data in advance
Sending request
Processing received data
Reset M1123
SET M1122
Program Example 2: COM2 RS-485
Switching between 8-bit mode (M1161 = ON) and 16-bit mode (M1161 = OFF)
8-bit mode:
1. STX (Start of Text) and ETX (End of text) are set up by M1126 and M1130 together with
D1124~D1126. When PLC executed RS instruction, STX and ETX will be sent out
automatically.
2. When M1161 = ON, only the low byte (lower 8 bits) is valid for data communication, i.e. high
byte will be ignored and low byte will be received and transmitted.
M1000 M1161
D100 D120
K4 K7RS
X0
Sending data: (PLC -> external equipment)
STX D100L D101L D102L D103L ETX1 ETX2
source data register, starting fromthe lower 8 bits of D100length = 4