Skip to content

Commit

Permalink
poller implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
aldas committed Feb 8, 2025
1 parent 0263dec commit f883daa
Show file tree
Hide file tree
Showing 40 changed files with 5,796 additions and 636 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ coverage: ## Generate global code coverage report
coverhtml: ## Generate global code coverage report in HTML
./scripts/coverage.sh html;

build-poller: ## build modbus-poller for current machine Arch
@go build -o modbus-poller cmd/modbus-poller/main.go

help: ## Display this help screen
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ go get github.com/aldas/go-modbus-client
* Client (TCP/UDP +RTU) separated from Modbus packets
* Convenience methods to convert register data to/from different data types (with endianess/word order)
* Builders to group multiple fields into request batches
* Poller to request batches request and parse response to field values with long-running process.

## Examples

Expand Down Expand Up @@ -74,6 +75,10 @@ for _, req := range requests {
}
```

### Polling values with long-running process

See simple poller implementation [cmd/modbus-poller/main.go](cmd/modbus-poller/main.go).

### RTU over serial port

RTU examples to interact with serial port can be found from [serial.md](serial.md)
Expand Down
Loading

0 comments on commit f883daa

Please sign in to comment.