Mitsubishi — Chapter 8 Application Instructions API 100-149

9 Application Instructions API 150-199 9. S 3 : Device address of data to be read/written. The device address inside the communication device. If the address is illegal to a designated communication device, the communication device will respond with an error message and PLC will store the error code, and an error flag will be On. If the function code H17 is used, S 3 can only be a D device, S 3 is the device from which data will be read, and S 3 +1 is the device into which data will be written.  Error flags and error codes for COM1 and COM2:  Exampel: 8000H is an illegal address in a DVP series PLC.

If a communication is sent through COM2, M1141 will be On, and the value in D1130 will be 2. If a communication is sent through COM1, M1315 will be On, and the value in D1250 will be 3. If a communication is sent through COM3, M1319 will be On, and the value in D1253 will be 3. 10. S : Register for storing read/written data. The user sets up a register and stores the data to be written in the register in advance. The register can be register for storing the read data.

If the function code K23 is used, S is a D device index which indicates the device in which the communication data string received will be stored, and S +1 is a D device index which indicates the device in which the data which will be written is stored. If a reading function code (K2, K3, K4, or K23) is sent through COM2, the communication data string received will be stored in the register indicated by S , and the conversion data will be stored in D1296~D1311. Please refer to program example 1 and program example 3 for more information. If a reading function code (K2, K3, K4, or K23) is sent through COM1 or COM3, the conversion data will be stored in the register indicated by S .

Please refer to program example 2 and program example 4 for more information. Users can refer to program example 13 and program example 14 for more information about the function code K23. If COM2 is used, the communication data which will be sent is stored in D1256~D1295. 11. n : Length of read/written data. In Modbus function code H05 (force On/Off), n=0: Off, n=1: On. below for m upon different models and communication modes, in which the unit of H02 and H0F is a bit, and In Modbus function code H02, H03, H04, H0F, H10, H17 (data length), the range = K1 ~ Km. See the table the unit of H03, H04, H10, and H17 is a word.

If the function code H17 is used, n can only be a D device, n represents the number of data which will be read, and n +1 represents the number of data which will be written. DVP-PLC Application Manual 9-2 Code Function Applicable models H17 Reading word devices and writing data in word devices EH3 V1.4, SV2 V1.2, SX V3.0, and later versions PLC COM COM1 COM2 COM3 Error flag M1315 M1141 M1319 Error code D1250 D1130 D1253 Communication mode Model H02 H03 H04 H0F H10 H17 COM1 RTU Mode (M1139 On) EH3 SV2 K256 K24 K24 K256 K24 K24