Skip to content

Instantly share code, notes, and snippets.

@atimin
Created October 29, 2011 15:27
Show Gist options
  • Select an option

  • Save atimin/1324589 to your computer and use it in GitHub Desktop.

Select an option

Save atimin/1324589 to your computer and use it in GitHub Desktop.
Pass options from client to slave
require "rmodbus"
ModBus::TCPClient.connect('127.0.0.1',9999) do |cl|
cl.debig = true
cl.with_slave(1) do |sl_1|
sl_1.debug #=> true
end
cl.with_slave(2) do |sl_2|
sl_2.debug = false
sl_2.debug #=> false
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment