S7 Device Plugin

The S7 Device Plugin provides a link between CoDaBix® and physical SIMATIC S7 devices.
The S7 Device Plugin establishes and maintains connections to one or more S7 PLC devices via TCP / IP.
Every PLC can be connected through a separate Channel.

For each Channel the connection is defined by:

  • IP Address
  • Slot
  • Rack
  • Channel Type (PG, OP, other, default).

The available variables in the S7 PLC can be configured separately for each channel. Any kind of S7 variable type is supported. The plugin synchronizes the value changes between the PLC and CoDaBix®.

  • Optimized read and write requests by using the best utilization regarding the package size.
  • Automated connection handling including auto-reconnect.
  • Accessing PLC memory using user defined types.
  • Use of existing PLC projects to set up channels and variables. The following project formats are supported:
    • STEP7 Project Files (*.s7p)
    • IP-S7 Project Files (*.ips7)
    • S7 Watch Project Files (*.wproj)
    • CSV-to-S7 Project Files (*.ini)
  • S7-1500 (see PLC Settings)
  • S7-1200 (see PLC Settings)
  • S7-300
  • S7-400
  • WinAC
  • S7-SoftPLC
  • LOGO! (see PLC Settings)
  • S7-200
  • SIMATIC S5 over S5-LAN
  • S7-LAN
  • VIPA-S7 and any other S7-TCP/IP compatible PLC

Purpose

The linked devices can simply be controlled using CoDaBix®. By linking the PLC memory to the Nodes defined in CoDaBix® the PLC can directly interact with many other Nodes, devices, services, etc. maintained in CoDaBix®. Also other CoDaBix® participants can interact with the PLC devices linked through the S7 Device Plugin.

Use Cases

  • Dynamic generation of manufacturing jobs based on different conditions and data produced by machines, users, orders, condition, services, etc.
  • Additional reliability by monitoring the whole plant including inter-plant interaction
  • Centralized controller and flow surveillance for early diagnosis of possible failures
  • Possibilities to improve the Shop Floor Management by monitoring and recording production data produced by the devices
This plugin is part of the CoDaBix® Setup. Please consult CoDaBix® Setup and First Start for more information on how to install and uninstall this plugin.

Requirements

  • Basic requirements of CoDaBix®
  • Enabled outgoing TCP / IP connection via port 102

PLC Settings

Please note that in order to access the S7-1200, S7-1500 and the LOGO!, the optimized data block access has to be deactivated at the data block attributes.
To do that, you can find instructions at: Deactivate optimized data block access.

Using the Application

The configuration application resides in the folder <CodabixInstallDir> and is started by double-clicking the file with the name CoDaBix.S7DevicePlugin.Configurator.exe.

Overview

CoDaBix® - S7 Device Plugin - GUI

Usage

  • Add a new Channel in the left list by clicking the upper plus button.
    • Set the name of the channel by clicking its name in the right pane.
    • Set up the Channel Settings like the IP Address (at least required).
    • Optionally set the appropriate Device Type and select the Channel Type to be used.
    • Optionally set the Rack and Slot (in case it differs from the defaults).
  • Add a new Variable to the Channel in the second from the left list by clicking the upper first button with the plus sign.
    • Set up the name of the variable by clicking its name in the right pane.
    • Optionally set the description of the variable by clicking in the free area beneath the variable name.
    • Set up the PLC address operand to be used to access the PLC memory for that variable.
    • Set up the PLC variable type in the combo and enter, in case of a string or an array (check the option Is Array) variable, the appropriate length of the variable.
    • Optionally add additional variables in case the previously added variable is of the type “Object”. Do that by selecting the object variable in the left tree and then click the second add button with the plus sign above.
  • To remove a variable, select it in the tree and click on the button with the minus sign above.
  • To remove a channel, select it in the left list and click on the button with the minus sign above.
  • Using the Import Project button it is possible to import the following project formats:
    • STEP7 Project Files (*.s7p)
    • IP-S7 Project Files (*.ips7)
    • S7 Watch Project Files (*.wproj)
    • CSV-to-S7 Project Files (*.ini)

