S7 resources
- Last UpdatedJun 25, 2026
- 2 minute read
S7 resources are used to specify the register mappings for different Siemens S7 programmable logic controller (PLCs). When the resource is used in the S7 Reader module, all listed tags are retrieved. Additional tags can be added to the module. A JSON file is used to define these mappings. Any properties in addition to the default tag properties later described, are treated as custom metadata and added to the messages.
Code example: S7 resource
{
"name": "Demo S7 PLC",
"type": "S7300",
"tags": [
{
"id": "tag1",
"name": "ValveTemp",
"s7DataArea": "Input",
"s7DbAddress": 0,
"s7StartAddress": 0,
"s7Type": "Int"
},
{
"id": "tag2",
"name": "ValveOpen",
"s7DataArea": "Input",
"s7DbAddress": 0,
"s7StartAddress": 2,
"s7BitAddress": 5,
"s7Type": "Bool",
"tagCount": 1
},
{
"id": "tag3",
"name": "Machine",
"s7DataArea": "DataBlock",
"s7DbAddress": 0,
"s7StartAddress": 10,
"s7Type": "String",
"length": 25
}
]
}
How to reference S7 resources
A S7 device (PLC) is specified as a JSON object that must have at least a name and one tag in the tags list. Custom metadata can be added to every object in the resource file and becomes part of the outgoing message.
A tag (register) is defined by the following parameters:
-
id: Unique name of the tag that will be included in the message.
-
name: Optional name of the tag that will be included in the message.
-
s7DataArea: One of Input, Output, Memory or DataBlock.
-
s7DbAddress: Integer selecting the Db (only used when s7DataArea is DataBlock).
-
s7StartAddress: Integer setting the start address within the selected data area.
-
s7BitAddress: Integer (0-7); only used with Bool types to specify the bit to use within the selected byte.
-
s7Type: The type of data to read; could be one of:
-
Bool
-
Byte
-
Word
-
DWord
-
Char
-
SInt
-
Int
-
DInt
-
USInt
-
UInt
-
UDInt
-
Real
-
String
-
This setting affects the number of bytes to read and how they should be interpreted by the module.
-
-
length: Integer (>=1); only used with String types to specify the number of characters to read.