Data Simulator Plug-in#

The Data Simulator Plug-in is used primarily during development and testing. It is capable of generating data of all supported data types including arrays and multi-recordset output.

Attention

This plug-in assigns CPU affinity and requires elevated permissions to run correctly. Make sure that you have elevated permissions to execute the EC Protocol Bridge.

Note: Any unknown parameters in a configuration file will simply be ignored.

Data Simulator - Plug-in Level Configuration Parameters#

Four configuration parameters are currently available at the plug-in level: RT thread core affinity, schedule priority, a data generation interval, and row count.

data-sim: dx-core-affinity#

This optional parameter defines the core to which the publisher, subscriber, or both real-time threads will be assigned.

By default, this value is set to 0.

Example:

dx-core-affinity: 1

data-sim: dx-sched-priority#

This optional parameter defines the core real-time thread priority assigned to the publisher, subscriber, or both.

By default, this value is set to 60.

Example:

dx-sched-priority: 60

data-sim: interval-us#

This parameter, when specified, configures the plug-in as a data generator. This parameter also controls the interval, in microseconds, at which the plug-in generates and broadcasts data. This value should not exceed 4,294,967,295 μs. The dataset and its field definitions determine the data fields that are produced. When the value of this parameter is equal to zero, or is not specified, the plug-in will not produce data, but will become a listener and will display the data, received from other plug-in broadcasters, on the console.

Example:

interval-us: 500000

data-sim: dataset-rows#

This optional parameter defines the number of dataset “rows” or “recordsets” that will be produced.

Example:

dataset-rows: 2

Note

Only a few existing plug-ins are designed to receive broadcasts from more than one “row” of data through their listener interface. Currently, only the MQTT and Data Simulator plug-ins are capable of handling multi-row listener inputs.

Data Simulator - Putting it all together#

This section provides a sample configuration snippet. This section also provides the list of example configuration files, which can be used for testing.

Data Simulator Configuration Example#

The following is an example of a simple configuration file that instantiates two Data Simulator plug-ins and exchanges data between first plug-in, which acts as a broadcaster and a second plug-in, which acts as a listener to receive that data and display it on the console.

settings:
log-level: LOG_DEBUG
plugins:
-
  plugin-id: plg-sim
  filename: libplgsim.so
  dataset:
    -
      dataset-id: sim-ds
      dataset-fields:
        -
          datafld-id: fld-int64
          datatype: int64
        -
          datafld-id: fld-uint64
          datatype: uint64
        -
          datafld-id: fld-uint32
          datatype: uint32
  configuration:
    interval-us: 500000
  -
  plugin-id: plg-sim2
  filename: libplgsim.so
  dataset:
    -
      dataset-id: sim-ds2
      listener-dataset-id: sim-ds
  configuration:

Data Simulator - Test Configuration Files#

The following configuration files can be found in /opt/ec-protocol-bridge/config:

  • smoke-test.yaml: Basic configuration to determine whether ec-bridge is functioning properly