Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Home
  • Knowledge base
  • Contact Us
  • Home
  • Connectors
  • Siemens S7

Siemens S7 - Instance & item setup

How to setup a Siemens S7 instance and item in SIA

Written by Mads Mikkelsen

Updated at December 5th, 2024

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Installation & Technical information
    Introduction SIA Connect Standalone SIA Connect ANY-Ware Cellular & WiFi connectivity
  • Configuration in the Web UI
    Getting started with the UI Connectors Instances Items Mapping Data System Network Tools & Add-ons DigiCert IoT Trust Manager
  • Connectors
    Siemens S7 Azure IoT Ethernet/IP Mitsubishi MELSEC OPC-UA Server SQL MQTT Omron Host Link REST API Omron FINS Keyence Beckhoff TwinCAT BACnet Virtual OPC-UA Client MS SQL File M-Bus Modbus
  • Scripting & Variables
    Data formatting
  • Developers
    API documentation Shadow API
  • Tutorials & Guides
    InfluxDB AWS IoT Core - Amazon Web Services Microsoft Power BI KaaIoT Siemens S7 AVEVA Insight SIA Connect Demo Rack Grafana Azure
  • General
+ More

Table of Contents

Info Parameters Instance Info Item Data types Memory areas Reading blocks (arrays) of data Additional internal information

Articles in this section:

  • Prepare PLC in TIA portal for external communication
  • Siemens S7 - Instance & item setup
  • Siemens S7 - Troubleshooting

Table of Contents

ParametersInstanceItem Data typesMemory areasReading blocks (arrays) of data

The Siemens S7 connector SIA is compatible with the S7-300, S7-400, S7-1200 and S7-1500 series.

There is support for S7-200 & LOGO! but with another Connector.

Info

The Connector does only support absolute addressing with DB's and offsets.


Parameters

When using the Siemens S7 Connector both the instance and item have specific parameters. These parameters are required as they are needed to establish connection and to identify which memory to read from.


Instance

The instance needs the following parameters to establish a connection to the PLC:

Parameter Description
Address (instance default) The IP address of the S7 PLC.
Rack The rack where the network card in the S7 PLC is located.
Default: 0
Slot The slot where the network card in the S7 PLC is located.
Default: 0

Typical values:
S7-300: 2 (as PSU is slot 1)
S7-1200: 0
S7-1500: 0


Info

Use Rack = 0 & Slot = 0 if your PLC does not use rack and slots.



Item

The item parameters that is needed to read the tags in the PLC memory:

Parameter Description
Address Memory address of the tag in the S7 PLC.
Check memory areas for more information of the various addressable areas
Type Data type used for determining the length of the tag in bytes and formatting it properly after a reading.
Check data types for more information on each data type


Data types

The following table shows how to address the various types of data types. In the examples it uses data block as memory area but the examples can be replaced with any of the memory areas given in memory areas.

Data type Addressing syntax Return value
BOOL (bit) DB2.DBX19.3 0 or 1
BYTE DB2.DBW20 0 to 255
WORD DB2.DBW20 0 to 65.535
INT DB2.DBW20 -32.767 to 32.767
DWORD DB2.DBD22 0 to 4.294.967.295
DINT DB2.DBD22 -2.147.483.647 to 2.147.483.647
REAL DB2.DBD26 -3.4e38 to 3.4e38
STRING DB2.DBB20-32 "Hello world!" (text inside tag)


Memory areas

Area Addressing syntax
Data block tag DB2.DBX19.3
Analog input I1.0
E1.0
AI1.0
AE1.0
Digital input I1.1
E1.1
DI1.1
DE1.1
Analog output Q2.0
A2.0
O2.0
AA2.0
AO2.0
AQ2.0
Digital output Q2.1
A2.1
O2.1
DA2.1
DO2.1
DQ2.1
Flags / Merkers M3.0
MB3.0
MD3.0
MW4.0


Reading blocks (arrays) of data

The Siemens S7 Connector supports reading of blocks of data also known as arrays. Reading of blocks can be very handy if a big chunk of data are to be read and sent to e.g. a cloud.
It can also be used to transfer big blocks of data between PLCs if the other PLC Connector supports block readings.

In order to do this you will have to specify a start offset and an end offset. Examples are shown below:

Data type Example Return value (example)
BOOL (bit) DB2.DBX10-12 [1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0]
WORD
INT
DB2.DBW12-22 [14, -20, 33, 945, 1023]
DWORD
DINT
REAL
DB2.DBD20-32 [456.4, 33.21, 45.2]
STRING
DB2.DBB0(27)-54
Where
DBB0: Specifies the first byte of the first string in the array
(27): The size of the String in BYTES. This will be the size of characters+2 - If you have a String[25], this value will be 25+2
-54: Specifies the first byte of the last String

["STRING1","STRING2","STRING3"]




siemens s7 how to configure siemens s7 configure siemens s7 siemens s7 plc siemens s7-1200 siemens s7-1500 siemens s7-300 siemens s7-400

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • Siemens S7 - Troubleshooting
  • Prepare PLC in TIA portal for external communication

0
0
Expand