EG Edge Gateway User Guide: Integration With Siemens PLC Using The PPI Protocol - IOTROUTER
Animazione Hover

Guida all'uso del gateway EG Edge: Integrazione con il PLC Siemens tramite il protocollo PPI

Today, let’s talk about how to interface with Siemens PLC using the PPI Protocol.

L'articolo di cui abbiamo parlato prima:

How to interface with Omron PLC via EtherNet/IP protocol

How to interface with Omron PLC via Hostlink protocol

How to interface with Omron PLC via Fins protocol

How to interface with Mitsubishi PLC using the MC-1E protocol

1. Connessione hardware

Compatible PLC: S7-200

The Siemens S7-200 communicates via the PPI protocol. This section focuses on how the EG8200Mini reads data from the Siemens S7-200 PLC using the PPI protocol.

Before communication between the EG8200Mini and the Siemens S7-200, the wiring must be correct. The PPI protocol uses RS485 communication. The specific wiring is as follows: Pin 3 connects to A, and Pin 8 connects to B.

Integration with Siemens PLC using the PPI Protocol01

The actual wiring diagram is as follows: the red wire is RS485A connected to Pin 3 of the S7-200, and the blue wire is RS485B connected to Pin 8 of the S7-200.

Integrazione con il PLC Siemens mediante il protocollo PPI02

2. PLC Serial Port Parameters

2.1. Open STEP7 Software

Open the STEP7 software.

Integration with Siemens PLC using the PPI Protocol03

2.2. View Communication Parameters

You can see that the station address is 2 and the baud rate is 9600. These parameters will be required later for gateway configuration.

Integration with Siemens PLC using the PPI Protocol04

3. Gateway Settings

3.1. Impostazioni di connessione del PLC

Drag a Siemens node from the left panel and double-click to open the settings page. Fill in the configuration according to the PLC serial parameters as follows:

Protocollo: Select PPI

Serial Port: Select RS485-1 (choose according to actual hardware connection)

Baud Rate: 9600

Data Bits: 8

Stop Bits: 1

Parity: EVEN

Timeout di comunicazione: 2000

Serial Frame Interval: 100 ms (adjust according to actual conditions; recommended 50–100 ms)

Station Address: 2

Integration with Siemens PLC using the PPI Protocol05

After completing the PLC connection settings, click Distribuire. The PLC status should display Ready.

Integration with Siemens PLC using the PPI Protocol06

3.2. Configurazione del punto dati

In general, you can fill in the data points to be read directly in the Siemens node parameter list. Once the data points are filled in, they will be read automatically according to the configured frequency.

In this example, an advanced method is used: reading PLC points via a function node. The advantage of this method is that the data points to be read can be dynamically modified.

Drag a Function node and copy the following code:

msg.payload = []

msg.payload[0] = {}

msg.payload[0].func = "ReadBool"

msg.payload[0].body = {}

msg.payload[0].body.name = "I0.5"

msg.payload[0].body.address = "I0.5"

msg.payload[0].body.length = 1

return msg;

The meaning of this code is: use the ReadBool method to read 1 Boolean value at address I0.5, and store the result in a variable named I0.5. The length parameter indicates how many consecutive addresses can be read at once. msg.payload is an array, so you can also read multiple different types of data at the same time.

All callable methods can be referred to in the node documentation:
This is a Yuque content card. Click the link to view:(È possibile utilizzare Google Chrome per la traduzione.)

https://iotrouter.yuque.com/zn3vdn/eg8000/hh3gq8an371h7xiw

Integration with Siemens PLC using the PPI Protocol07

3.3. Test

Drag an Inject node and a Debug node as shown in the diagram. Click the Inject node and observe the read data point. The result should be:

I0.5: true

Communication is successful!

Integration with Siemens PLC using the PPI Protocol08

Contatto