Skip to main content
Version: 8.3 Beta 🚧

Siemens Legacy Drivers

The following Siemens Legacy drivers in Ignition connect to PLCs via TCP/IP using the S7 protocol. Similar to Modbus and some Allen Bradley connections, the following S7 devices do not support tag browsing. You can create S7 tags manually in Ignition, or use Ignition's tag import/export to create all of your tags quickly in Excel or another spreadsheet program.

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

Connecting to a Siemens Device​

caution

The Siemens Drivers module requires the OPC UA module to be installed and enabled. If the OPC UA module is not installed or is disabled, this module will fault with a warning in the logs and display the state as "Faulted Missing Dependency" on the Platform > System > Modules page.

Inductive University

Connecting to S7 Devices

Watch the video

  1. Go to the Connections section of the Gateway Webpage.

  2. Select Devices > Connections.

  3. On the Devices page, click on Create Device Connection +.

  4. All four of the available driver options are shown on the Select Driver form. For this example we will select Siemens S7-1200 Driver (Legacy).

    • Siemens S7-1500 Driver (Legacy): Connects to Siemens S7-1500 PLCs over Ethernet.
    • Siemens S7-1200 Driver (Legacy): Connects to Siemens S7-1200 PLCs over Ethernet.
    • Siemens S7-300 Driver (Legacy): Connects to Siemens S7-300 PLCs over Ethernet.
    • Siemens S7-400 Driver (Legacy): Connects to siemens S7-400 PLCs over Ethernet.
  5. Click Next.

  6. On the New Device page, leave all the default values and type in the following fields:

    • Name: S71200
    • Hostname: type the IP address, for example 10.20.4.71.
  7. You can check the box for Show Advanced + to see the additional settings, but you can keep all the defaults.

  8. Click Create Device Connection. The Devices page is displayed showing the Siemens device is successfully created and added to Ignition. The Status will show as Disconnected and then Connected.

Configuring Siemens Addressing​

Inductive University

About Siemens Addressing

Watch the video

To see and browse the tags, you need to create the tags manually or by importing bulk using the tags CSV import functionality. Both options are completed in the Designer.

Manually Specify Each Address​

  1. From the Designer, in the Tag Browser, click the Add Add Icon icon.

  2. Select New Standard Tag, then OPC Tag.

    Manually Specify Each Address Step 2

  3. In the Tag Editor window, as an example, you can set the following values:

    • Name: Tag
    • 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.
  4. Click OK. Now you can see the Temp tag in the Tag Browser.

Address Syntax​

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. Refer to the following list for more information on data types and offsets to use when forming addresses.

  • Offsets: 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: 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: Strings are assumed to be in the S7 string format and have a max length of 210.

  • Timers: 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: 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.

Tag addresses are made up of three different components: Area, Data Type, and Offset.

Area Syntax​

AreaSyntax
DataBlocksDBn
InputsI
OutputsQ
FlagsM
TimersT
CountersC

Data Type Syntax​

Data TypeSyntaxSignedness
BitXN/A
ByteBUnsigned
CharCSigned
WordWUnsigned
IntISigned
DWordDUnsigned
DIntDISigned
RealREALSigned
StringSTRING or STRING.LENN/A
Date_And_TimeDT

Note: Due to limitations on Siemens devices, this data type is only supported on the following devices:
  • S7-300
  • S7-400
  • S7-1500
N/A
LIntLI

Note: Due to limitations on Siemens devices, this data type is only supported on the following device:
  • S7-1500
Signed
LRealLREAL

Note: Due to limitations on Siemens devices, this data type is only supported on the following devices:
  • S7-1200
  • S7-1500
Signed
Extracting Bytes in DATE_AND_TIME Items

The Siemens driver does not support Ignition tag's DateTime type. In these cases it is recommended to extract each byte in the Siemens DATE_AND_TIME value item, storing each into a separate Ignition tag. Then use an expression tag to combine each byte into a human readable datetime.

Example

// The following assumes each byte of the DATE_AND_TIME value is under a tag named like "BASIC_DATA_AND_TIME", and that each tag is a String type.

"20" + //First part of the year, assuming in 21st century
toHex({[.]BASIC_DATE_AND_TIME[0]}) + β€œ-” + //Second part of the year, reading from an Ignition tag.
numberFormat(toHex({[.]BASIC_DATE_AND_TIME[1]}), β€œ00”) + β€œ-” + //Month
numberFormat(toHex({[.]BASIC_DATE_AND_TIME[2]}), β€œ00”) + β€œ-” + //Day
numberFormat(toHex({[.]BASIC_DATE_AND_TIME[3]}), β€œ00”) + β€œ:” + //Hours
numberFormat(toHex({[.]BASIC_DATE_AND_TIME[4]}), β€œ00”) + β€œ:” + //Minutes
numberFormat(toHex({[.]BASIC_DATE_AND_TIME[5]}), β€œ00”) + β€œ:” + //Seconds
numberFormat(fromBinary(left(numberFormat(toBinary({[.]BASIC_DATE_AND_TIME[6]} + {[.]BASIC_DATE_AND_TIME[7]}), β€œ0000000000000000”), 12)), β€œ000”) + " " + //Milliseconds, it includes the first 4 bits of byte 7
case( //Day of the week, last 4 bits of byte 7
right(numberFormat(toBinary({[.]BASIC_DATE_AND_TIME[7]}), β€œ00000000”), 4),
β€œ0000”, β€œSunday”,
β€œ0001”, β€œMonday”,
β€œ0010”, β€œTueday”,
β€œ0011”, β€œWednesday”,
β€œ0100”, β€œThursday”,
β€œ0101”, β€œFriday”,
β€œ0111”, β€œSaturday”,
β€œError - No Day Found”)

Area + Data Type + Offset Examples​

To form an address, you combine syntax for the desired Area and Data Type with an Offset into that area.

AddressDescription
IB0Byte at Offset 0 in the Inputs area.
IW0Word at Offset 0 in the Inputs area.
DB500,DI8DInt at Offset 8 in DataBlock 500.
ISTRING24.50A String of length 50 starting at offset 24 in the Inputs area.
IX20.3Bit 3 of the Byte at Offset 20 in the Inputs area.
T0Timer at offset 0 (No DataType is specified for Timers).
C0Counter at offset 0 (No DataType is specified for Counters).

Device Settings​

General​

SettingDescription
NameThe name of the Device Connection.
DescriptionA description for the Device Connection. The description will appear on the Devices page on the Gateway.
EnabledWhether or not the connection is active. Disabling this setting terminates communication with the device.

Connectivity​

SettingDescription
HostnameThe hostname or IP address of the device.
PortThe port to use when connecting to the device. The default is 102.
Local AddressThe local address to connect from when establishing a TCP connection. If left blank, then the driver will simply pick an available address.
TimeoutThe request timeout, specified in milliseconds. The default is 2,000.

Advanced​

SettingDescription
PDU SizeNumber of bytes to fit into PDU block of a single packet. Increasing this number can improve request throughput only if the processor supports a higher PDU Size. Varies from 240 and up to 960 depending on the device. The default is 240.
Rack NumberThe number of the rack that the device is positioned in. The default is 0.
CPU Slot NumberThe slot number assigned to the CPU. The default is 2.
Reconnect After Consecutive TimeoutsAfter several consecutive timeouts, the Device Connection will attempt to reconnect to the Device. Default is true.