Siemens S7 Communication

Материал из WebHMI Wiki
Перейти к: навигация, поиск
Эта страница — перевод страницы Siemens S7 Communication. Перевод выполнен на 100%.

Другие языки:
English • ‎русский

Since version 1.7.0.3180 WebHMI supports work with Siemens S7 controllers via S7 Communication protocol over Ethernet (Profinet interface on the controller). It makes possible for WebHMI to work with PLCs such as Siemens S7-300, S7-400, S7-1200, S7-1500 and others that support this protocol. To configure the connection, you must define the following parameters in the controller configuration:

PLC address - This is the IP address of the controller or the communication module.
TSAP - This is the device address in the COTP protocol. It is indicated in hexadecimal format. The high byte indicates the access type (default is 03). The low byte consists of two values ​​of Rack (default is 0) and Slot (default is 1). See the documentation for the controller for more details. WebHMI uses local TSAP number = 1000.

In the S7 Communication protocol, the following registers are supported:

RegisterDescriptionData typeRead/Write
Qx.yDigital outputs of the controller. X — offset address, Y — bit address. You can address both bits and bytes and words. Examples: Q0.2, QB2, QW0, QD2Bit, Byte, Word, Double WordRead/Write
Ix.yDigital inputs of the controller. X — offset address, Y — bit address. You can address both bits and bytes and words. Examples: I0.2, IB2, IW0, ID2Bit, Byte, Word, Double WordRead/—
Mx.yМ memory. X — offset address, Y — bit address. You can address both bits and bytes and words. Examples: M0.2, MB2, MW0, MD2Bit, Byte, Word, Double WordRead/Write
Vx.yСиноним DB1.DBxx. Обращение к блоку памяти DB1. X — offset address, Y — bit address. You can address both bits and bytes and words. Примеры: V0.2, VB2, VW0, VD2Bit, Byte, Word, Double WordRead/Write
DBx.DBy.z Addressing datablock DBx, where X - datablock number (1, 2, 3 ...). Y — offset inside the datablock, Z — bit number. You can address both bits and bytes and words. Examples: DB1.DBB0.2, DB4.DBD2, DB4.DBW13.3Bit, Byte, Word, Double WordRead/Write

Note that although WebHMI correctly recognizes addresses with the data size included in them (for example, IW0 in the notation Siemens stands for a Word type register), but the data size from the address itself is ignored and instead the data size specified in the WebHMI project settings of this register is used. I.e. the address is used exclusively as an base address and in fact the three addresses IW0, IB0, ID0 are equivalent to the record I0.

Example of setting up a connection for the S7-1200 controller see : here.

Connecting WEBHMI to Siemens controllers is possible simultaneously with other devices on the same network (HMI panels, other controllers), because the controllers support several connections, depending on the type:
S7-comm 1200 conn.png
S7-comm 400 conn.png