MODBUS Input Limitations
MODBUS Input Limitations
Wildeye has a limitation of configuring a maximum of 13 x 8-byte (64-bit) MODBUS inputs.
However, if the desired data are consecutive registers in the slave device, a recommendation is to use one wildeye modbus input to retrieve consecutive registers (max 8 bytes).
Then a "Calculated Input" to retrieve the desired bits/bytes and reconstruct the original individual registers data.
For example,
Function Code 3 (Read Holding Registers)
Mobus Address 1 = 2 bytes indicating Apartment A's water usage
Mobus Address 2 = 2 bytes indicating Apartment B's water usage
Instead of creating two inputs, we create one input named AptA_B with following configuration:
Modbus Address = 1 and retrieve 32-bit data (4 bytes).
Now we need to split the 32-bit data into two 16-bit data, one which gives value for Apartment A and other for Apartment B water usage.
In Calculated input for Apartment A, we use the following VB formula: Return System.BitConverter.ToInt16(System.BitConverter.GetBytes(System.Convert.ToUInt32(Inputs.AptA_B)), 2)
In Calculated input for Apartment B, we use the following VB formula: Return System.BitConverter.ToInt16(System.BitConverter.GetBytes(System.Convert.ToUInt32(Inputs.AptA_B)), 0)
The above calculation is considering the data sent by sensor is in big endian.
If we need to split 64-bit data and do complicated calculations, following formulas are used retrieve 2 bytes of data each:
Dim Data1 = (System.BitConverter.ToUInt16(System.BitConverter.GetBytes(System.Convert.ToUInt64(Inputs.AptA_B)), 6))
Dim Data2 = (System.BitConverter.ToUInt16(System.BitConverter.GetBytes(System.Convert.ToUInt64(Inputs.AptA_B)), 4))
Dim Data3 = (System.BitConverter.ToUInt16(System.BitConverter.GetBytes(System.Convert.ToUInt64(Inputs.AptA_B)), 2))
Dim Data4 = (System.BitConverter.ToUInt16(System.BitConverter.GetBytes(System.Convert.ToUInt64(Inputs.AptA_B)), 0))
Return (Data1 + * (10^Data2) + Data3 * 65536) + Data4
Please refer VB documentation for the description of the System related APIs