beautypg.com

2 functions of devices in dvp-plc – Delta Electronics Programmable Logic Controller DVP-PLC User Manual

Page 107

background image

2 Functions of Devices in DVP-PLC

DVP-PLC Application Manual

2-79

Example 1: Modifying communication format of COM2

1. Add the program code below on top of the program to modify the communication format of COM2. When PLC

switches from STOP to TUN, the program will detect whether M1120 is On in the first scan time. If M1120 is On,

the program will modify the relevant settings of COM2 according to the value set in D1120.

2. Modify the communication format of COM2 into ASCII mode, 57,600bps, 7 data bits, even parity, 1 stop bit

(57,600, 7, E, 1)

MOV

H86

D1120

SET

M1120

M1002

Notes:

1. If COM2 is to be used as a Slave terminal, make sure there is no communication instruction existing in the

program.

2. After the communication format is modified, the format will stay intact when PLC switches from RUN to

STOP.

3. If you shut down the power of the PLC and repower it again, the modified communication format will return

to default setting.

Example 2: Modifying the communication format of COM1

1. Add the program code below on top of the program to modify the communication format of COM1. When PLC

switches from STOP to TUN, the program will detect whether M1138 is On in the first scan time. If M1138 is On,

the program will modify the relevant settings of COM1 according to the value set in D1036.

2. Modify the communication format of COM1 into ASCII mode, 115,200bps, 7 data bits, even parity, 1 stop bit

(115,200, 7, E, 1)

MOV

H86

D1036

SET

M1138

M1002

Notes:

1. After the communication format is modified, the format will stay intact when PLC switches from RUN to

STOP.

2. If you shut down the power of the PLC and repower it again, the modified communication format will return

to default setting.

Example 3: Modifying the communication format of COM3

1. The communication format of COM3 is fixed as 7 data bits, even parity, 1 stop bit. Add the program code below

on top of the program to modify the baud rate of COM3 into 38,400bps. When PLC switches from STOP to TUN,