Document 7514522

Download Report

Transcript Document 7514522

EtherIP Driver
Kay Kasemir,
[email protected]
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, …
2
Managed by UT-Battelle
for the U.S. Department of Energy
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
3
Managed by UT-Battelle
for the U.S. Department of Energy
Simple Example
Startup File
drvEtherIP_init()
drvEtherIP_define_PLC("plc1", "160.91.232.217", 0)
Record
Record
record(ai, ”plc_tag_4")
record(ao, ”plc_tag_5")
{
{
field(SCAN, "1 second")
field(SCAN, ”Passive")
field(DTYP, "EtherIP")
field(DTYP, "EtherIP")
field(INP, ”@plc1 SomeArrayTag[4]")
field(INP, ”@plc1 SomeArrayTag[5] S 1")
field(PREC, "3")
field(PREC, "3")
}
4
Managed by UT-Battelle
for the U.S. Department of Energy
}
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
5
Managed by UT-Battelle
for the U.S. Department of Energy
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
6
Managed by UT-Battelle
for the U.S. Department of Energy
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
7
Managed by UT-Battelle
for the U.S. Department of Energy