Chapter 6 Applied Instructions 4. S 3 sets the parity bit. The value 0 indicates None (no parity bit). The value 1 indicates Odd bit checking. The value 2 corresponds to Even bit checking. If the value in S3 is not 0, 1 or 2, the instruction uses the default value. 5. S 4 sets the number of end bits. The value 1 (preset) indicates 1 bit. The value 2 indicates 2 bits. If the value in S 4 is not 1 or 2, the instruction uses the default value. 6. S 5 sets the communication mode for Modbus communication. The value 0 indicates ASCII (default value). The value of 1 indicates RTU. If the value in S 5 is not 0 or 1, the instruction uses the default value. 7. D sets communication port number.
The number for COM1 is 1 and COM2 is 2. If the setting value is out of the valid range, the instruction does not set the communication port format. 8. You can also directly set the communication port in HWCONFIG in ISPSoft (COM Port settings) or with the special registers. For more on in HWCONFIG, see the ISPSoft user manual. Refer to Section 6.19.3 for setting the communication-related SR and SM registers. 9. The communication at the actual communication port changes immediately after you change the setting of the instruction. If some communication is being carried out at the moment, it is forced to cancel. Additionally, the corresponding setting value in SM/SR changes accordingly.
For details on SM/SR, refer to Section 6.19.3. 10. This instruction does not change any setting for the actual communication port when the communication format setting is the same as the previous setting. Example 6_ 1. This example uses the PLC COM1 port. Other PLC communication ports are similar. 2. The contact for the start condition is M0. 3. Set the (RS485) communication format of PLC COM1 to 115200, 8, E and 1. 4. Set the (RS485) communication mode of PLC COM1 to ASCII . 5. The following table explains the COMDF operands for the example.
6-565 Operand Description Content value S1 Baud Rate 115200 bps 1152 S2 Number of data bits 8 8 S3 Parity bit E 2 S4 Number of end bits 1 1 S5 Mobdus format selection ASCII 0 D Communication port number PLC COM1 1