Configuration example: Connecting flow meter to PLC via Modbus to Porfinet gateway
[Copy link]
This post was last edited by Xiaojiang Intelligent Control on 2022-2-24 20:45
Configuration example: Connecting flow meter to PLC via Modbus to Porfinet gateway
Case introduction:
This case is a configuration case of connecting the Xiaojiang Intelligent Control Modbus to Profinet gateway to the STM level meter. The devices used are a Siemens 1200PLC, a Xiaojiang Intelligent Control Modbus to Profinet gateway (GW-PN5001), and an STM level meter.
Modbus to Profinet gateway configuration method:
Open Botu, create a new project and add the gsd file.
Establish a Profinet connection, set the IP address and device name of the Modbus to Profinet gateway, and keep the IP in the same network segment as the Modbus to Profinet gateway.
Enter the Modbus to Profinet Gateway device view and select the total data length of input and output. Add the selected length from the hardware catalog on the right.
Download the configuration to the PLC, open the Modbus to Profinet gateway configuration software to configure the Modbus parameters, click New in the red circle, and select PN2MM.
Set the IP address and device name of the Modbus
to Profinet gateway to be consistent with the PLC configuration.
Set the 485 parameters baud rate, data bit, and parity of the Modbus to Profinet gateway to be consistent with those of the slave station.
The waiting and polling delays need to be adjusted according to the slave device. If the slave responds slowly, increase the response waiting time. If the slave responds and requires a period of time before receiving the next command, increase the Modbus to Profinet gateway polling delay. Right-click on ModbusRTU and select Insert. In the lower menu, click Node to fill in the slave station number.
Continue to right-click Insert,
Select the required functions according to different needs.
Open the slave manual,
Look at the device communication definition, the default value is used here.
In the Modbus to Profinet gateway configuration software, configure the 485 parameters in the same way.
The figure below shows the function codes supported by the slave, mainly function codes 04 and 10.
The following figure shows the register address of the parameter.
Each register consists of two bytes of data, and two adjacent data can be read with one command, for example, the liquid level value and the temperature value are two adjacent parameters. After reading the two register parameters, the data will be mapped to IW68 and IW70 of the PLC in sequence. Similarly, three registers can be set later to read the data of registers 24, 26, and 28.
Click to automatically calculate the mapping address, and this address data will be mapped starting from the fourth bit of the I address.
Case summary:
The above is the configuration process of the Xiaojiang Intelligent Control Modbus to Profinet gateway to connect the STM level meter to the Siemens PLC.
|