2. Driver installation: ① Select the extraction path; ② Extract; ③ After extraction, locate the extracted folder and double-click "setup" to install the driver.
3. The programming software for the UN200CPU is STEP 7 MicroWIN SP9, and the ModBus library also needs to be installed. IV. UN200CPU Slave Program 1. Set up the library storage area and initialize the Modbus communication port.2. Enable Modbus communication
V. S7-300 Master Station Configuration 1. Configure the hardware as shown in the figure below. 2. Double-click CP341 to enter the CP341 properties dialog box . 3. Click the "Parameters" button to enter the parameter setting dialog box. No driver download is required for Yiwei CP341. If the "Parameters" button is grayed out and unavailable, it means the driver is not installed correctly and needs to be reinstalled. 4. Select Modbus master mode, double-click the envelope icon to enter the baud rate setting screen.5. Modify the baud rate, stop bits, and parity, setting the same parameters as in slave mode.
6. Click the "Interface" button to enter the RS485 communication mode screen. Click "OK" to return to the parameter settings dialog box, and click "Save" to save the modified parameters. As shown in the image above, select: Half-duplex, A-/B.
VI. Software Development 1. Establish transmit data block DB1 and receive data block DB2. 2. Enter OB1 and begin writing the main program. Network 1: Set an always-on flag M1.0. Network 3: Click "Library" >> CP PtP >> CP341 >> FB8, call the FB8 module, and create the background database DB8. Set the pin parameters as shown in the figure below. Parameter descriptions are shown in the table below. Network 4: Similar to Network 3, call the FB7 module to create the background data block DB7, and store the received data in DB2. 3. Download the hardware configuration and program to the 300CPU. VII. Communication Verification 1. After powering on the PLC, connect it to the PC via cable. Open OB1 and click the online button to monitor the program. Modify the data in DB1 according to the message mode of FC03. Modify the network 2 value according to the above information. 2. Open STEP 7 MicroWIN, click the status table, and force VW0--V10. 3. Open STEP7, enter variable monitoring, and you can view the V data of S7-200 being sent to DB2 via Modbus. VIII. Common Problems 1. TXD or RXD lights are not lit: When there is data being received or sent, the TXD or RXD lights will light up. The TXD or RXD lights not lighting up does not mean a communication error. TXD will only light up when there is a signal at M0.5. When M0.5 is a pulse signal with a period of 1 second, TXD will flash regularly. 2. After using the Modbus function, the UN200CPU cannot perform PPI communication in the running state. To use the PPI function (such as downloading programs), switch the DIP switch to the 'STOP' position. 3. The UN200CPU communication port electrical interface is RS-485, which can be used for PPI, MPI, Modbus, and freeport protocols. The computer's serial port is generally an RS-232 interface. For the UN200CPU to use the Modbus protocol, an RS485 to RS232 converter is required. This concludes the sharing on the Yiwei CP341. I hope my three articles have been helpful to everyone's work.