Configuring Siemens Addressing
The S7 protocol does not support Tag browsing. Therefore, you must configure all Tags in the Designer. This can be done either manually, as needed, or by importing bulk using the Tags CSV import functionality.
To Manually Specify Each Address
- From the Designer, in the Tag Browser, click the Add icon.
- Select New Standard Tag, then OPC Tag.
- In the Tag Editor window, as an example, you can set the following values:
Data Type: Int4
OPC Server: choose Ignition OPC-UA Server with the edit button on the right.
OPC Item Path: [S71200]IW0, the S71200 device name goes in the square brackets then you give the address to PLC which in this example is IW0 (Word at Offset 0 in the Inputs area). The Address Syntax section explains how you can construct these addresses.
- Click OK.
Now you can see the Temp Tag in the Tag Browser.
You need a device name plus a Tag address to create a Tag. The device name is a known, but the Tag address needs to be configured. Once you have both the device name and Tag address you enter them in the in the OPC Item Path field of the Tag Editor window using the [device_name]address format, where device_name is the name of the device and address is the configured Tag address which is described here.
Tag addresses are made up of three different components: Area, Data Type and Offset.
Data Type Syntax
|String||STRING or STRING.LEN||N/A|
To form an address, you combine syntax for the desired Area and Data Type with an Offset into that area.
|IB0||Byte at Offset 0 in the Inputs area|
|IW0||Word at Offset 0 in the Inputs area|
|DB500,DI8||DInt at Offset 8 in DataBlock 500|
|ISTRING24.50||A String of length 50 starting at offset 24 in the|
|IX20.3||Bit 3 of the Byte at Offset 20 in the Inputs area|
|T0||Timer at offset 0 (No data type is specified for|
|C0||Counter at offset 0 (No data type is specified for|
It is important to note that offsets are absolute. IW0 and IW1 share a byte. To get two consecutive, non-overlapping words you need to address IW0 and IW2.
Bits are addressed by using the Bit data type (X) and appending
.bit to the end, where bit is in the range [0-7]. When addressing a bit at a given offset, that offset is always treated as a byte.
Strings are assumed to be in the S7 string format and have a max length of 210.
Timers are scaled up to a DWord and converted from S5 time format so they can represent the time in milliseconds without requiring any multipliers. When you write to a timer it is automatically converted from milliseconds into S5 time format for you. A data type is not specified when accessing timers.
Counters in the PLC are stored in BCD. The driver automatically converts to/from BCD for you and exposes any counter Tags as UInt16 values. A data type is not specified when accessing counters.