[s7]

Settings for the S7 driver

[s7] AliveInterval

Type
unsigned
Default
30
Range
0..65535
Interval [s] after which a status check is sent to the PLC(s) via all connections. If the AliveInterval is set to 0, then no regular alive checks are done. But there is at least one alive check whenever a connection is established.

[s7] AutoGQ

Type
string
Default
Y
Range
Y/N
Specifies whether general queries should be executed automatically.

[s7] AutoTimeSyncFactor

Type
unsigned
Default
0
Range
0..x
The value specifies in which alive intervals an automatic time synchronization should be executed. The default value is 0. This means no automatic synchronization. When the alive interval is e.g. 10 seconds and the AutoTimeSyncFactor = 10, a time synchronization is executed every 100 seconds.

[s7] CheckPollReqPending

Type
bool
Default
1
Range
0|1
If the entry is activated, the system checks if an identical poll request is pending before the new is added to the AGLink Queue.

[s7] diagnosticsRefreshTime

Type
unsigned
Default
60 [sec]
Interval [s] for updating diagnostic data. If the value is set to 0 no diagnostic data are read.

[s7] HighPrioBlock

Type
int
Default
-1
Range
>-1
Data block number of high priority addresses. If a write request with an address belonging to this block is queued, it is inserted in front of the first request with normal priority.

[s7] LimitedTSPPAliveCheck

Type
string
Default
N
Range
Y|N
The config entry LimitedTSPPAliveCheck = "Yes" can be used to switch off the alive check for redundant TSPP connections. Therefore, the system only checks if telegrams are received by one connection (and not all connections).

[s7] MaxAGLinkQueueSize

Type
int
Default
1
Range
1..32
Maximum number of request queued to AGLink library. If this value is exceeded the request is put into an internal read or write queue. If the value is 0 no internal queue is used = old behavior before implementation of internal queues.

[s7] MaxGap

Type
unsigned
Default
10
Range
1..50
The maximum difference in bytes between two addresses before the data is grouped to polling requests. If the address range between two addresses that are next to each other is greater than the value in MaxGap, a new group is created. (e.g. parameterization of the addresses 1.100, 1.101, 1.102, 1.103, 1.115, 1.116 would group the addresses into two polling requests. The default value is 10.) This config entry only applies to input addresses.

[s7] maxPollBlockSize

Type
uint
Default
65535
Range
32..65535
The maximum size of poll blocks used for the optimization (in bytes). This entry is used for the "Poll on use" mode to limit the size of single poll blocks. This will prevent the existence of too large blocks which will reduce the efficiency of the "Poll on Use" feature.

[s7] MaxReadRequestSize

Type
int
Default
0
Range
0,1, >50
Due to poll optimization a multibyte data item (e.g. word or double word) may be read in two subsequent low level read requests. However, in some rare cases this might cause a wrong intermediate result. This can be avoided by adjusting the poll optimization to the PLC maximum PDU size. 0...full optimization, default behavior 1...adjustment of poll optimization to PLC maximum PDU size >50...adjustment of poll optimization to an explicit defined size Note This adjustment causes a slightly degradation of data throughput, since the poll optimization is limited which means that there might be more low level read requests necessary to read the same amount of data.

[s7] MaxRequestQueueSize

Type
int
Default
200
Range
0..1000
Maximum size of internal write and read queue (each queue can have this size). If the write or read queue is full the request is discarded and an error message (the error code 56) is written to the _S7_Conn.LastError DPE. Furthermore Read-, Write- and AGLink queue sizes can be supervised using _S7_Conn.State.ReadQueue and _S7_Conn.State.AGLinkQueue DPEs.

Note:
The new values are written to DPE in the interval defined by "StatCheckInterval" config entry.

[s7] MaxTsppAnswerListSize

Type
int
Default
200
Specifies the maximum size of the TSPP answer list. If the value is exceeded, data is deleted and an error message is shown.

[s7] MaxTsppRequestQueue

Type
unsigned
Default
4
Range
1..64
Number of requests in queue for asynchronuos communication. This is used for test purposes only.

[s7] MaxTsppVcPerLoop

Type
int
Default
1000
Specifies the maximum value changes per driver cycle. If the value is exceeded, the next value changes are processed in the next driver cycle.

[s7] MaxWriteBlockLen

Type
int
Default
0
Range
0..240
Write requests can be sent as a block if the addresses are in consecutive order and there are no "holes". The default value of the entry is 0. This means that the requests are not sent as a block. To be sure that the consecutive addresses are sent as block, the corresponding datapoints must be set via dpSet(). For example the writes of addresses:

DB10.DBW0
DB10.DBB3
DB10.DBX4.0
DB10.DBX4.1
DB10.DBX4.2
DB10.DBX4.3
DB10.DBX4.4
DB10.DBX4.5
DB10.DBX4.6
DB10.DBX4.7
are sent as a block, because the addresses are in consecutive order (there is no hole). If e.g. the last bit is missing only the first 2 addresses are sent as block and the bits are sent individually, because the last byte is not full. The maximumWriteBlockLen depends on the used PLC type. If the value is below 240 bytes, you can be sure that the generated request is not split by the used S7 communication library.

