Generic consumption module "fmconsumer"
Description
The generic consumption module fmconsumer
allows channel data to be consumed, placed in a defined message and then sent via a socket module (such as a ``canbus``` module).
Since the specification of the channels is optional, messages that are constant in time (such as periodic stimulus messages) can also be sent.
The messages are sent either
- once after the specified transmission interval
- Periodically at the specified transmission interval
- event-controlled
An event-controlled dispatch takes place here
- after an event has occurred (and at the earliest after a configurable interval has elapsed)
- after a configurable interval has elapsed, if NO event has occurred by then
An event occurs when a message specified using an identification key (messageKey
) is received by the socket module.
Several messages to be sent can be configured.
Interfaces & protocols used
- NONE
JSON configuration
The following section describes the entire JSON configuration of the module and explains the individual parameters.
Example configuration (typical configuration)
{
"module": "Consumer",
"factory": "fmconsumer",
"config":{
"fmd": "canbus",
"messages":[
{
"messageKey": 42,
"defaultMessage": "0102 03 04ff06",
"sendMode": "OnTimer",
"sendIntervalMs": 1000
}
]
}
}
Global module parameters
parameter name | required | data type | meaningful value range | default value | description |
---|---|---|---|---|---|
fmd | YES | STRING | Name of the module instance of the socket module used | ||
messages | YES | JSON Array of JSON Object | see below | ||
channels | No | JSON Array of JSON Object | see below |
Configuration of messages
Messages are specified as JSON objects, each of these objects can contain the following parameters
parameter name | required | data type | meaningful value range | default value | description |
---|---|---|---|---|---|
messageKey | YES | INT | Unique identification key of the message | ||
defaultMessage | YES | STRING | Hexadecimal coded bytes of the message template (spaces are ignored) | ||
sendMode | YES | STRING | "SingleShot", "OnTimer", "OnTriggerWhenTimeoutElapsed", "OnMissingTriggerWhenTimeoutElapsed" | Message sending mode (one-time, periodic, event-driven) | |
sendIntervalMs | YES | INT | 0 - | Delay/Interval [ms] with regard to message sending | |
triggeringMessageKeys | No | JSON Array of INT | EMPTY JSON Array | Identification key of all event-triggering messages |
Configuration of channels "channels"
Note: Channel data is currently placed one-to-one within the message template,
i.e. the data type ultimately placed corresponds exactly to the source data type of the channel.
In addition, the user must define a sufficiently long message template.
Optionally, it is possible to place a smaller number of bits using the bitLength
(in this case, the right bits are discarded accordingly).
Channels are specified as JSON objects, each of these objects can contain the following parameters
parameter name | required | data type | meaningful value range | default value | description |
---|---|---|---|---|---|
name | YES | STRING | Name of the channel to be consumed | ||
bitOffset | YES | INT | within the message template | Offset regarding placement of the channel within the message template | |
bitLength | YES | INT | so that bitOffset + bitLength is within the message template | length regarding placement of the channel within the message template |
Module information
Information | Value |
---|---|
Authors | optiMEAS Measurement and Automation Systems GmbH |
since smartCORE | 0.110 |
Module type | Consumer |
Dependencies | Socket module with write access (such as canbus ) |