Skip to content

Configuration

Siemens S7 Protocol

The S7 protocol (RFC 1006 info1, info2) is a proprietary communication protocol used by Siemens PLCs for data exchange with the CPUs of the S7-300, S7-400, S7-1200 and S7-1500 series. It allows reading and writing variables (bits, bytes, words, double words) on connected devices.

Requirements

Read this page to prepare the CPU for communication.

Configuration

  1. Choose the Siemens PLC data source

    Pick

  2. Enter the IP address of the PLC. You can test the network connection by pinging the device (using the Ping button), check that the PLC accepts TCP connections on port 102 using the TCP connect button and verify the S7 connection using the Test button. Select the series of CPU to connect to (200/400 or 1200/1500).

    Connection

  3. Click on Add PLC tag. To import the variables of a DB from the TIA Portal project see DB definition import. To bulk import or edit the table, see bulk configuration. For each variable of interest you can set:

    • Name and metadata (see here for more details)
    • Topic. It can be:
      • Info: connection information (Device disconnected and PLC not in RUN)
      • DB: data contained in the Data Blocks (DB) of the PLC
    • DB number. Visible in the TIA Portal project.
    • S7 type. The available data types are:
      • REAL
      • INT
      • DINT
      • UINT
      • UDINT
      • BYTE
      • WORD
      • TIME_OF_DAY in milliseconds
      • DATE in unix timestamp
      • DTL in unix timestamp, assuming the PLC works in UTC
      • DTL_LOCAL in unix timestamp, assuming the PLC works in local time
      • DATE_AND_TIME in unix timestamp, assuming the PLC works in UTC
      • DATE_AND_TIME_LOCAL in unix timestamp, assuming the PLC works in local time
      • TIME in milliseconds
      • BOOL
      • STRING
      • FSTRING
      • WSTRING
      • CHAR
      • WEEKLY_STARTSTOP_SCHEDULE (custom schedule)
      • TIME_H_M_S in milliseconds, decoded from 3 UINT (hours, minutes, seconds)
      • TIME_H_S in milliseconds, decoded from 2 UINT (hours, seconds)
      • TIME_H_M in milliseconds, decoded from 2 UINT (hours, minutes)
      • TIME_M_S in milliseconds, decoded from 2 UINT (minutes, seconds)
    • Byte: offset within the DB in bytes
    • Bit: for BOOL types, 0-based index (0-7) of the bit within the byte
    • Scale (see here for more details)
    • Save to (see here for more details)

Variable

  1. Perform a read test of the newly created variable by clicking on the Read button in the actions column. If the read is successful, the value read will be shown in the column.

    Test read

  2. Repeat steps 3 and 4 for all variables of interest, then click on Next to go to the Metadata tab.

  3. Here you can give a name and an optional description to the data source. You can also indicate where to place the data source within the device hierarchy. This way you can organize devices into logical groups (e.g. departments, production lines, buildings, etc).

    Metadata

  4. Click on Save. Once the window is closed:

    • if you are using the local web interface, the changes have been successfully applied
    • if you are operating through the cloud the configuration has been saved and placed in a sending queue. Until the configuration is applied a ⚠ yellow triangle will be shown at the top of the AL300 configuration page.
      • if the AL300 is online then it is sent immediately to the AL300.
      • if the AL300 is offline it will be sent when the connection is re-established.