Important: Always save your changes before exiting the configurator application. Otherwise all most recent changes made by other configurator instances or performed by sychronization of the configuration file will result in loss of changes because CoDaBix® is running in the meantime. In this case the configurator will inform you about that circumstance.

Using CoDaBix®

The entire S7 Device Plugin configuration is located in the Node path /System/Devices/S7 TCP-IP Device. Using this root Node of the device plugin allows the full configuration of the S7 Device Plugin.

CoDaBix® - S7 Device Plugin Node

The Node tree in the image above depicts the S7 Device Plugin's default Node tree.
NOT YET IMPLEMENTED To setup one or more S7 Device Channels add a Folder Node beneath the Node S7 TCP-IP Device and add a subsequent Folder Node (under the Channels Node) with the name Channel for each device channel. Then continue with the configuration of the plugin using the following node structure.

Note: The properties Name, Description, Path and Node Type of variable Nodes currently cannot be changed in CoDaBix® because they are read from the XML Configuration file.

Example Nodes

Channels:

  • Line Controller

Variablen:

  • Mill Job No. 1
    • Rotations
    • Use Colling
    • Use Fan…
    • Point 1
      • Weight …
    • Point 2
    • Point 3

 CoDaBix® Example S7 Nodes

Using the Configuration File

Structure

The S7 Device Plugin defines the root of its element tree by the PluginSettings element as described in Plugin Configuration - Using a Configuration File and continues its XML tree using the S7Device element as described in Device Plugin Configuration - Using a Configuration File.

S7Device Element
The S7Device element serves as the container for the element Channels. This element configures the entire S7 device type represented by the device plugin.

The S7Device element looks as follows:

<S7Device>
  <Channels />
</S7Device>

Channels Element
The Channels element serves as the container for one or more Channel elements. This element maintains all channels associated with the S7 device type represented by the device plugin.

The Channels element can look as follows:

<Channels>
  <!-- 0-n Channel elements -->
</Channels>

Channel Element
The Channel element serves as the container for the elements Settings and Variables. One channel identifies one PLC connection to which the channel configuration belongs. This information is therefore used by the S7 Device Plugin to link the PLC to CoDaBix®.

Each Channel element provides the following list of attributes:

Mandatory Type Purpose
Identifier no GUID The generic unique identifier of the entity associated with the channel. This is a generic entity attribute, for more information about its usage see Plugin Configuration - Using a Configuration File: The Entities Identifier Attribute.
ChangeType no ChangeType The state of the entity configuration used to represent the channel. This is a generic entity attribute for more information about its usage see Plugin Configuration - Using a Configuration File: The Entities ChangeType Attribute.
Name yes String The unique name (within the Channels element) of the channel.

The Channel element can look as follows:

<Channel Name="Line Controller">
  <Settings />
  <Variables />
</Channel>

Settings Element
The Settings element defines the attributes to setup the channel. These attributes configure the channels connection parameters.

The Settings element can look as follows:

<Settings Address="192.168.0.80"
          Rack="0"
          Slot="2"
          ChannelType="OperationPanel"
          DeviceType="S7400" />

The Settings element provides the following list of attributes:

Mandatory Type Purpose
Address yes String The IP Address of the PLC device to link.
Rack no Int32 The rack number of the PLC device (ignored since S7-1200).
Slot no Int32 The slot number of the PLC device (ignored since S7-1200).
ChannelType no S7 Device Channel Type The type of device channel to use to communicate with the PLC.
DeviceType no S7 Device Type The type of PLC device.

S7 Device Channel Type

The following values are valid for attributes of that type:

Value Description
“OperationPanel” To connect via OP channel to the device.
“ProgrammerDevice” To connect via PG channel to the device.
“Other” To connect to the device using alternative channels.

S7 Device Type

The following values are valid for attributes of that type:

Value Description
“Logo” SIEMENS LOGO!
“S7200” SIMATIC S7-200
“S7300” SIMATIC S7-300
“S7400” SIMATIC S7-400
“S71200” SIMATIC S7-1200
“S71500” SIMATIC S7-1500

Variables Element
The Variables element serves as the container for one or more Variable elements. This element maintains all variables associated with the channel.

