Common Industrial Protocol over EtherNet/IP
The goal of this library is to allow the encapsulation of Common Industrial
Protocol (CIP) messages over EtherNet/IP, with little overhead. Its is
intended to operate as an originator for querying a target. The Scrub
module
will contain a few helper functions for performing all the necessary steps
for scaffolding a connection and sending unconnected messages.
Reading from a tag can be summarized by:
- Establishing/openning a session with the PLC
- Requesting a tag from the PLC
iex> {:ok, session} = Scrub.open_session("20.0.0.70")
iex> {:ok, value} = Scrub.read_tag(session,"All_EStops_OK_to_Run")
Reading Structure member - Struct.Member_name[3]
iex> {:ok, session} = Scrub.open_session("20.0.0.70")
iex> {:ok, value} = Scrub.read_tag(session,["Struct", "Member_name", 3])
Reading Bulk Tags - "All_Estops_OK_to_Run" and Struct.Member_name[3]
iex> {:ok, session} = Scrub.open_session("20.0.0.70")
iex> {:ok, value} = Scrub.bulk_read_tags(session,["All_Estops_OK_to_Run", ["Struct", "Member_name", 3]])
$ mix test