Skip to main content

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 nameRequiredData typeMeaningful value rangeDefaultDescription
gridUsNoINT1 -5000 (5 ms)Time grid spacing with regard to division into data blocks to be produced
decimalSepNoSTRING".""."Decimal separator within floating point numbers (*)
structureSepNoSTRING" "" "Separator to set multiple values of a structure (e.g. GPS location) (*)
fieldSepNoSTRING","","Separator between several channels to be produced simultaneously (*)
numCyclesNoINT-1, 1 -1for multiple (or at -1 infinite) repetition of the playback file
exitOnEndNoBOOLfalse, truefalseShutting down the smartCORE after all production cycles have been completed
exitDelayNoINT1 -0Delay before shutting down the smartCORE
timebaseNoSTRING"absolute", "relative""absolute"Time base of the time stamps 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. 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 nameRequiredData typeMeaningful value rangeDefaultDescription
nameYESSTRINGname of the channel
channelTypeYESSTRING"timestamped", "singlevalue"Type of 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 coded WITHOUT prefix)
  • double
  • float
  • int64, int32, int16, int8
  • uint64, uint32, uint16, uint8
  • bool
  • gpslocation (three float values separated by structure separators)

Module information

InformationValue
AuthorsoptiMEAS Measurement and Automation Systems GmbH
since smartCORE2.3
Module typeProducer
DependenciesNONE