How to realize the communication of Mitsubishi FX5U PLC-Ethernet-DTU-wireless network-computer-dual server mode
Software and hardware used for communication
Hardware: FX5U-64M, Ethernet cable, USR-G781 4GLTE DTU, PC
software: GX Works3 (FX5U-64M compilation software), USR-G781-setup-V1.0.0.0 product setting software, peanut shell, Ethernet Debugging assistant
Connection and test steps
- Write Passive TCP program in GX Works3
Program code reference: Mitsubishi FX5U User Manual-Ethernet Communication
- Configure the Ethernet port in GX Works3, and burn the parameters and programs into the PLC to
set the IP address, subnet mask, default gateway, add Unpassive connection equipment, and set the programmable controller port (1111)
- Set the connection server A and connection server B in the USR-G781-setup-V1.0.0.0 product setting software. The address of server A is the public network IP, the port is the public network port, and the address of server B is the PLC IP and address. After setting, click to enter the configuration state, and send the commands AT+SOCKPIPEEN=ON and AT+SOCKPIPE=SOCKA,SOCKB through the serial port
- Set and save all parameters-software restart-enter the communication state
- Map the public IP and port to the local IP (192.168.31.185) and port (8001) of the PC in the peanut shell
- Open the Ethernet debugging assistant in the PC, create a TCP Server, and set the listening port to the PC's local port 8001. At this time, the listening port will automatically pop up the IP and port of a device, and the device is DTU
- After connecting the PLC to the DTU’s LAN through the Ethernet cable, start to test
the connection between DTU and PLC (the LINKA of DTU is always on, indicating that the PC has been connected to the DTU, and the LINKB of DTU is always on, indicating that the PLC has been connected to the DTU. Connected) There is
no need for the PLC to send a handshake request. When the PLC sends data directly, the PC can receive the data