Playback module "playback"
Description
THE "playback" MODULE IS SIMPLY A TEST MODULE FOR INTERNAL PURPOSES!
It is used for the time-correct production of data specified within a playback file. It uses the standardized API for channel configuration of the smartCORE and can therefore be used not only for tests of consuming modules but also for tests of the smartCORE itself (e.g. data filtering).
Production is based on complete data blocks, which are defined on the basis of a microsecond-precise grid.
Interfaces & protocols used
- NONE
JSON configuration
The following section describes the entire JSON configuration of the module and explains the individual parameters.
The configuration of the channels specified within "channels" can be found in the documentation for the standardized channel configuration.
Example configuration (typical minimum 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 basically corresponds to that of a CSV file, although (with the exception of '=') freely configurable decimal, structure and field separators are possible. However, several consecutive separators are NOT permitted to improve the appearance.
If the configuration of all separators within the configuration file is completely missing, an autodetection (regarding compatibility with CSV files exported from Excel, both English and German localizations) is carried out.
The time specifications within the first column of this file are to be understood as seconds (optionally fractions of a second, separated by the decimal separator "decimalSep"). All separators must be entered or "escaped" in the correct way.
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 | Meaningful value range | Default | Description |
---|---|---|---|---|---|
gridUs | No | INT | 1 - | 5000 (5 ms) | Time grid spacing with regard to division into data blocks to be produced |
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 several channels to be produced simultaneously (*) |
numCycles | No | INT | -1, 1 - | 1 | for multiple (or at -1 infinite) repetition of the playback file |
exitOnEnd | No | BOOL | false, true | false | Shutting down the smartCORE after all production cycles have been completed |
exitDelay | No | INT | 1 - | 0 | Delay before shutting down the smartCORE |
timebase | No | STRING | "absolute", "relative" | "absolute" | Time base of the time stamps 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. It is also NOT possible to use '=' as a separator.
Configuration of a channel (JSON object within "channels")
This is only an excerpt (see documentation on standardized channel configuration for more details).
Parameter name | Required | Data type | Meaningful value range | Default | Description |
---|---|---|---|---|---|
name | YES | STRING | name of the channel | ||
channelType | YES | STRING | "timestamped", "singlevalue" | Type of 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 coded WITHOUT prefix)
- double
- float
- int64, int32, int16, int8
- uint64, uint32, uint16, uint8
- bool
- gpslocation (three float values separated by structure separators)
Module information
Information | Value |
---|---|
Authors | optiMEAS Measurement and Automation Systems GmbH |
since smartCORE | 2.3 |
Module type | Producer |
Dependencies | NONE |