Skip to content

S7 Device Service

The S7 Device Service provides a means of integrating Siemens S7 PLCs with Edge Xpert.

The Edge Xpert S7 Device Service can be used to communicate with devices that use the Siemens S7 protocol. For further information on the S7 protocol, see the Snap7 website.

Breaking Change in Edge Xpert v2.2

  • The following device resource attribute keys are now in lower case:
    • Operation → operation
    • Size → size
    • Start → start
    • Type → type
  • The following attribute values for operation are now in lower case:
    • Conn_state → conn_state
    • Err_text → err_text
    • Job_res → job_res
    • State → state
  • The attribute values for DB_number, size and start have changed from strings to integers

Key Features

The S7 Device Service supports the following key features:

  • Singular Requests, including:

    • Data Block. Read/Write
    • Process Input Image. Read/Write
    • Process Output Image. Read/Write
    • Read Last Job Result. Read
    • Read PLC State. Read
    • Read Connection State. Read
    • Log Error Code. Write
  • Multiple Requests, including:

    • Data Block. Read/Write
    • Process Input Image. Read/Write
    • Process Output Image. Read/Write
  • Support for the following devices:

    • S7-300
    • S7-400
    • S7-1200
    • S7-1500

Supported Data Types

The S7 Device Service supports the following data types:

  • Bool
  • String
  • Uint8, Uint16, Uint32, Uint64
  • Int8, Int16, Int32, Int64
  • Float32, Float64

S7 Device Profile

The device profile defines what resources are available on a particular device. The following attribute is required for all S7 device resources. It has five accepted values, which are listed in the table below. For further information on the accepted values, see Additional Attributes.

Attribute Accepted Values
type
  • DB: Signifies the resource is for Data Block operations
  • IPU: Signifies the resource is for Output Process operations
  • IPI: Signifies the resource is for Input Process operations
  • PLC: Signifies the resource is for PLC operations
  • MISC: Signifies the resource is for Miscellaneous operations

Additional Attributes

There are additional attributes that are required for S7 device resources. However, these are dependent on the value chosen for type. The table below describes the attributes that should be included for each accepted value of type.

Accepted "type" Value Additional Attribute Attribute Description
DB DB_number
  • Non-negative Int32
  • Data Block Index (0 - 0xFFFF)
start
  • Non-negative Int32
  • Offset to start
size
  • Non-negative Int32
  • Size to Read/Write in Bytes (only required for String data types)
IPU start
  • Non-negative Int32
  • Offset to start
size
  • Non-negative Int32
  • Size to Read/Write in Bytes (only required for String data types)
IPI start
  • Non-negative Int32
  • Offset to start
size
  • Non-negative Int32
  • Size to Read/Write in Bytes (only required for String data types)
PLC operation
  • String
  • Only currently accepted value is "state"
MISC operation
  • String
  • Accepted values:
    • job_res: the last Job result
    • err_text: error text for a given error code (logged to log file)
    • conn_state: the connection state

Using the S7 Device Service

An example of setting up and using devices with the Edge Xpert S7 Device Service can be found at S7 Example.