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
-
Choose the
Siemens PLCdata source
-
Enter the IP address of the PLC. You can test the network connection by pinging the device (using the
Pingbutton), check that the PLC accepts TCP connections on port 102 using theTCP connectbutton and verify the S7 connection using theTestbutton. Select the series of CPU to connect to (200/400or1200/1500).
-
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 disconnectedandPLC not in RUN) - DB: data contained in the Data Blocks (DB) of the PLC
- Info: connection information (
- DB number. Visible in the TIA Portal project.
- S7 type. The available data types are:
REALINTDINTUINTUDINTBYTEWORDTIME_OF_DAYin millisecondsDATEin unix timestampDTLin unix timestamp, assuming the PLC works in UTCDTL_LOCALin unix timestamp, assuming the PLC works in local timeDATE_AND_TIMEin unix timestamp, assuming the PLC works in UTCDATE_AND_TIME_LOCALin unix timestamp, assuming the PLC works in local timeTIMEin millisecondsBOOLSTRINGFSTRINGWSTRINGCHARWEEKLY_STARTSTOP_SCHEDULE(custom schedule)TIME_H_M_Sin milliseconds, decoded from 3UINT(hours, minutes, seconds)TIME_H_Sin milliseconds, decoded from 2UINT(hours, seconds)TIME_H_Min milliseconds, decoded from 2UINT(hours, minutes)TIME_M_Sin milliseconds, decoded from 2UINT(minutes, seconds)

-
Perform a read test of the newly created variable by clicking on the
Readbutton in the actions column. If the read is successful, the value read will be shown in the column.
-
Repeat steps 3 and 4 for all variables of interest, then click on
Nextto go to theMetadatatab. -
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).

-
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.