laitimes

The configuration king software communicates with the S7-200SMART wireless MODBUS

author:PLC wireless communication expert

This solution is the implementation of wireless MODBUS communication between the configuration software and the Siemens S7-200 Smart. This solution can be used as an example of wireless MODBUS communication between the Siemens S7-200 Smart and the configuration software. In this scheme, the Siemens PLC dedicated wireless communication terminal DTD434M is used as the hardware device to realize wireless communication.

1. Program overview

1. Wired MODBUS network

The configuration king is configured as a standard MODBUS master, and the Siemens PLC is configured as a MODBUS slave using the MODBUS library file, which is simple and convenient to use, and communication can be completed without in-depth understanding of the details of the MODBUS protocol. Based on this scenario, the practical application can be further expanded.

The configuration king software communicates with the S7-200SMART wireless MODBUS

2. Wireless MODBUS network

Wireless MODBUS networks are easily implemented via the DTD434MC and wired connections are replaced without changing network parameters.

The configuration king software communicates with the S7-200SMART wireless MODBUS

Second, configure the king to implement the MODBUS master station

1. Create a new configuration king project

Open the Configuration King Project Manager, click File→ New Project in the menu bar, the New Project Wizard dialog box will pop up, click Next, and enter the project name, such as MODBUS_ZUTAIWANG. Click Next to finish. The new project is added to Project Management. As shown in the following figure:

The configuration king software communicates with the S7-200SMART wireless MODBUS

2. Create a device

Double-click the newly created project in the Project Manager to enter the Project Browser interface and select Device → in the Project Browser

COM1→ New... Go to the Device Configuration Wizard and select PLC→ MULTICOM→ModbusRTU→COM

The configuration king software communicates with the S7-200SMART wireless MODBUS

Click Next, name the device, such as MODBUS, continue to click Next, select the computer serial port, such as the local serial port uses COM1, continue to the next step Select the Modbus slave station number, such as 2#, continue to the next step, create the device is completed, and display the newly created MODBUS device in the device area, as shown in the following figure:

The configuration king software communicates with the S7-200SMART wireless MODBUS

3. Create a data dictionary

Next, a database is created for data transfer between Configuration King and the device. Select Database → Data Dictionary in the Project Browser to create the I0.0-I0.3 input register variables and Q0.0-Q0.3 output coil variables required for this project. First, click New to pop up the Define Variable dialog box:

The configuration king software communicates with the S7-200SMART wireless MODBUS

Define the variable name, the variable type is I/O discrete, the connected device selects MODBUS, the corresponding register is selected, the data type is Bit, and the read-write properties are defined. The I0.0-I0.3 input register variables and Q0.0-Q0.3 output coil variables are shown in the following figures:

The configuration king software communicates with the S7-200SMART wireless MODBUS

4. Create a screen

Once the variables are defined, the screen is created. Select File → Screen →New..., as shown in the following figure:

The configuration king software communicates with the S7-200SMART wireless MODBUS

The variables and the screen are mapped to variables, and the configuration king project is established.

Third, Siemens PLC implements MODBUS slaves

As a slave, the Siemens PLC only needs to configure the Modbus slave using the Modbus library functions provided by the MODBUS library.

1. Initialize the MODBUS slave

Slave address: 2 Baud rate: 9600 Communication mode: 8 N 1

The configuration king software communicates with the S7-200SMART wireless MODBUS

2. Start the MODBUS slave

Wireless RS485 communication is used

The configuration king software communicates with the S7-200SMART wireless MODBUS

The Siemens PLC slave is set up.