The Variables element can look as follows:

<Variables>
  <!-- 0-n Variable elements -->
</Variables>

Variable Element
The Variable element serves as the container for the element Variables. One variable identifies one addressable area in the memory of the PLC or a set of subsequent variables identify multiple addressable areas in the memory of the PLC. This information is therefore used by the S7 Device Plugin to link the PLC memory to CoDaBix® Nodes.

Each Variable element provides the following list of attributes:

Mandatory Type Purpose
Identifier no GUID The generic unique identifier of the entitiy associated with the variable. This is a generic entity attribute, for more information about its usage see Plugin Configuration - Using a Configuration File: The Entities Identifier Attribute.
ChangeType no ChangeType The state of the entity configuration used to represent the variable. This is a generic entity attribute, for more information about its usage see Plugin Configuration - Using a Configuration File: The Entities ChangeType Attribute.
Name yes String The unique name (within the Variables element) of the variable.
Description no String The description of the usage and purpose of the addressed memory area.
Address yes PLC Address The operand to use to address the memory of the PLC (not supported in this case: Type=“Object”).
Type yes PLC Variable Type The type of data stored at the addressed memory and how it is to be interpreted.
Length no Int32 The length of an array or string variable (only supported on Type=“String” and numerical Types). If this attribute is defined the variable defines an array value (if supported), otherwise a scalar value.

PLC Variable Type

The following values are valid for attributes of that type:

Value Description
“Bool” A variable of the PLC type BOOL.
“Byte” A variable of the PLC type BYTE.
“Char” A variable of the PLC type CHAR.
“Int” A variable of the PLC type INT. Representing a signed 16 bit integer.
“Word” A variable of the PLC type WORD. Representing an unsigned 16 bit integer.
“DInt” A variable of the PLC type DINT. Representing a signed 32 bit integer.
“DWord” A variable of the PLC type DWORD. Representing an unsigned 32 bit integer.
“Real” A variable of the PLC type REAL. Representing a single precision floating point number.
“Double” A variable of the PLC type DOUBLE. Representing a double precision floating point number.
“Date” A variable of the PLC type DATE.
“Time” A variable of the PLC type TIME.
“TimeOfDay” A variable of the PLC type TIME_OF_DAY.
“S5Time” A variable of the PLC type S5TIME.
“DateTime” A variable of the PLC type DATE_AND_TIME.
“String” A variable of the PLC type TEXT.
“S5String” A variable of the PLC type BYTE. A fixed number of bytes is interpreted as TEXT.

PLC Variable Address

The following Operand and Data Type combinations are valid to construct a valid PLC variable address:

Operands

Operand Siemens, DE IEC
Input E I
Output A Q
Flag M M
Peripherals P P
Counter Z C
Data Block DB DB
Timer T T

Data Types

Data Type Operand Bits Range Description
BOOL X 1 0 to 1 A single bit representing true (1) or false (0).
BYTE B 8 0 to 255 An unsigned 8-bit integer.
WORD W 16 0 to 65.535 An unsigned 16-bit integer (Word).
DWORD D 32 0 to 232 -1 An unsigned 32-bit integer (Double Word).
CHAR B 8 A+00 to A+ff An ASCII-Code as an unsigned 8-bit character.
INT W 16 -32.768 to 32.767 A signed 16-bit integer.
DINT D 32 -231 to 231-1 A signed 32-bit integer (Double Word).
REAL D 32 +-1.5e-45 to +-3.4e38 An IEEE754 32-bit single precision floating point number.
S5TIME W 16 00.00:00:00.100 to 00.02:46:30.000 A binary coded decimal (BCD) number representing a time span.
TIME D 32 00.00:00:00.000 to 24.20:31:23.647 A signed 16-bit integer representing a time span in milliseconds.
TIME_OF_DAY D 32 00.00:00:00.000 to 00.23:59:59.999 An unsigned 16-bit integer representing a time span in milliseconds.
DATE W 16 01.01.1990 to 31.12.2168 An unsigned 16-bit integer representing a date in days.
DATE_AND_TIME D 64 00:00:00.000 01.01.1990 to 23:59:59.999 31.12.2089 A binary coded decimal (BCD) number representing a date and time.

Examples

Example Data type Siemens IEC
Input Byte 1, Bit 0 BOOL E 1.0 I 1.0
Output Byte 1, Bit 7 BOOL A 1.7 Q 1.7
Flag Byte 10, Bit 1 BOOL M 10.1 M 10.1
Data Block 1, Byte 1, Bit 0 BOOL DB1.DBX 1.0 DB1.DBX 1.0
Input Byte 1 BYTE EB 1 IB 1
Output Byte 10 BYTE AB 10 QB 10
Flag Byte 100 BYTE MB 100 MB 100
Peripherals Input Byte 0 BYTE PEB 0 PIB 0
Peripherals Output Byte 1 BYTE PAB 1 PQB 1
Data Block 1, Byte 1 BYTE DB1.DBB 1 DB1.DBB 1

The Variable element can look as follows:

<Variable Name="Active Rotations"
          Type="DInt"
          Address="DB101.DBD 0" />

The Variable element with the Type attribute and the attibute value “Object” can look as follows:

<Variable Name="Mill Job No. 1" Description="Identifies the mill job no. 1" Type="Object">
  <Variables>
    <Variable Name="Rotations" Type="DInt" Address="DB200.DBD 0" />
    <Variable Name="Use Colling" Type="Bool" Address="DB200.DBX 4.0" />
    <Variable Name="Use Fan" Type="Bool" Address="DB200.DBX 4.1" />
    <Variable Name="Point 1" Type="Object">
      <Variables>
        <Variable Name="X" Description="The x portion of the drill." Type="Int" Address="DB200.DBW 5" />
        <Variable Name="Y" Description="The y portion of the drill." Type="Int" Address="DB200.DBW 7" />
      </Variables>
    </Variable>
    <Variable Name="Point 2" Type="Object">
      <Variables>
        <Variable Name="X" Description="The x portion of the drill." Type="Int" Address="DB200.DBW 9" />
        <Variable Name="Y" Description="The y portion of the drill." Type="Int" Address="DB200.DBW 11" />
      </Variables>
    </Variable>
    <Variable Name="Point 3" Type="Object">
      <Variables>
        <Variable Name="X" Description="The x portion of the drill." Type="Int" Address="DB200.DBW 13" />
        <Variable Name="Y" Description="The y portion of the drill." Type="Int" Address="DB200.DBW 15" />
      </Variables>
    </Variable>
  </Variables>
</Variable>

Usage

It is recommended to use a professional XML editor when editing the configuration file manually. To also benefit from the XML scheme definition mentioned at the end of this article you have to refer to the scheme definition by using the xsi:noNamespaceSchemaLocation attribute in the document root element PluginSettings as follows (the XSD file needs to be placed next to the XML file):

<?xml version="1.0" encoding="utf-8" ?>
<PluginSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:noNamespaceSchemaLocation="CoDaBix.S7DevicePlugin.Settings.xsd">
  <!-- child elements -->
</PluginSettings>

Independent from editing / creating the configuration file manually or automated, the element tree above documented must be fulfilled to produce a valid, well-formed and usable configuration file.

Synchronization

As soon as the plugin is loaded and started by the CoDaBix® Plugin Manager its configuration file is read and synchronized by the plugin with the appropriate CoDaBix® entities.

In case the configuration file changes the plugin manager notifies the plugin. Through this notification the plugin restarts and uses the latest configuration changes on startup.

NOT YET IMPLEMENTED In case the configuration entities change the plugin automatically handles the concomitant event and hereby synchronizes its own configuration file with the changes.

Example Configuration File

CoDaBix.S7DevicePlugin.Settings.xml
<?xml version="1.0" encoding="utf-8"?>
<PluginSettings>
  <S7Device>
    <Channels>
      <Channel Name="Line Controller">
        <Settings Address="192.168.0.80" ChannelType="OperationPanel" DeviceType="S7400" />
        <Variables>
          <Variable Name="Active Job Name" Type="String" Address="DB100.DBB 0" Length="64" />
          <Variable Name="Active Job Number" Type="String" Address="DB100.DBB 80" Length="8" />
          <Variable Name="Active Rotations" Type="DInt" Address="DB101.DBD 0" />
          <Variable Name="Mill Job No. 1" Description="Identifies the mill job no. 1" Type="Object">
            <Variables>
              <Variable Name="Rotations" Type="DInt" Address="DB200.DBD 0" />
              <Variable Name="Use Colling" Type="Bool" Address="DB200.DBX 4.0" />
              <Variable Name="Use Fan" Type="Bool" Address="DB200.DBX 4.1" />
              <Variable Name="Point 1" Type="Object">
                <Variables>
                  <Variable Name="X" Description="The x portion of the drill." Type="Int" Address="DB200.DBW 5" />
                  <Variable Name="Y" Description="The y portion of the drill." Type="Int" Address="DB200.DBW 7" />
                </Variables>
              </Variable>
              <Variable Name="Point 2" Type="Object">
                <Variables>
                  <Variable Name="X" Description="The x portion of the drill." Type="Int" Address="DB200.DBW 9" />
                  <Variable Name="Y" Description="The y portion of the drill." Type="Int" Address="DB200.DBW 11" />
                </Variables>
              </Variable>
              <Variable Name="Point 3" Type="Object">
                <Variables>
                  <Variable Name="X" Description="The x portion of the drill." Type="Int" Address="DB200.DBW 13" />
                  <Variable Name="Y" Description="The y portion of the drill." Type="Int" Address="DB200.DBW 15" />
                </Variables>
              </Variable>
            </Variables>
          </Variable>
        </Variables>
      </Channel>
    </Channels>
  </S7Device>
</PluginSettings>

Example Configuration Scheme File

CoDaBix.S7DevicePlugin.Settings.xsd
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="CoDaBix.S7DevicePlugin.Settings"
           elementFormDefault="qualified"
           xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:simpleType name="Guid">
    <xs:restriction base="xs:string">
      <xs:pattern value="([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})|(\{[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\})"/>
    </xs:restriction>
  </xs:simpleType>
 
  <xs:simpleType name="PlcAddress">
    <xs:restriction base="xs:string">
      <xs:pattern value="^[ \t]*((DB[ \t]*([\d]+)[ \t]*\.[ \t]*(DB))|(((Z|C)|DB|M|(E|I)|L|(A|Q)|(PE|PI)|(PA|PQ)|T)))[ \t]*((X|B|W|D))?[ \t]*([\d]+)(\.([\d]+))?\b" />
    </xs:restriction>
  </xs:simpleType>
 
  <xs:simpleType name="SettingsChangeTypeEnumType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="None" />
      <xs:enumeration value="Created" />
      <xs:enumeration value="Updated" />
      <xs:enumeration value="Deleted" />
    </xs:restriction>
  </xs:simpleType>
 
  <xs:simpleType name="VariableEnumType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Bool" />
      <xs:enumeration value="Byte" />
      <xs:enumeration value="Char" />
      <xs:enumeration value="Int" />
      <xs:enumeration value="Word" />
      <xs:enumeration value="DInt" />
      <xs:enumeration value="DWord" />
      <xs:enumeration value="Real" />
      <xs:enumeration value="Double" />
      <xs:enumeration value="Date" />
      <xs:enumeration value="Time" />
      <xs:enumeration value="TimeOfDay" />
      <xs:enumeration value="S5Time" />
      <xs:enumeration value="DateTime" />
      <xs:enumeration value="String" />
    </xs:restriction>
  </xs:simpleType>
 
  <xs:complexType name="VariableType">
    <xs:sequence>
      <xs:element name="Variables" type="VariablesType" minOccurs="0" maxOccurs="1" />
    </xs:sequence>
 
    <xs:attribute name="Identifier" type="Guid" use="required" />
    <xs:attribute name="Name" type="xs:string" use="required" />
    <xs:attribute name="Description" type="xs:string" use="optional" />
    <xs:attribute name="Address" type="PlcAddress" use="optional" />
    <xs:attribute name="Type" type="VariableEnumType" use="required" />
    <xs:attribute name="Length" type="xs:integer" use="optional" default="-1" />
    <xs:attribute name="ChangeType" type="SettingsChangeTypeEnumType" use="optional" />
  </xs:complexType>
 
  <xs:complexType name="VariablesType">
    <xs:sequence>
      <xs:element name="Variable" type="VariableType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
 
  <xs:simpleType name="ChannelDeviceEnumType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Logo" />
      <xs:enumeration value="S7200" />
      <xs:enumeration value="S7300" />
      <xs:enumeration value="S7400" />
      <xs:enumeration value="S71200" />
      <xs:enumeration value="S71500" />
    </xs:restriction>
  </xs:simpleType>
 
  <xs:simpleType name="ChannelEnumType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="OperationPanel" />
      <xs:enumeration value="ProgrammerDevice" />
      <xs:enumeration value="Other" />
    </xs:restriction>
  </xs:simpleType>
 
  <xs:complexType name="ChannelSettingsType">
    <xs:attribute name="Address" type="xs:string" use="required" />
    <xs:attribute name="Rack" type="xs:integer" use="optional" default="0" />
    <xs:attribute name="Slot" type="xs:integer" use="optional" default="2" />
    <xs:attribute name="ChannelType" type="ChannelEnumType" use="optional" default="OperationPanel" />
    <xs:attribute name="DeviceType" type="ChannelDeviceEnumType" use="optional" default="S7300" />
    <xs:attribute name="ChangeType" type="SettingsChangeTypeEnumType" use="optional" />
  </xs:complexType>
 
  <xs:complexType name="ChannelType">
    <xs:sequence>
      <xs:element name="Settings" type="ChannelSettingsType" minOccurs="0" maxOccurs="1" />
      <xs:element name="Variables" type="VariablesType" minOccurs="0" maxOccurs="1" />
    </xs:sequence>
 
    <xs:attribute name="Identifier" type="Guid" use="required" />
    <xs:attribute name="Name" type="xs:string" use="required" />
    <xs:attribute name="ChangeType" type="SettingsChangeTypeEnumType" use="optional" />
  </xs:complexType>
 
  <xs:complexType name="ChannelsType">
    <xs:sequence>
      <xs:element name="Channel" type="ChannelType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
 
  <xs:complexType name="DeviceType">
    <xs:sequence>
      <xs:element name="Channels" type="ChannelsType" minOccurs="0" maxOccurs="1" />
    </xs:sequence>
  </xs:complexType>
 
  <xs:complexType name="PluginSettingsType">
    <xs:sequence>
      <xs:element name="S7Device" type="DeviceType" minOccurs="0" maxOccurs="1" />
    </xs:sequence>
  </xs:complexType>
 
  <xs:element name="PluginSettings" type="PluginSettingsType" />
</xs:schema>
The S7 Device Plugin provides different status information depending on the layer to inspect. In general the channel based diagnostic information is produced by the connection status of the channel to the S7 PLC. The variable based diagnostic information is produced during the read / write access of the different variables.

Channel

To monitor and diagnose the status of the different device channels take a look at the following image:

CoDaBix® - Channel Status

The image above depicts the channel's Status Node which displays all status relevant information. The following datapoint Nodes are used to uphold the communication status between CoDaBix® and the S7 PLC:

Node Description
Code Defines the numeric expression / identifier of the status.
Category Classifies the status into Information, Warning and Error and therefore indicates the general type of status information.
Severity Rates the status information into Low, Moderate, High and Critical and therefore indicates the urgency of an intervention.
Text Describes the status information identified by the Code property.

Variables

To monitor and diagnose the status of the different S7 variables take a look at the variable's Status Code property displayed in CoDaBix®.
In case the Status Code column displays the value Bad in most cases the addressed data area is not accessible.

CaDaBix® - Variable Status

Log File

All device channel related status information is also logged into the channel-specific log file stored in the [LoggingFolder]. Each log file is named in the naming scheme S7 TCP-IP Device.<ChannelName>.log. The content of such a log file can look as follows:

...
[15:31:46 05.09.2016] - Error (Severity=High): Code=[-6], Text=[The specified CPU could not be found.]
...

Using the sample channel the name of the log file would be: S7 TCP-IP Device.Line Controller.log

Status Codes

The following table displays the different status information possible:

Code Category Severity Text
-88 Error High The operation has been canceled.
-34 Error High The requested PLC block could not be found.
-33 Error High The PLC does not support bit based operations.
-32 Error High The PLC supplied truncated data.
-31 Error High The requested PLC or PC type of data can not be transformed from one to the other.
-30 Error High The requested PLC or PC type of data is not available.
-21 Error High A connection to the device has already been established.
-20 Error High The size of the supplied buffer is lower than the amount of data available.
-11 Error High The type or format of data supplied is not supported.
-10 Error High The supplied access mode is not supported or unknown.
-9 Error High The operation failed upon a value range error.
-8 Error High Failed to allocate required memory.
-7 Error High The operation failed upon a socket error.
-6 Error High The specified CPU could not be found.
-5 Error High A general error occurred.
-2 Error High The necessary memory could not be allocated (out of memory).
-1 Error High The operation has timed out.
0 Information Moderate The operation completed without any kind of error.
1 Information Moderate The operation completed successfully.
2 Information Moderate The addressed data area does not exist.
As each device plugin the S7 device plugin extends the basic CoDaBix® Device Model.

Device

The plugin's device type S7Device also defines the S7DeviceChannel and therefore extends the basic CodabixDevice and CodabixDeviceChannel entities. While the S7Device just represents a concretization of the CodabixDevice, the S7DeviceChannel extends the CodabixDeviceChannel with the S7 Variable Entities.

Channel

Each channel is handled by a Channel Worker which establishes a physical connection to the S7 device. For diagnostic purposes, the worker automatically reads the PLC address “MB 0” every 10 seconds to update the status code of the Channel and description to detect connection failures.

By default, the worker does not read any values. When a client or plugin requests a synchronous Read of the Channel variables in CoDaBix® (e.g. using the CoDaBix® Web Configuration's function “Read actual value”), the channel worker reads them from the underlying S7 device and then writes them into the corresponding CoDaBix® Nodes.

Similarly, when a Client or plugin writes values into the channel's variables, the channel worker will write those values to the underlying S7 device. Note: After the values have been written into the CoDaBix® Nodes, they will still contain the old values until the channel worker has read the variables back from the S7 device.

To have an S7 variable being read steadily, you can edit the Node in the Configuration Web GUI and set “History Options” to Yes (which will create an internal subscription), or you can use e.g. a OPC UA Client connected to the OPC UA Server plugin and create a subscription for the S7 variable Nodes. In these cases, the channel worker reads the variables from the S7 at a regular interval and, if the value of one of the variables has changed, writes the new value into the corresponding CoDaBix® Node.

Variable

Each S7 variable can access the same PLC memory using the same PLC address operand. However, its interpretation depends on the PLC Data Type selection. Supported variable formats are scalar, array and object variables. Variables of the type Object can own further variables and are defined as UserDefinedTypes (UDT in STEP7).

Folders

Content Path Usage
AssemblyFolder <CodabixInstallDir>\plugins\S7DevicePlugin\ Contains the plugin's assembly file.
ConfigFolder <CodabixDataDir>\plugins\S7DevicePlugin\ Contains the plugin's configuration file.
LoggingFolder <CodabixDataDir>\log\ Contains the plugin's log files.

Files

Type Path Usage
Assembly [AssemblyFolder]\CoDaBix.S7DevicePlugin.dll The plugin's assembly file.
Config App <CodabixInstallDir>\CoDaBix.S7DevicePlugin.Configurator.exe The config application file.
Config File [ConfigFolder]\CoDaBix.S7DevicePlugin.Settings.xml The config file.
Logging [LoggingFolder]\S7 TCP-IP Device.<ChannelName>.log The log file.

This Document

Date 2016-12-21
Version 1.1

Plugin

Name S7 Device Plugin
Node /System/Devices/S7 TCP-IP Device
Version 1.0.6

Assembly

Name CoDaBix.S7DevicePlugin.dll
Date 2017-04-28
Version 1.0.6.0