PLC-to-EPICS interface

From GlueXWiki
Revision as of 11:44, 23 April 2011 by Hovanes (Talk | contribs)

Jump to: navigation, search

In order to interface the application which at lower level use Allen-Bradley ControlLogix PLC control system we use ether_ip EPICS river/device support module. This allows us to interface EPICS records to PLC tags using Ethernet connection. On the PLC side the connection is provided by EN2T modules which communicate using through PLC's EtherNet/IP protocol. Overall this method seems to be working, but requires some coordination in the programming and notations to avoid complications when creating EPICS/PLC interfaced applications.


  • Create CSV-file using RS5000 program and run script to generate EPICS database.
    1. The EPICS database is generated by a Perl script, similar to the script we used for solenoid magnet test. The script needs to know what type of variables each PLC hardware module correspond to. This needs to be coordinated between PLC programmer and whoever is building the EPICS database.
    2. It would be good to develop a standard set of notations for PLC modules so that the Perl-script can figure out the type of the variable based on the name of PLC module.
    3. When generating the CSV-file we should make sure that the tags imported from EPICS applications using EtherIP are not included.
    4. Only use DINT and REAL arrays. Other type of arrays are not guaranteed to work at this point, and we should avoid using them when interface PLC and EPICS.
    5. The alarm tag naming convention should be established. This should include how a consistent way of identifying the scope of the alarm tags from the scope of the tag that the alarm refers to.
    6. The Perl-script will not import the alarm tags into EPICS. They need to be included through a separate application/database for alarms manually using developed EPICS templates for PLC alarms.
    7. The Perl-script will also ignore function block tags and other composite tags.
    8. Use a separate set of PLC tags for input and output to EPICS. Using two-way communication using a single pair PV/tag for communication may turn into a problem.
  • Create EPICS alarm database from PLC. In this step we create EPICS records which will set the alarm fields of the corresponding EPICS records.
    1. Manually create a VDCT file similar to how we did it for solenoid test.
    2. Export this VDB-file to a flat EPICS DB-file. EPICS IOC currently do not support expanding VDCT templates, although they may do that in the next EPICS version.
  • The template will be referencing EPICS record already importing through the EtherIP in the previous step. This correponds to the tag for which the alarm fields are being set.