70 likes | 250 Views
EtherIP Driver. Kay Kasemir, kasemirk@ornl.gov July 2009. EtherIP. … is an EPICS driver/device support module … allows EPICS records to read/write tags from AllenBradley PLCs via ethernet Control Logix with ENET module Compact Logix also seems to work … works with vxWorks, RTEMS, Linux
E N D
EtherIP Driver Kay Kasemir, kasemirk@ornl.gov July 2009
EtherIP • … is an EPICS driver/device support module • … allows EPICS records to read/write tags from AllenBradley PLCs via ethernet • Control Logix with ENET module • Compact Logix also seems to work • … works with vxWorks, RTEMS, Linux • … is used by SNS, SLAC, … with 100s of PLCs • SNS: Conventional facilities, High-power RF, vacuum, water, personnel protection system, cryogenics, …
Protocol Details • Basic ControlNet-over-Ethernet, EtherNet/IP protocol • Connect to PLC’s ENET module • Read serial number • Route messages to ‘controller’ (the PLC’s CPU) • Allen-Bradley extensions • Read/write public ladder logic ‘tags’ • Combine multiple tag read/write requests into one message
Simple Example Startup File drvEtherIP_init() drvEtherIP_define_PLC("plc1", "160.91.232.217", 0) Record record(ai, ”plc_tag_4") { field(SCAN, "1 second") field(DTYP, "EtherIP") field(INP, ”@plc1 SomeArrayTag[4]") field(PREC, "3") } Record record(ao, ”plc_tag_5") { field(SCAN, ”Passive") field(DTYP, "EtherIP") field(INP, ”@plc1 SomeArrayTag[5] S 1") field(PREC, "3") }
Arrays are preferred • N records connected to N tags “sensor1_current”, “sensor2_current”, “sensor4_voltage”, … • N separate ‘read’ commands Driver tries to combine them into one network request,but still N different ‘reads’ • Better: In ladder logic, create array with alias tags and have records read the array elements “sensor1_current” array[0],“sensor2_current” array[1],“sensor4_voltage” array[2], … • Driver will read array[0…Max] in one ‘read’ • Max = highest requested array element
Output records • Usually SCAN=Passive • When processed, will mark tag to be updated, driver will then ‘write’. • Remaining time, driver reads the tag and updates record on change • This was designed to allow both an IOC and PanelView to access the same tag
Issues • Older ENET firmware would hang for 15 minutes every ~800 days • PLC has buffer of about 500 bytes • Driver will combine pending read/write requests into message of up to 500 bytes for each the ‘request’ and the expected ‘response’, issuing multiple requests of 500 bytes each as needed. • The self-enforced limit of the driver is configurable. Actual limit of the PLC is not known and seems to change with versions. • Best to assume e.g. 450