Waveform

Capabilities

:header-rows: 1 :class: capabilities-table

Capability

Support

Comment

Generate value type - text

Supported feature

Yes by adding "" see conversion

Generate value type - integer

Supported feature

By default see conversion

Generate value type - boolean

Supported feature

See conversion

Generate signal - triangular

Supported feature

Generate signal - square

Supported feature

Generate signal - ramp

Supported feature

Generate signal - sawtooth

Supported feature

Generate signal - sine

Supported feature

Generate signal - random discrete or analog

Supported feature

Generate signal - constant

Supported feature

Generate signal - error

Supported feature

See documentation

Signal capabilities - min value

Supported feature

Signal capabilities - max value

Supported feature

Signal capabilities - generate error then value

Supported feature

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 and 3.5 and above ==> 4)

  • BOOLEAN : values are first mathematically rounded, then evaluated as false if equals to 0 or true otherwise (i.e. 0.4 ==> false and 0.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.