Chapter 6 Applied Instructions Symbol 6_ S 1 : Communication port number S 2 : Unit address S 3 : Function code S 4 : Device address S : Register for reading and writing the data n : Data length D : Flag for completion of the reading and writing data Explanation 1. S 1 sets the serial number of a communication port. The number of COM1 is 1 and COM2 is 2. If the value exceeds the valid range, the instruction does not receive any communication data. 2. Refer to the explanation of the MODRW instruction (API 1808) for the meaning of the operands S 2 , S 3, S 4, S and n . 3.
D sets the communication state flags when the instruction completes the communication, and the flags occupy 3 consecutive devices. You must reset the flags to OFF. The following table gives explanations of the flag states. 6-587 API Instruction code Operand Function 1817 MODRWE S1, S2, S3, S4, S, n, D Reading and writing Modbus data without using any flags Device X Y M S T C HC D FR SM SR E K 16# “$” F S1 S2 S3 S4 S n D BOOL WORD DWORD LWORD UINT INT DINT LINT REAL LREAL TMR CNT STRING Data type S1 S2 S3 S4 S n D Pulse instruction 16-bit instruction 32-bit instruction - ES3 -