Profinet to Modbus TCP gateway connection between DCS and Fanuc Robotics
When communicating with the robot, Funuc serves as the server and DCS sends read and write requests to Funuc through the Kaijiang Profinet to Modbus TCP gateway as the client. After Funuc responds, DCS receives Funuc’s data through the Profinet to Modbus TCP gateway, achieving data transmission. Note that Modbus cannot communicate synchronously, and the host can only send requests to one slave at a time. Only one data is transmitted on the bus at a time, that is, the host sends, and the slave responds. If the host does not send, there is no data communication on the bus. The slave will not send messages to the master station on its own, and can only reply to message requests sent from the host.
1. Hardware connection, port 1 here, IP settings: MENU – Settings – Settings 2- Host communication, select TCP/IP settings;
WKgaomS-aBGAeY28AAZduav0hxk228. pngwKgZomS-aBmAdXUAAAkmmh03WGw013. png
2. On this interface, you can set the FUNUC IP and fix the IP of the client to be connected to prevent unauthorized hosts from connecting to the machine;
WKgaomS.aouAButaApkPUhm6wE137.png
3. Port settings: MENU – Next page – System – Variables enter MODBUSTCP settings and modify the port number in the PORT parameter;
WKgaomS.apGAUVcqAAPID8kUMg8145.png
4. The register value setting for the robot that the PLC needs to read and write: This setting value should be greater than the number of memory that the PLC needs to read and write. MENU-IO-MODBUS TCP is entered, and MODBUS TCP communication parameters can be set here. For example, to write UI [1] – UI [20], 3 16 bit memory are required, and 6 GI memory are also needed. It is obvious that inputting a word number of 4 here is not enough, so it can be set larger;
WKgaomS-cFCAfPTeAATcOBrTmpY280.png
5. Robot memory allocation: During MODBUS TCP communication, the robot rack number is fixed to 96, slot number is 1, and UO requires two MB address bits corresponding to the memory
UI requires two MB address bits corresponding to memory, while GI requires six MB address bits corresponding to memory;
WKgaomS-cFaAYlBgAAOFbm0Eh3k289.png
6. The slave station setup has been completed. Open the Profinet to Modbus TCP gateway configuration software to configure the Profinet to Modbus TCP gateway. Open the software, click on the red circle to create a new project and select PN2MTC;
WKgaomS-cIqAEZ-DAABeTmjtZYw078.png
7. Set the IP address and device name of the Profinet to Modbus TCP gateway in the Profinet network (the new version can be assigned through configuration software);
WKgaomS-cJCAQXRxAABnfYIErx0453.0ng
8. Set the Modbus TCP communication parameters for the Profinet to Modbus TCP gateway. Firstly, set the IP address of the Profinet to Modbus TCP gateway on the client side;
WKgaomS-cJiAILlHAAB6cdneS3Y803. png
9. Right click on ModbusTCP to add a slave and fill in the IP address of the server (robot);
WKgaomS-cKGAE0pAAAB3lKQRSS4790.png
10. Right click on NODE and add the required function code. For example, if using the 03H function code to read the 40000 address area, we will select Read Holding Registers;
WKgaomS-cKeAUC8WAADHbpA_oo652.png
11. The main station software reads register data from 40001-40010, but the register address in the main station software starts from 40001, while the Profinet to Modbus TCP gateway starts from 40000, so the address needs to be filled with 0. There are 10 registers, and the memory mapping start address is 0 corresponding to the Profinet main station start address;
WKgZomS-cK2AbjneAACIDMA3-90770. png
12. At this point, the Profinet to Modbus TCP gateway has been set up and the DCS configuration software SYCON.net has been opened;
WKgaomS-cLOAUv0UAAQSFN4M79E986.png
13. Add the GSD file for converting Profinet to Modbus TCP gateway and click on Import Device Description;
WKgZomS_d5KAFAo2ADoShrZ-AI356. png
14. Select the folder where the GSD file is located and select the GSD file;
WKgZomS_d5mAL7GwAALqe6XHTBw044.png
15. Select Kaijiang Intelligent KJ-PNG-206, hang the Profinet to Modbus TCP gateway on the Profinet bus, double-click the Profinet to Modbus TCP gateway to enter the configuration interface;
WKgaomS_d6CAAqCIAALTxSzqHYQ124.png
16. Click Add Module to add the input and output length of the Profinet to Modbus TCP gateway, and set the IP address of the Profinet to Modbus TCP gateway;
WKgaomS_d7CAFQHsAAL8UABC39o362.png
17. After being configured, it can be imported into DCS for normal use by reading and writing the specified input and output addresses