Mitsubishi — Chapter 8 Application Instructions API 100-149

8 Application Instructions API 100-149 Program Example 3: 1. In the communication between PLC and VFD-S series AC motor drive (ASCII Mode, M1143 = Off), retry when communication time-out, data receiving error and sending address error occur. 2. When X0=On, PLC will read the data in VFFD-S data adress H2100 of device 01 and stores the data in ASCII format in D1070 ~ D1085. PLC will automatically convert the data into numerals and stores them in D1050 ~ D1055. 3. M1129 will be On when communication time-out occurs. The program will trigger M1129 and send request to M1122 for reading the data again. 4. M1140 will be On when data receiving error occurs.

The program will trigger M1140 and send request to M1122 for reading the data again. 5. M1141 will be On when sending address error occurs. The program will trigger M1141 and send request to M1122 for reading the data again. M1002 Set up communication protocol to 9600, 8, E, 1 Retain communication protocol Set up communication time-out: 100ms X0 Set up communication time-out: 100ms M1129 Communication time-out Retry M1140 Data receiving error Retry M1141 sending address error Retry X0 Set up communication instruction: device address 01, data address H2100 data length 6 words receiving completed M1127 handle received data M1127 The received data are stored in D1070~D1085 in ASCII format.

PLC will automatically convert the data into numerals and store them in D1050~D1055. Sending/receiving of data is completed. The flag is reset. M1129 Communication time-out. The flag is reset. Remarks: 1. The activation criteria placed before the three instructions, API 100 MODRD, API 105 RDST, and API 150 MODRW (Function Code H03), cannot use rising-edge contacts (LDP, ANDP ORP) and falling-edge contacts (LDF, ANDF, ORF); otherwise, the data stores in the receiving registers will be incorrect. 2. M1127 for MODRD instruction stands for the response of data is completed. M1127 will only be On if the responded data are correct.

M1123 will be On no matter the responded data are correct or wrong. 3. There is no limitation on the times of using this instruction in the program, but only one instruction is allowed to be executed at a time. DVP-PLC Application Manual 8-4 MOV H87 D1120 SET M1120 MOV K100 D1129 SET M1122 MODRD K1 H2100 K 6 RST M1127 RST M1129