Skip to content

Instantly share code, notes, and snippets.

@katsuyoshi
Last active November 10, 2023 16:32
Show Gist options
  • Save katsuyoshi/79c45e446d67aecffaa03684e64fdaba to your computer and use it in GitHub Desktop.
Save katsuyoshi/79c45e446d67aecffaa03684e64fdaba to your computer and use it in GitHub Desktop.
PlcAccess sample
require 'plc_access'
plc = PlcAccess::Protocol::Mitsubishi::McProtocol.new host:"192.168.0.10"
plc["M0"] = true
plc["M0"] # => true
plc["M0", 10] # => [true, false, ..., false]
plc["D0"] = 123
plc["D0"] # => 123
plc["D0", 10] = [0, 1, 2, ..., 9]
plc["D0".."D9"] # => [0, 1, 2, ..., 9]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment