Siemens S7 driver
troubleshooting
For Siemens S7 driver troubleshooting, the following sections list common tasks and problems and a list of Siemens S7 driver error codes.

The features and functions available in a node are controlled by the licenses that are installed in the node.
To verify that the Siemens S7 driver license is installed:
- From the Workbench left pane, expand the node whose
license you want to check, and then select the
Administration icon.
- From the Administration window, select the
Licenses tab.
- Select the appropriate license. Details of the
license appear on the tab.
- View the Features column to identify the device driver.
If you do not see the correct license, or if the license is expired, you must request a license from your license key provider.
For information on how to install a license, refer to System Administration > Licenses.

The number of active devices or connections exceed the total active device license count.The server or listener device will reject the connection attempt.
A system generated Alert will be displayed when the number of active device licenses in use exceeds a threshold percentage of the total active device licenses for the node. The Alert is cleared when the usage drops below the threshold percentage. For example, the system is currently using 90% of the available 200 device licenses.
An Exceptions Log message is inserted for the first connection rejection. For example, Device connection rejected due to insufficient device licenses.
For more information, see Licenses.
The device information on the Devices panel for a started server or listener device displays counts on its Attributes sub-tab:
- License In-Use
- License Rejected.

The Siemens S7 driver is not part of this node's installation. The Siemens S7 driver is installed as a package separate from the base product installation.
You may be working with different levels of nodes, each with different levels of support for devices. Ensure that this node is the one with support for Siemens S7 PLCs.
For information on how to add the Siemens S7 driver package, refer to System Administration > Packages.

The Siemens PLC needs to be configured using the Siemens STEP 7 software. The complete description of this configuration is beyond the scope of this documentation.
Ensure that the IP address in the network settings is correctly configured for your network setup. There may be cross subnet issues depending on how the PLCs were configured.
Try using the Ping function on the Workbench Administration panel, Diagnostics tab for your node to see if that level of communication is successful.

The Siemens S7-1200 and S7-1500 have security settings that must be modified to allow deviceWISE access to the PLC. This is accomplished using the STEP 7 software and accessing the properties page for the PLC.

The DB data blocks are not viewable through the Variables window in the Workbench.
The DB data blocks may not be defined on the PLC module.
Use the Siemens STEP 7 software to define these data blocks
in the PLC.
Ensure that the DB data blocks are defined correctly in the
device definition.
If attempting to connect to either a S7-1200 or S7-1500 PLC, ensure that the Optimized Block Access attribute is not selected. This is accomplished using the STEP 7 software and accessing the Attributes page for the Data Block.

During the device start process, the Siemens driver will query the PLC for a list of all of the Data Blocks (DBs) defined on the S7 device. For PLCs where a large number of DBs have been defined, this will require multiple messages between the driver and the PLC. There are times when the driver will timeout waiting for the PLC to respond to this request. The result is the driver will enumerate the DBs that were reported up to the point where the message timeout occurred. To get around this problem make sure the device is in a Stopped state, edit the device, and increase the timeout value to at least 10000 (ten seconds). Save the change and start the device and the full list of DBs should be shown on the Variables panel.

The Siemens driver has the ability to connect to the Siemens Sinumerik 840D. Configuration settings must be made to the Sinumerick 840D to enable communications between the Siemens driver and the Sinumerik. Using the Siemens STEP 7 software to configure the Sinumerik, the TCU support tab on the System Network Center panel must be accessed. The check box with the label "Firewall unblocks external HMI Port TCP/102 is opened via X130" must be checked. This will allow the driver to communicate through port 102 on the Sinumerik. This port will then be displayed as being open in the "Resulting firewall open ports" field on this same page.

A Device Protocol Error is returned when attempting to access (read or write) certain I/Q/M variables.
The maximum I/Q/M variable ranges are defined manually by the user in the device definition. Refer to Siemens S7 device definition for information on how these ranges are defined. If the physical number of I/O points is less than the range specified then a Device Protocol Error will be returned when attempting to access data points outside the physical range.

A Device Protocol Error is returned when attempting to perform array writes on I/Q/M variables.
When writing Boolean data, only a single bit can be written at a time, the variable count must equal 1. If it does not, then the write will fail. Multiple bits can be written one at a time through separate write commands issued to the PLC.

Read failed: A Variable data overflow error is returned.
This is an issue with the manner in which strings are read and written from the PLC memory. When writing a string, the first two bytes of the string holds the string length. These two bytes are written to the first two bytes of the data block on the PLC. When reading back the string through the Siemens S7 driver, the first two bytes are read first to determine the length of the string. If reading a portion of the string from a data point other than the first two bytes, an invalid length may be read resulting in an overflow error.

This is an issue with the manner in which strings are read and written from the PLC memory, and how the Siemens PLC represents strings. This will occur if an attempt is made to write a string that is larger than the maximum size defined in the PLC's variable. When a Siemens device is started, it creates an internal table to hold the maximum sizes for strings on the PLC. It populates this table when a data region is read as a string. From that point on the maximum value defined for that string is honored by the Siemens driver. Attempts to write strings larger than this maximum value will result in the truncation of the string at that point. The user can modify the variable that holds the maximum string length value, but this won't take affect with the Siemens driver until the device is Stopped and then Started.

The Siemens S7-200 Smart PLC in its default configuration only allows one connection at a time. To use the PLC with deviceWISE disconnect the PLC software. To use the PLC software stop the device in deviceWISE.

The Siemens S7-200 Smart PLC only allows writes to Q register when the PLC is in the RUN mode. Check the PLC configuration to first allow writes to the Q register.

This section describes the error codes that you might encounter when using the Siemens S7 driver.
These error codes are available from the Devices window in the Extended Status column. The error codes are also referenced in the Exceptions Log.
When the system experiences an abnormal condition (such as a device failure, disconnect from a controller, or software error), an error code and extended error code are recorded in the Exceptions Log.
In the Devices window, the Status column will always be a generic error code that can tell you if the error is a communication error, a data error, or some other internal device error. The Extended Status column provides the error code from the driver. These error codes can be basic runtime error codes or specific to the Siemens driver.
Status Code | Extended Status code | Error name | Action |
---|---|---|---|
-6417 | 0 | Error Variable Not Writable | The specified variable does not have write access. Please refer to the driver documentation for limitations when accessing certain variable types. |
-6237 | 5 | Device Protocol Error | The specified variable may not be accessible through the device protocol. Please verify using the Siemens STEP 7 Software if the variable is a part of a valid data block defined on the PLC. |
-6237 | -6411 | Error Variable Count Overflow | The driver does not support accessing the specified variable with the specified count. Please read the driver documentation on limitations when accessing certain variable types. |