Modbus Flat

Type
'modbusflat'

This block is used to source raw data from multiple ranges of modbus registers and transform the data into flat JSON format.

In addition to the configuration fields found in both Modbus types, Modbus Flat has the interval configuration field.

interval

The interval field determines the interval (in milliseconds) at which the block will poll its endpoint for data.

For example, if this is set to 1000, the block will attempt to get data every second.

Example Output Data (Flat JSON)

{
    "timestamp": "1504739531776",
    "data": {
        "temperature": {
            "val": 15,
            "type": "int16"
        },
        "pressure": {
            "val": 16.2,
            "type": "float"
        }
    }
}
Example Config Block
"modbus_source": {
    "type": "modbusflat",
    "config": {
        "transport_addr": "modbus-tcp://localhost:1502",
        "interval": 1000,
        "data_map": [
            {
                "alias": "valve_on",
                "reg_type": "holding",
                "address": 15,
                "type": "bool",
                "bit_index": 8
            },
            {
                "alias": "valve_status",
                "reg_type": "holding",
                "address": 16,
                "type": "string",
                "count": 15
            }
        ],
        "log_level": "debug",
        "log_name": "modbus_source_flat",
        "options": {
            "slave_id": 0
        }
    }
}