## --- "register" configuration style --- ## Measurements ## ## Digital Variables, Discrete Inputs and Coils ## measurement - the (optional) measurement name, defaults to "modbus" ## name - the variable name ## data_type - the (optional) output type, can be BOOL or UINT16 (default) ## address - variable address discrete_inputs = [ { name = "start", address = [0]}, { name = "stop", address = [1]}, { name = "reset", address = [2]}, { name = "emergency_stop", address = [3]}, ] coils = [ { name = "motor1_run", address = [0]}, { name = "motor1_jog", address = [1]}, { name = "motor1_stop", address = [2]}, ] ## Analog Variables, Input Registers and Holding Registers ## measurement - the (optional) measurement name, defaults to "modbus" ## name - the variable name ## byte_order - the ordering of bytes ## |---AB, ABCD - Big Endian ## |---BA, DCBA - Little Endian ## |---BADC - Mid-Big Endian ## |---CDAB - Mid-Little Endian ## data_type - BIT (single bit of a register) ## INT8L, INT8H, UINT8L, UINT8H (low and high byte variants) ## INT16, UINT16, INT32, UINT32, INT64, UINT64, ## FLOAT16-IEEE, FLOAT32-IEEE, FLOAT64-IEEE (IEEE 754 binary representation) ## FIXED, UFIXED (fixed-point representation on input) ## STRING (byte-sequence converted to string) ## bit - (optional) bit of the register, ONLY valid for BIT type ## scale - the final numeric variable representation ## address - variable address holding_registers = [ { name = "power_factor", byte_order = "AB", data_type = "FIXED", scale=0.01, address = [8]}, { name = "voltage", byte_order = "AB", data_type = "FIXED", scale=0.1, address = [0]}, { name = "energy", byte_order = "ABCD", data_type = "FIXED", scale=0.001, address = [5,6]}, { name = "current", byte_order = "ABCD", data_type = "FIXED", scale=0.001, address = [1,2]}, { name = "frequency", byte_order = "AB", data_type = "UFIXED", scale=0.1, address = [7]}, { name = "power", byte_order = "ABCD", data_type = "UFIXED", scale=0.1, address = [3,4]}, { name = "firmware", byte_order = "AB", data_type = "STRING", address = [5, 6, 7, 8, 9, 10, 11, 12]}, ] input_registers = [ { name = "tank_level", byte_order = "AB", data_type = "INT16", scale=1.0, address = [0]}, { name = "tank_ph", byte_order = "AB", data_type = "INT16", scale=1.0, address = [1]}, { name = "pump1_speed", byte_order = "ABCD", data_type = "INT32", scale=1.0, address = [3,4]}, ]