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.