2 Functions of Devices in DVP-PLC Communication protocols and how to set: 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) 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, DVP-PLC Application Manual 2-82 Content 0 1 b0 Data length b0 = 0:7 b0 = 1:8 parity bit b2, b1 = 00 : None b2, b1 = 01 : Odd b2, b1 = 11 :
Even b1 b2 b3 stop bits b3 = 0:1 bit b3 = 1:2 bit b7 ~ b4 = 0001 (H1) : 110 bps b7 ~ b4 = 0010 (H2) : 150 bps b7 ~ b4 = 0011 (H3) : 300 bps b7 ~ b4 = 0100 (H4) : 600 bps b7 ~ b4 = 0101 (H5) : 1,200 bps b7 ~ b4 = 0110 (H6) : 2,400 bps b7 ~ b4 = 0111 (H7) : 4,800 bps b7 ~ b4 = 1000 (H8) : 9,600 bps b7 ~ b4 = 1001 (H9) : 19,200 bps b7 ~ b4 = 1010 (HA) : 38,400 bps b7 ~ b4 = 1011 (HB) : 57,600 bps b7 ~ b4 = 1100 (HC) : 115,200 bps b7 ~ b4 b8 Select start bit b8 = 0:None b8 = 1:D1124 b9 Select the 1st end bit b9 = 0:None b9 = 1:D1125 b10 Select the 2nd end bit b10 = 0:None b10 = 1:D1126 b15 ~ b11 Not defined MOV H86 D1120 SET M1120