EGD Sink Flat

Type
'egdsinkflat'
This block is used to send EGD data to multiple EGD exchanges. It translates input in the flat JSON format into raw EGD payloads. Its configuration fields are as follows:
FieldTypeRequiredDefault
transport_addrStringyes
data_mapObjectyes
log_levelString'off'
log_nameString
Transport Address (transport_addr)
The host address where EGD messages are expected to be received. It is recommended to keep this field set as "127.0.0.1" unless multicast is used. The transport_addr can be specified as either of the following:
  • "transport_addr":"egd://<ip address>"
  • "transport_addr":"egd://<FQDN>"
Data Map (data_map)
The data_map field determines which EGD exchanges to subscribe to and how to convert their data to flat JSON format. The data_map follows the following format:
"data_map": {
    "<EGD Node Reference>": [
        {<Data Map Object>},
        {<Data Map Object>}
    ],
    "<EGD Node Reference>": [
        {<Data Map Object>},
        {<Data Map Object>}
    ]
}
Where the objects shown above have the following fields:
Field Type Required
alias String yes
bit_offset Integer yes
type String yes
max_length Integer yes if type is 'string'
  • Alias (alias) - The alias field of the data_map determines the name of the requested value that should mean something to the target application. Examples are “temperature”, “pressure”, etc.
  • Bit Offset (bit_offset) - The bit_offset field determines what bit offset into the EGD page to start retrieving the value from. The EGD producer has a described data layout that can be retrieved from a controller or workstation via the EGD HTTP configuration API. Refer to the EGD protocol docs to learn more about the Production Data Unit format.
  • Type (type) - The type field of the data_map defines the type of data to pull from the EGD page. This value will determine how many bytes after the bit_offset are accessed and how to combine the bytes to form the requested type. Its possible values are as follows:
    • 'int8'
    • 'uint8'
    • 'int16'
    • 'uint16'
    • 'int32'
    • 'uint32'
    • 'int64'
    • 'uint64'
    • 'float'
    • 'double'
    • 'string'
    • 'datetime'
    • 'time'
  • Max Length (max_length) - The max_length field specifies the max number of characters a string can contain. It is only required if the type field is 'string'.
Log Level (log_level)
Configures the logger for the EGD client used internally to the block, can be any of the following (case insensitive):
  • off (default)
  • critical
  • err
  • warn
  • info
  • debug
Log Name (log_name)
Used in the log file to associate statements with the block. If omitted, the block name is used for the log name.
Example Input Data (Flat JSON)
{
    "timestamp": "1504739531776",
    "data": {
        "temperature": {
            "val": 15,
            "type": "int16"
        },
        "pressure": {
            "val": 16.2,
            "type": "float"
        }
    }
}
Example EGD Sink Flat Config Block
"egd_sink_block": {
    "type": "egdsinkflat",
    "config": {
        "transport_addr": "egd://localhost",
        "data_map": {
            "4026531967/150/0/0": [
                {
                    "alias": "sine01",
                    "bit_offset": 1056,
                    "type": "double"
                }
            ],
            "5126541937/151/2/1": [
                {
                    "alias": "valve_on",
                    "bit_offset": 8,
                    "type": "int8"
                },
                {
                    "alias": "valve_status",
                    "bit_offset": 16,
                    "type": "string",
                    "max_length": 10
                }
            ]
        },
        "log_level": "info",
        "log_name": "egd_sink_flat",
        "options": {
            "foo": "bar"
        }
    }
}