Playback module "playback"
Description
The "playback" module is intended for system and unit testing only. Its use in a production environment is not permitted!
It is used for the temporally accurate generation of data specified within a playback file. It uses the smartCORE’s standard API for channel configuration and can therefore be used not only for testing consuming modules but also for testing the smartCORE itself (e.g., data filtering).
Data generation here is based on complete data blocks, which are defined using a microsecond-precise grid.
Interfaces & Protocols Used
- NONE
JSON Configuration
The following section describes the module’s entire JSON configuration and explains the individual parameters.
The configuration of the channels specified within "channels" can be found in the documentation on uniform channel configuration.
Example Configuration (Typical Minimal Configuration)
{
"module": "playback",
"factory": "playback",
"config":{
"channels:[
{
"channelType": "timestamped",
"name": "Some Speed",
"physicalUnit": "km/h",
"dataType": "float",
"bufferSize": 10,
"cacheSize": 0,
"filter": [
{
"name": "datareduction",
"absTolerance": 0,
"timeoutMs": 10000
}
]
},
{
"channelType": "timestamped",
"name": "Some Revs",
"physicalUnit": "1/min",
"dataType": "float"
},
{
"channelType": "timestamped",
"name": "Some GPS Location",
"dataType": "gpslocation"
},
< More channel specifications >
]
}
}
Example configuration (typical maximum configuration)
{
"module": "playback",
"factory": "playback",
"config":{
"gridUs": 5000,
"decimalSep": ".",
"structureSep": " ",
"fieldSep": ",",
"numCycles": 1,
"exitOnEnd": false,
"exitDelay": 0,
"timebase": "absolute",
"channels:[
< Channel specifications >
]
}
}
Structure of a Playback File
The format of a playback file generally corresponds to that of a CSV file, though (with the exception of '=') freely configurable decimal, structure, and field separators are permitted. However, multiple consecutive separators are NOT allowed to improve the appearance.
If the configuration of all separators is completely missing from the configuration file, automatic detection is performed (regarding compatibility with CSV files exported from Excel, for both English and German localizations).
The time values in the first column of this file are to be interpreted as seconds (optionally fractions of a second, separated by the decimal separator "decimalSep"). All delimiters must be entered correctly or "escaped."
Examples of Playback Files
Time [s];Speed;RPM;GPS Position
0.7;60;1500
1.4;85;;60.123456 18.111222333 123.4
2.8;100;2200
Time [s],Speed,Revs,GPS Location
0.7,60,1500
1.4,85,,60.123456 18.111222333 123.4
2.8,100,2200
Global Module Parameters
| Parameter Name | Required | Data Type | Valid Range | Default | Description |
|---|---|---|---|---|---|
| gridUs | No | INT | 1 - | 5000 (5 ms) | Temporal grid spacing regarding division into data blocks to be generated |
| decimalSep | No | STRING | "." | "." | Decimal separator within floating-point numbers (*) |
| structureSep | No | STRING | " " | " " | Separator to set multiple values of a structure (e.g., GPS location) (*) |
| fieldSep | No | STRING | "," | "," | Separator between multiple channels to be produced simultaneously (*) |
| numCycles | No | INT | -1, 1 - | 1 | For multiple (or, if -1, infinite) repetitions of the playback file |
| exitOnEnd | No | BOOL | false, true | false | Shutdown of the smartCORE after completion of all production cycles |
| exitDelay | No | INT | 1 - | 0 | Delay before shutting down the smartCORE |
| timebase | No | STRING | "absolute", "relative" | "absolute" | Time base for timestamps of produced measurement data ("absolute" for reproducible results) |
| channels | Yes | JSON Array of JSON Objects | see below |
(*) If ALL parameters 'decimalSep', 'structureSep', and 'fieldSep' are undefined, the separators are auto-detected. Furthermore, it is NOT possible to use '=' as a separator.
Configuration of a channel (JSON object within "channels")
This is only an excerpt (see the documentation on uniform channel configuration for more details).
| Parameter Name | Required | Data Type | Valid Range | Default | Description |
|---|---|---|---|---|---|
| name | YES | STRING | Name of the channel | ||
| channelType | YES | STRING | "timestamped", "singlevalue" | Type of the channel | |
| dataType | YES | STRING | see below | Data type of the channel | |
| bufferSize | No | INT | 1 - | 1024 | Buffer size of the created channel |
| physicalUnit | No | STRING | Physical unit |
Supported channel data types 'dataType'
- string (UTF-8 encoded)
- bytearray (HEX-encoded WITHOUT prefix)
- double
- float
- int64, int32, int16, int8
- uint64, uint32, uint16, uint8
- bool
- gpslocation (three float values separated by structure delimiters)
Module Information
| Information | Value |
|---|---|
| Authors | optiMEAS GmbH |
| Since smartCORE | 2.3 |
| Module type | Producer |
| Dependencies | NONE |