12. Communication Design Examples M0 Sending request M1 M2 M1000 Send out the 8 bytes data in D100~D103 and store the received data in D120~D123 M1123 Reset M1123. M1129 Retry after receiving time-out Reset M1129 Program Description: z Initialize PLC RS-485 communication port and set the communication format as 9600, 8, E, 1. The RS-485 communication format of MM420 (set by P2010) should be the same with Master PLC. z When X0 = ON, MM420 will be started to run forward in 40Hz. PLC D MM420, PLC sends: 02 06 00 047F 3333 7F MM420 D PLC, PLC receives: 02 06 00 FB34 3333 CB Registers for sent data (PLC sends out message): Registers for received data (MM420 responds with messages):
DVP-PLC Application Examples 12-46 SET M1122 RS D100 K8 D120 K8 RST M1123 PLS M2 RST M1129 Register DATA Explanation D100 low 02H Head. Fixed as 02H. (start of the message) D100 high 06H The number of the following bytes D101 low 00H Station No. (range: 0~31, corresponding to hex 00H~1FH) D101 high 04H Control word (starting MM420. Refer to Remarks for definitions.) D102 low 7FH D102 high 33H Frequency (4000H = base frequency 50Hz, 3333H = 40Hz) D103 low 33H D103 high 7FH Tail. (XOR result of all the bytes before this byte) Register DATA Explanation D120 low 02H Head. Fixed as 02H (start of the message) D120 high 06H The number of the following bytes