Details about the S7 driver

This chapter is intended for advanced WinCC OA users. It describes in detail the debug possibilities, error codes of the ACCON-AGLink and provides detailed information on the S7 driver.

Debug levels

In order to detect possible sources of error during the driver actions the command line options can be used for debugging. Use -helpdbg to view more information on all other options (see also Manager options).

Debug level Description
-dbg 2 Describes in detail what the driver does at the moment. It is recommended to set this option only when the driver load is low in order to not to influence the time behavior of the driver.
-dbg 10 Job number information of the S7 driver.
-dbg 11 Poll group building information.
-dbg 12 S7 connection information.
-dbg 25 Debug outputs of "low level" functions and of the data of internal data structures (e.g. in case of an error coming from ACCON-AGLink the detailed error number and constant name).
-dbg 26 Debug outputs of read/write data traffic at "single query" and "write" requests.
-dbg 27 Debug outputs of spontaneous data and alive checks.
-dbg conn Debug output of switching information and opStates for all connection when a PLC changes its state (only inside a 2x2 redundant system).

Transformations

A transformation converts hardware data into a WinCC OA format. The transformation type of a datapoint element can be queried or set with the aid of the integer constants. If you use dpGet() or dpSet() you have to use the attribute _address.._datatype. For detailed information on the integer constants, used for transformations with the S7 driver, see chapter _address in the appendix.

Error messages

ACCON-AGLink provides a lot of error codes if an operation fails. They can be used by the driver and passed to the WinCC OA log viewer. The following errors are the most important ones. The error text will be written to the WinCC OA log file (and to the Log Viewer), the ACCON-AGLink constant and the value will be written to the driver log file (and to the Log Viewer) if debug level "-dbg 25" is activated.

Constant in ACCON-AGLink Value Hexadecimal Value Error text
AGL40_SUCCESS 0 0 No error.
AGL40_PENDING 1 1 Request is pending.
AGL40_PARAMETER_ERROR -1048575

-FFFFF

Parameter range error.
AGL40_INVALID_DEV_NUMBER -1048574

-FFFFE

Referred Device is not properly opened.
AGL40_DEVICE_OPEN -1048570

-FFFFA

Device already in use; it cannot be opened.
AGL40_DEVICE_NOT_OPEN -1048569

-FFFF9

Device is not open.
AGL40_INVALID_JOB -1048567

-FFFF7

Invalid job number used.
AGL40_NO_QUEUE -720896

-B0000

No space left in the order queue.
AGL40_NOT_CONNECTED -720894

-AFFFE

PLC is not connected.
AGL40_CONNECTION_CLOSED -720893

-AFFFD

Connection has been closed.
AGL40_TIMEOUT -720892

-AFFFC

No data from PLC.
AGL40_PLC_MEMORY_ERROR -720890

-AFFFA

The requested memory could not be allocated.
AGL40_WRONG_OP_STATE -720889

-AFFF9

Wrong operating state of PLC.
AGL40_WRONG_ADDRESS -720888

-AFFF8

Wrong address in PLC.
AG_LINK_ERROR -720877

-AFFED

If the wrong slot was specified for the cpu.

Under Linux this error message has another meaning:

AGL40_UNKNOWN_PLC_ERROR

if the driver cannot establish a connection to the PLC anymore.

AGL40_HARDWARE_ERROR -720876

-AFFEC

PLC hardware error.
AGL40_PLC_NOT_FOUND -720868

-AFFE4

PLC not found.
Note:

Following error message inside the LogViewer states that no PLC has been found while trying to establish a new connection:

WCCOAs7 (1), 2012.04.20 10:25:35.496, SYS, SEVERE, 13/s7, Allgemeiner AGLink-Fehler (0xfff5001c) für s7(1/1)
WCCOAs7 (1), 2012.04.20 10:25:35.496, SYS, SEVERE, 13/s7, Allgemeiner AGLink-Fehler (0xfff5001c) für s7(1/2)

Polling

The S7 driver may not start a read request for every single WinCC OA address for which the type is "input" and "polling". This would lead to a very bad performance. The PLC tags that should be polled are grouped by the driver according to the entry MaxGap in the config file and according to the poll groups they belong to.

ACCON-AGLink supports asynchronous read requests. This means a read job can be started and the driver does not have to wait for the result of this job. There will be a callback when it has been finished or it has failed.

As it makes sense to parallelize requests for the PLC, there will be one queue for write requests (they have to be sent to the PLC as soon as possible) and two queues for read requests. The connections for these queues will be automatically set up by the driver.

If the config entry UseConnections is activated, only one link is used for reading and writing. The latter case might be better for old S7-300 equipment, which are very limited in available connections.

Polling on Use

"Polling on Use" means that values are then polled from the peripherals only when the values are used, for example when a user interface has to display the values or when a Ctrl-Manager is connected to that value. "Polling on use" leads to a reduction of the communication load between PLC and driver. Refer to driver specific functions - poll on use for further information.

Notes and restrictions

Amount of the poll addresses

In order to take full advantage of "Polling on Use", the amount of the permanent poll addresses should be much smaller than the amount of the addresses using "poll on use". A ratio of smaller than 1:10 is recommended. Since the Simatic driver optimizes the polling queries (The polling queries are organized in so-called poll group blocks for which the MaxGap parameter controls the amount of empty bytes between polled values, so that the related block is not interrupted), the total polling blocks are either active or inactive. As long as one address is required, the entire block is queried. In case that the poll group blocks are getting too big, and / or the ratio between cyclic polled addresses and addresses using "Polling on Use" is bigger that 1:10, "Polling on Use" does not show significant performance benefits.

Note:
Please also note that the value for [s7] MaxGap should not be too large as large values result in less optimal blocks.

Large poll blocks

To achieve an optimal configuration for using "Polling on Use", the config entry maxPollBlockSize can be used to limit the size of poll block groups. This will prevent that too many addresses will be used inside of one block which would cause a high number of read requests for the larger blocks even though only few values of the group are needed.

Supported CPUs for S7 symbolic addresses

Following list contains all processors that are supported for using the S7 symbolic addresses with the WinCC OA S7 driver.