Commit Graph

10 Commits

Author SHA1 Message Date
Jarno Rankinen 7eb75541d3 gh-5 Commenting 2023-02-01 00:04:13 +02:00
Jarno Rankinen f4eb787a10 gh-5 Fetch register data from bus
- 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.
2023-02-01 00:03:47 +02:00
Jarno Rankinen 9f2d4b0c29 gh-5 Register data structure
Created preliminary struct for register data, create hreg slice
based on registers.csv
2023-01-31 23:01:09 +02:00
Jarno Rankinen 1a8cfe891d gh-5 Created registers.csv from Enervent provided xlsx, change csv delimiter to semicolon 2023-01-31 22:57:14 +02:00
Jarno Rankinen c45af6d1dd Tidy up log error output 2023-01-29 23:34:43 +02:00
Jarno Rankinen c16f94c6d4 Closes #9 Update coil values on startup. #10 /api/v1/coils route started 2023-01-29 23:31:21 +02:00
Jarno Rankinen 876123e518 #9 Mutex locking for bus operations 2023-01-29 22:09:37 +02:00
Jarno Rankinen 8143414c39 #9 Function to update all coil values 2023-01-29 21:56:22 +02:00
Jarno Rankinen 3fab63f60f #9 Go: Get single coil 2023-01-29 14:42:03 +02:00
Jarno Rankinen ddfbc4610d Initial steps of go implementation, prime coil data from CSV file 2023-01-28 23:28:37 +02:00