TSPP

This chapter acts as a guide to the "TSPP" tab. This tab provides configuration options for using TSPP with the S7Plus driver.

TSPP is an abbreviation for the Time Stamp Push Protocol and has been initially implemented for the classic S7 driver. A description of the function and basic protocol information can be found under S7 - TSPP.

Figure 1. TSPP configuration tab

General information

Following general notes must be considered when using TSPP:

  • TSPP can only be used to read values from the PLC.
  • For using TSPP no complex data types (arrays) are supported.
  • Configured TSPP addresses use the prefix "@TSPP@."
  • The value of the Timestamp element (see description below) is written to the timestamp of the original config for the configured DPE.

TSPP Data Structure

The overall TSPP buffer data structure must contain an array of TSPP items followed by an EOT (End-of-Transaction) byte, see example below.

Example

EventLog[0..n]
  + EventLog[0]
  - EventLog[1]
    ID
    Timestamp
    Value
  + EventLog[2]
  ...
  + EventLog[n]
  - EOT
  • Each entry of the TSPP buffer items must adhere to the defined TSPP Item Structure as described below.
  • The end of the buffer array or an ID value of 0 (see TSPP Item structure below) is considered as end the transmission and will stop the reading of the buffer items.
  • The value written to EOT contains the active session number on bits 0 and 1 and an indicator for the redundant system on bit 2.

TSPP Item Structure

The TSPP item within the buffer address must contain following structure:

Element Name Data Type in TIA Portal
ID UDInt
Value DWord
Timestamp LDT/Date_and_Time

Example

EventLog
  EventLog[0]
    ID
    Value
    Timestamp
  EventLog[1]
    ID
    Value
    Timestamp
  ...
  EventLog[9]
    ID
    Value
    Timestamp
Figure 2. TSPP Architecture

Redundancy

Following notes must be considered when using TSPP in a redundant project:

  • When activating the config entry "[s7plus] onlyActivePolls" in a redundant system only the active driver will poll from the TSPP buffer. This allows to prevent any problems with possibly limited PLC resources.

Configuration Interface

TSPP configuration

Set TSPP Mode active

Allows to enable/disable the TSPP mode.

Read interval

Defines the interval (in Milliseconds) for reading the specified TSPP buffer of the PLC.

Buffer address configuration

Buffer address

Using the "Select" button the buffer address can be selected.

Figure 3. S7+ symbolic address selection

Time Stamp Push Protocol (TSPP) Version 2

For Time Stamp Push Protocol Version 2 the data structure required within the PLC has been reworked and streamlined which leads to performance improvements and a less complex data structures for TSPP.

TSPP Version 2 can be activated via setting the config entry ../../cfg_doku/all_config_entries.html#s7plus__TsppVersion:

[s7plus]
TsppVersion = 2

By default only version 1 is active to provide backwards compatibility with existing PLC configurations. A transition to version 2 requires a rework of the PLC data to the structure described below.

TSPP Data Structure

The overall TSPP buffer data structure must contain an array of unsigned 64Bit Integers followed by an EOT (End-of-Transaction) byte, see example below.

Depending on the inclusion or exclusion of implicit item entries, the data structure looks different. It is possible to send only implicit, only explicit, or implicit and explicit entries in one transmission.

Implicit items are defined by a single timestamp applied to all items.

Explicit items all have explicitly assigned timestamps.

No Implicit Entries

EventLog[0..n]
 EventLog[0] // Amount of implicit entries = 0
 EventLog[1] // ID_1 and Value_1
 EventLog[2] // TimeStamp_1
 EventLog[3] // ID_2 and Value_2
 EventLog[4] // TimeStamp_2
…
 EventLog[n-1] // ID_n and Value_n
 EventLog[n] // TimeStamp_n
EOT

  • The EventLog array must be of the type unsigned 64Bit Integer.
  • The first entry of the Array defines how many implicit entries follow. In this specific example, EventLog[0] = 0 means that there are no implicit entries.
  • If EventLog [0] is equal to 0 then the following entries always come in pairs to define an item. The first entry of a pair consists of the ID and the Value of the item. The second entry is the timestamp of the item.
  • The end of the buffer array or an ID value of 0 (see TSPP Item structure below) is considered as end the transmission and will stop the reading of the buffer items.
  • The value written to EOT contains the active session number on bits 0 and 1 and an indicator for the redundant system on bit 2.
  • IDs do not have to be in order.

With Implicit Entries

EventLog[0..n]
 EventLog[0] // Amount of Implicit Entries = m
 EventLog[1] // Single timestamp for all implicit entries (TimeStamp_(1-m))
 EventLog[2] // ID_1 and Value_1
 EventLog[3] // ID_2 and Value_2
…
 EventLog[m+1] // ID_m and Value_m
 EventLog[m+2] // ID_m+1 and Value_m+1
 EventLog[m+3] // TimeStamp_m+1
 EventLog[m+4] // ID_m+2 and Value_m+2
 EventLog[m+5] // TimeStamp_m+2
…
 EventLog[n-1] // ID_n and Value_n
 EventLog[n] // TimeStamp_n
EOT

  • The EventLog array must be of the type unsigned 64Bit Integer.
  • The first entry of the Array defines how many implicit entries follow. In this specific example, EventLog[0] = m means that there are m implicit entries.
  • If EventLog [0] != 0 then the following entry EventLog[1] contains a single timestamp which will be applied to all succeeding implicit entries.
  • Starting with EventLog[2] to EventLog[m+1] all entries contain an ID and a Value of an implicit item. The single implicit timestamp is being applied to all of them.
  • Starting with EventLog[m+2] to EventLog[n] all following entries come in pairs to define an explicit item. The first entry of a pair consists of the ID and the Value of the item. The second entry is the timestamp of the item.
  • The end of the buffer array or an ID value of 0 (see TSPP Item structure below) is considered as end the transmission and will stop the reading of the buffer items.
  • The value written to EOT contains the active session number on bits 0 and 1 and an indicator for the redundant system on bit 2.
  • IDs do not have to be in order.

TSPP Array Structure

If an array entry consists of an ID and a value, the first 4 Bytes of the unsigned 64Bit integer define the ID and the last 4 Bytes define the value.

For Example:

EventLog[2] = 4997966434

4997966434 in binary as an unsigned 64Bit Integer looks like this:

00000000 00000000 00000000 00000001 00101001 11100110 11101010 01100010

To get the ID, only the first 4 bytes should be looked at:

00000000 00000000 00000000 00000001 --> ID = 1

To get the value, only the last 4 Bytes should be looked at:

00101001 11100110 11101010 01100010 --> Value = 702999138

So EventLog[2] contains ID = 1 with the corresponding Value = 702999138.

Therefore, the ID and the Value are stored in unsigned 32Bit Integers.

Example for Data Structure with 0 implicit and 5 explicit entries.

Example for Data Structure with 10 implicit and 10 explicit entries.

Internal Datapoint for Buffer Address