[s7] MaxWriteGroupSize

Type
int
Default
16
Range
1..64
Maximum size of single write request, that can be grouped together in one multiple write request, when processing request from the write request queue.

[s7] mpiDevice

Type
{serial interface} {pc address} {Baudrate}

mpiDevice = <serial interface> <pc address> <baud rate>
The config entry defines the parameters for one serial interface/adapter. To communicate with a PLC, define the MPI device in the config file as follows:

mpiDevice = "COM1" 15 38400
In this case a Siemens adapter is connected to COM1 and 15 should be used as an MPI address for the adapter. The entry of the COM port in the parameterization panel must match the device defined in the config file.

Note:
The MPI address and the PLC address must not equal! Set the MPI address of the adapter. For example, if the MPI address of the PLC is "5" then it is not allowed to set the address of the adapter also to "5". So the following config entry is for this example not allowed:

mpiDevice = "COM1" 5 38400

[s7] onlyActivePolls

Type
string
Default
N
Range
Y/N
onlyActivePolls = "Y" specifies that only the active driver polls in a redundant system. The default value is "N" (both drivers poll the PLC).

[s7] plcCodePage

Type
string
Default
<langgt;.iso88591

If strings in the PLC are encoded with a specific language encoding, this config entry can be used to define the base encoding for the conversion to UTF-8.

All valid encoding values for this config entry can be found in the file <Install Directory>/nls/lang.dir.

Example

[s7]
plcCodePage = "el_GR.iso88597"

[s7] ReadOpState

Type
uint
Default
15
Range
>=0
With this entry one can specify if the operation state of the PLC shall be read and also in with interval. The value 0 means no reading of operation state. A periodic reading in the specified interval is only done if the event-triggered operation state delivery mechanism is not supported by the PLC. The event-triggered mechanism is preferred, because it allows a faster operation state change detection. The actual operation state is indicated on the internal datapoint _S7_Conn.OpState and it is also used for switching in a redundant PLC.

The different states are:

  • 0 STOP
  • 1 START-UP
  • 2 RUN
  • 3 UNDEFINED
For a redundant PLC there are the additional states:
  • 8 RUN SOLO (one PLC is running)
  • 9 RUN REDU (both PLCs are running)
  • 10 HALT
  • 11 CONNECTING
  • 12 UPDATING
Note: This config entry is not supported when using symbolic addresses.

[s7] ReadPLCTime

Type
string
Default
N
Range
Y/N
If the config entry ReadPLCTime is set to "Yes" (Default "No") the PLC time is read in the alive check interval and the value is written to the _S7_Conn.Time.Value. DPE. This value can be used if the WinCC OA time should be synchronised to the PLC time.

[s7] reduModeTSPP

Type
bool
Default
0
Range
0|1
Defines which TSPP telegrams are processed, when using redundant PLCs / Connections: 0 => Only telegrams from the active connection are used 1 => Telegrams from all connections are used. 2 => Telegrams from all connections are used, but duplicate telegrams are filtered out.

[s7] refreshPollBlocksOnUse

Type
string
Default
N
Range
Y|N
If this config entry is set to "Y", the driver calculates the poll blocks new as required and takes into account only the currently required input addresses. In case of "Poll on Use" this results in a considerable optimization. For low-performance S7 controllers in addition, the config entry "maxGap" should be set to a low value, e.g. 1, in order to further reduce the communication load.

[s7] setInvalidForConnLoss

Type
uint
Default
1
Range
0 - 2
Using this config entry, the values sent by the driver can be set invalid when a connection loss occurs. Optional the timestamp can be set to the time of the connection loss. Following options are available: 0 => Invalid bit will not be set 1 => Invalid bit will be set (and the timestamp will be changed) 2 => Invalid bit will be set (without changing the timestamp)

[s7] StatCheckInterval

Type
unsigned
Default
20 [sec]
Range
5..100
Interval [s] after which the DPE ".State" of the connection datapoint is updated.

[s7] TimeSyncUTC

Type
string
Default
N
Range
Y/N
With the config entry TimeSyncUTC = "Yes", the driver synchronizes the PLC using the UTC time. If the config entry is not used (or the entry is set to "No"), the driver synchronizes the PLC using the local time.

[s7] UseConnections

Type
int
Default
2
Range
1,2,3
When the first connection to the PLC is established, the driver does not try to establish any further connections. Via the config entry "UseConnections" the driver tries to establish further connections although the first connection is already established. The number of the connections depends on the number of the config entry. The default value is 2.

[s7] useStringLengthInfo

Type
string
Range
Y|N
If this config entry is set to "Y", the driver uses the length information of S7 strings provided by the PLC. In this case you can configure the actual address, because the driver cuts the first two bytes automatically.