Skip to content

Commit

Permalink
Convert workaround part to an actual toml section.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven Rebhan committed Jul 23, 2021
1 parent c256bf9 commit 854eb5e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 21 deletions.
19 changes: 9 additions & 10 deletions plugins/inputs/modbus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,6 @@ Registers via Modbus TCP or Modbus RTU/ASCII.
## Trace the connection to the modbus device as debug messages
# trace_connection = false

## Enable workarounds required by some devices to work correctly
# workarounds = {
## Pause between read requests sent to the device. This might be necessary for (slow) serial devices.
# pause_between_requests = "0ms"
## Close the connection after every gather cycle. Usually the plugin closes the connection after a certain
## idle-timeout, however, if you query a device with limited simultaneous connectivity (e.g. serial devices)
## from multiple instances you might want to only stay connected during gather and disconnect afterwards.
# close_connection_after_gather = false
# }

## Measurements
##

Expand Down Expand Up @@ -97,6 +87,15 @@ Registers via Modbus TCP or Modbus RTU/ASCII.
{ 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]},
]

## Enable workarounds required by some devices to work correctly
# [inputs.modbus.workarounds]
## Pause between read requests sent to the device. This might be necessary for (slow) serial devices.
# pause_between_requests = "0ms"
## Close the connection after every gather cycle. Usually the plugin closes the connection after a certain
## idle-timeout, however, if you query a device with limited simultaneous connectivity (e.g. serial devices)
## from multiple instances you might want to only stay connected during gather and disconnect afterwards.
# close_connection_after_gather = false
```

### Metrics
Expand Down
20 changes: 9 additions & 11 deletions plugins/inputs/modbus/modbus.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,6 @@ const sampleConfig = `
## Trace the connection to the modbus device as debug messages
# debug_connection = false
## Enable workarounds required by some devices to work correctly
# workarounds = {
## Pause between read requests sent to the device. This might be necessary for (slow) serial devices.
# pause_between_requests = "0ms"
## Close the connection after every gather cycle. Usually the plugin closes the connection after a certain
## idle-timeout, however, if you query a device with limited simultaneous connectivity (e.g. serial devices)
## from multiple instances you might want to only stay connected during gather and disconnect afterwards.
# close_connection_after_gather = false
# }
## Measurements
##
Expand Down Expand Up @@ -170,6 +159,15 @@ const sampleConfig = `
{ 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]},
]
## Enable workarounds required by some devices to work correctly
# [inputs.modbus.workarounds]
## Pause between read requests sent to the device. This might be necessary for (slow) serial devices.
# pause_between_requests = "0ms"
## Close the connection after every gather cycle. Usually the plugin closes the connection after a certain
## idle-timeout, however, if you query a device with limited simultaneous connectivity (e.g. serial devices)
## from multiple instances you might want to only stay connected during gather and disconnect afterwards.
# close_connection_after_gather = false
`

// SampleConfig returns a basic configuration for the plugin
Expand Down

0 comments on commit 854eb5e

Please sign in to comment.