How to write the programming program to read and connect PLC and PC, attached plan
PLC and computer connection need to use communication cable, commonly used cable has two kinds: one is FX-232AWC-H (SC09 for short) cable, as shown in the figure, the cable contains RS-232C/RS-422 converter;The other is the FX-USB-AW (also known as USB-SC09-FX) cable, shown here, which contains a USB/RS-422 converter.In the selection of PLC programming cable, first check whether the computer has COM port (also known as RS-232C interface), because now many computers have cancelled this interface, if the computer has COM interface, can choose FX-232AWC-H cable to connect PLC and computer.When connecting, the COM head of the cable is inserted into the COM interface of the computer, and the circular plug of the other end of the cable is inserted into the programming port of PLC.If the computer does not have COM interface, fX-USB-AW cable can be used to connect the computer with PLC.When connecting, the USB head of the cable is inserted into the USB interface of the computer, and the other end of the cable is inserted into the PROGRAMMING port of PLC.When you plug the FX-USB-AW cable into the USB port of your computer, you also need to install the driver worn by this cable in your computer.After the driver is installed, select “Device Manager” in the computer, and the device Manager window pops up, as shown in the picture. Expand “Ports (COM and LPT)” in the window, and you can see a virtual COM port, COM3 in the picture. Remember the number, which will be used in the communication parameter setting of workS2 software.Communication programming cable to connect the PLC and the computer, at startup works2 software, open or create a new project, then follow the menu bar orders “engineering data list area – > connection goal”, then select the current connection target, pop-up connection goal setting dialog box, double-click the “serial usb” icon in the upper left corner, there appeared the detailed Settings dialog box,As shown in the figure, select “RS-232C” in the dialog box, select the port number to connect with PLC from COM port, when fX-USB-AW cable is used to connect, the port number should be consistent with the virtual COM port number in device manager, select a certain speed in transmission speed (such as 19.2kbps),Click OK to return to the connection target setting dialog box. If you want to know whether the connection between PLC and computer is successful, you can click the communication test button in the connection target setting. If the dialog box as shown in the figure appears, it means that the connection has failed and you need to select COM port again.Program writing and readout program writing refers to the program by the programming computer into THE PLC, readout is to transfer the program in the PLC to the computer.The procedure of reading operation process and write basic similar, can refer to the study, do not introduce here.In the PLC program to write or read, in addition to ensure that PLC and computer communication connection, PLC also need to be connected to the working power supply.On-line monitoring of THE operation of THE PLC program in workS2 software will be written into the PLC, if you want to see the program in the actual PLC operation, can use the online monitoring function of the software, when the function is used, should ensure that PLC and computer communication cable connection is normal, PLC power supply is normal.Retweets are the biggest encouragement!Thank you for your support!Tips xiaobian said: to prepare 3000+PLC case information package, suitable for learning and doing project reference!