12. Communication Design Examples Program Description: z Initialize PLC RS-485 communication port and set the communication format as MODBUS ASCII, 9600, 7, E, 1. The RS-485 communication format of AC servo drive should be the same with PLC. z When enter into step point S0, M0 = ON, [MODRD K1 H4 K1] instruction will be executed to read the motor rotation speed and store it in D1050. Then [MOV D1050 D0] instruction will be executed for showing the rotation speed in D0. z When enter into step S20, M1 = ON, [MODWR K1 K16 H109 D9 K3] instruction will be executed to write the content in D9, D10 and D11 into the H109, H10A and H10B as the parameters of communication address.
z The initial setting in D11 is K1000. Users can specify the value by actual application. z When PLC starts, the program will enter step S0 then move to step S20 and return to S0. The read/write actions for AC servo drive will be performed repeatedly by this process. DVP-PLC Application Examples 12-21 MOV K1000 D11 Set the third speed to 1000r/min in forward direction M1 SET M1122 Sending request MODRW K1 K16 H109 D9 K3 Write the content in D9, D10, D11 into H109 of AC servo drive M1127 RST M1127 Reset M1127. M1129 RST M1129 Reset M1129. M1140 RST M1140 Reset M1140. M1141 RST M1141 Reset M1441.
S0 Return to step S0 RET RET MOV K1000 D11 SET M1122 MODRW K1 K16 H109 D9 K3 RST M1127 RST M1129 RST M1140 RST M1141