Skip to main content

Playback module "playback"

Description

warning

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 NameRequiredData TypeValid RangeDefaultDescription
gridUsNoINT1 -5000 (5 ms)Temporal grid spacing regarding division into data blocks to be generated
decimalSepNoSTRING".""."Decimal separator within floating-point numbers (*)
structureSepNoSTRING" "" "Separator to set multiple values of a structure (e.g., GPS location) (*)
fieldSepNoSTRING","","Separator between multiple channels to be produced simultaneously (*)
numCyclesNoINT-1, 1 -1For multiple (or, if -1, infinite) repetitions of the playback file
exitOnEndNoBOOLfalse, truefalseShutdown of the smartCORE after completion of all production cycles
exitDelayNoINT1 -0Delay before shutting down the smartCORE
timebaseNoSTRING"absolute", "relative""absolute"Time base for timestamps of produced measurement data ("absolute" for reproducible results)
channelsYesJSON Array of JSON Objectssee 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 NameRequiredData TypeValid RangeDefaultDescription
nameYESSTRINGName of the channel
channelTypeYESSTRING"timestamped", "singlevalue"Type of the channel
dataTypeYESSTRINGsee belowData type of the channel
bufferSizeNoINT1 -1024Buffer size of the created channel
physicalUnitNoSTRINGPhysical 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

InformationValue
AuthorsoptiMEAS GmbH
Since smartCORE2.3
Module typeProducer
DependenciesNONE