Waveform¶
Capabilities¶
Capability |
Support |
Comment |
Generate value type - |
Yes by adding |
|
Generate value type - |
By default see conversion |
|
Generate value type - |
See conversion |
|
Generate signal - |
||
Generate signal - |
||
Generate signal - |
||
Generate signal - |
||
Generate signal - |
||
Generate signal - |
||
Generate signal - |
||
Generate signal - |
See documentation |
|
Signal capabilities - |
||
Signal capabilities - |
||
Signal capabilities - |
See documentation |
Examples¶
Concept¶
Waveform is used to create signal given a mathematical function (see capabilities). This value will change with time without any external interaction.
Use-case:
Generate periodic check
Testing configuration
Create dynamic configuration without real data (demonstration)
Conversion rules¶
Internally, all waveforms produce decimal values that are then converted to expected type along following rules :
INTEGER
: values are mathematically rounded (i.e.3.49... and below ==> 3
and3.5 and above ==> 4
)BOOLEAN
: values are first mathematically rounded, then evaluated asfalse
if equals to 0 ortrue
otherwise (i.e.0.4 ==> false
and0.6 ==> true
)TEXT
: values are simply quoted (i.e.3.45 ==> "3.45"
)
Usage¶
Generate a value¶
A value is configured by a owner.waveforms file. An simple example is :
{
"moduleId": "modules.waveforms.waveforms-1",
"waveformConfigurationEntity": {
"min": 0,
"max": 100,
"type": "SINE",
"period": {
"unit": "SECONDS",
"value": 5
}
},
"samplePeriod": {
"unit": "SECONDS",
"value": 1
}
}
Examples¶
Generate error or value¶
Alternate between a value
and an error
this can be done with the optional additionalParameters
see schema at AdditionalConfigurationEntity
chapter for details.
When defined, errors will be generated during errorGenerationDuration
every errorGenerationPeriod
period. If errorGenerationDuration
is greater or equal errorGenerationPeriod
, only errors will be generated.
Note
By default, errors are never generated.