Hardware: Mitsubishi fx one
Da xing yi kong Mitsubishi special Ethernet CHNet-FX yi tai
CHNet-FX module supports 8 connections, that is, when our plc is ModbusTCP server, we can have 8 Modbus TCP clients at the same time. Communicate with him at the same time,
We need some software, this Ethernet debugging assistant, to debug this plc server and debug programs, and then we will use this Modbus poll to simulate ModbusTCP server, ModbusRTU master station and Modbus ASC master station.
Next, we continue to talk about this Mitsubishi FX5U, which realizes the configuration process of Modbus TCP. This is a project that we have done well.
To realize his Modbus TCP process, the first step is to connect CHNet-FX with FX5U PLC.
Create a new FX3U/FX3UC project, and double-click the Connection target in the navigation bar: connection.
After the option board pops up, select the option of double-clicking "Ethernet board" on the computer side, and then click "Yes" in the reminder; Double-click "PLC module" on the programmable controller side;
In the following settings, after clicking "Search FXCPU(S) on the network", search FX3UC connected to CHNet-FX.
Select in turn according to the labels in the figure, and finally click OK;
? After selecting the IP address above, click "Communication Test" to connect with FX3UCCPU.
5. Then, you can read, write and monitor the PLC in the Online option bar.
Modbus distribution address
PLC configuration
The slogan is port 502, as a parameter that the server needs to set.
This logic program D0, D 1, D2 and D3 pay the initial values K0, K 1, K2 and K3 respectively. At initialization, we set this parameter for D4, D5, D6 and D7. The default communication mode is ModbusTCP, and the programmable IP address setting is the same as above, 192+0638.
Use a special flag bit. Every minute, we will add one to D0, D 1, D2 and D3 to see if we can add one, and then make a real-time judgment. When the values of D0, D 1, D2 and D3 are greater than 6000, they will be cleared respectively, that is to say, d0d 1d2d3.
The purpose of this is to facilitate us to observe the changes when the client reads the registers of PLC, such as D0, D 1, D2 and D3. This is a short logic program.
Enter program monitoring
At this time, D0, D 1, D2 and D3 are 0, 1, 2 and 3 respectively; After 1 minute, the operation of+1 will be performed. The PLC program can be tested below.
Test with Ethernet debugging assistant first.
The adapter is that PLC is connected to the router through CHNet-FX network cable, and the computer is connected to the router through wireless network card.
Protocol Mode: Client Client
Target IP: chnet-FX user-defined IP address.