Jarno Rankinen
f4eb787a10
- goburrow/modbus' ReadHoldingRegisters can only fetch 125 registers at a time, so updateRegisters does several readings - modbus.ReadHoldingRegisters returns a []byte, where each even byte represents the MSB of a int16/uint16 and every odd byte is the LSB - updateRegisters loops through each response slice forming the 16-bit integers Still need to figure out a way to properly handle the signed/unsigned values, and also the enumerations and bitfields. Perhaps changing the 'signed' boolean to a byte and making that a bitfield representing the value type would be a good way to go. The value can then be properly formed when fetching it from the in-memory pingvinKL struct, while being stored as an int(64) internally. |
||
---|---|---|
.. | ||
pingvinKL | ||
coils.csv | ||
go.mod | ||
go.sum | ||
main.go | ||
registers.csv |