This block is used to source raw data from any number of EGD exchanges and transform the data into flat JSON format. Its configuration fields are as follows:
Field | Type | Required | Default |
---|
transport_addr | String | yes | |
data_map | Object | yes | |
log_level | String | | 'off' |
log_name | String | | |
egress |
Object |
no |
|
- 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>}
]
}
The format for EGD Node Reference is
production_id/exchange_id/sig_major/sig_minor. The Data Map Objects
have the following fields:
Field |
Type |
Required |
alias |
String |
yes |
bit_offset |
Integer |
yes |
type |
String |
yes |
- 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'
- 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.
- Egress (
egress
)
- Used to change the EGD output or egress formats.
Field |
Type |
Applicable to |
Default |
Description |
Output Format |
String |
|
flat_json |
Format of the JSON file output by the adapter into other
blocks. Valid entries: |
Batch Interval |
Integer |
|
30 seconds |
Amount of time (in milliseconds) the batcher will hold or
accumulate data before generating a message. Upon sending
data, the internal state is reset and emptied. |
Maximum Number of Datapoints |
Integer |
|
1 |
The maximum number of data values the batcher will hold,
per tag, over a batching interval. This functions as a very
simple filtering step that helps control CPU usage. |
Attributes |
String |
time_series |
empty block |
Attributes are dependent on the Output Format
value. |
Timestamp From |
String |
|
source |
Configures how the output timestamp values are set. Valid
entries:
- host (the adapter will use the local time in its
output)
- source (the adapter will use the timestamp from the
EGDsource in its output, unless that time is 0, in
which case it will use the local time)
|
Flat_json Output Example:
-
"egress": {
"output_format": "flat_json",
"timestamp_from": 1
}
- Time_series Output Example:
"egress": {
"output_format": "time_series",
"batch_interval": 30000,
"max_num_datapoints": 1,
"attributes": {},
"timestamp_from": 1
}
Example Output Data (Flat
JSON){
"timestamp": "1504739531776",
"data": {
"temperature": {
"val": 15,
"type": "int16"
},
"pressure": {
"val": 16.2,
"type": "float"
}
}
}
Example EGD Flat Config
Block"egd_source_block": {
"type": "egdflat",
"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"
}
]
},
"log_level": "info",
"log_name": "egd_source_flat",
"options": {
"foo": "bar"
}
}
}