Monitoring Commercial Conventional Facilities Control with the APS Control
System - The Metasys-to-EPICS Interface
G.J. Nawrocki, C. L. Seaver, J.B. Kowalkowski
Advanced Photon Source
Argonne National Laboratory

ABSTRACTAs controls needs at the Advanced Photon Source matured from an installation phase to an operational phase, theneed to monitor the existing conventional facilities control system with the EPICS-based accelerator control system
was realized. This existing conventional facilities control network is based on a proprietary system from JohnsonControls called Metasys. Initially read-only monitoring of the Metasys parameters will be provided; however, theability for possible future expansion to full control is available. This paper describes a method of using commerciallyavailable hardware and existing EPICS software as a bridge between the Metasys and EPICS control systems.

THE APS CONVENTIONAL FACILITIES CONTROL SYSTEM
The contractor selected for conventional facilities control was Johnson Controls, an environmental control system
contractor familiar to many institutional and industrial facilities. This control system, called Metasys, is installed
throughout the APS site.
Metasys is a distributed system of intelligent I/O processors, called network control modules (NCM), for control andmonitoring of environmental and HVAC parameters. The data link and physical layer of this distributed system uses
ARCNET for I/O processor intercommunication as well as the link to operator workstations for the human interface.
This ARCNET-based communication path is called the N1 LAN [1]. As with many industrial control systems, thecommunication protocol and software for this system are proprietary to the manufacturer.
It should be noted that the NCM modules themselves have a subnet for communication to smaller distributed I/O control processors. This subnet, called the N2 Bus, is for communication between I/O processors only and does not provide an interface to an operator workstation [1].
The software native to the Metasys control system is called the Metasys Facilities Management System (FMS). The
FMS is configured via the operator workstation, a PC-compatible computer running the Metasys Person MachineInterface (PMI) software. Physical control parameters, such as an individual temperature sensor or the on/off status ofa certain water pump, are mapped to analog or binary Metasys objects. Associated with the Metasys objects areparameters which govern such elements as units (analog objects have single unit parameters, binary objects have twounit parameters, one each for the logical “1” and logical “0” values), display precision (analog only), object status(binary only), and of course the present value of the object [2].
A collection of Metasys objects is referred to as a Metasys system. The entire APS conventional facilities control
system can be viewed as a tree of Metasys system directories containing files representing Metasys objects. The current software release of the Metasys File Management System at the APS allows for a maximum of 50 Metasys objects
per Metasys system.

THE APS ACCELERATOR CONTROL SYSTEM
The accelerator control system at the APS is a distributed, networked system based upon the standards of EPICS [3].
It provides elaborate control and monitoring of all aspects of accelerator operation. Applications written specificallyfor EPICS provide facilities for data acquisition, back up and restoration of accelerator parameters, as well as the handling of alarms generated by the control system.
EPICS provides for VME-based input/output controllers (IOCs) to be distributed throughout the facility and interconnected via Ethernet to one another and also to UNIX-based operator interface (OPI) consoles [3]. This control systemoperates and monitors all functions of accelerator systems such as magnet power supplies, vacuum pumps, and beam
position monitors.
Physical I/O points in EPICS are mapped to “process variables.” Each of these process variables has parameters associated with it which define display and alarm parameters as well as the actual value of the process variable. Theseparameters are called fields. A collection of process variables in EPICS is referred to as a “database.” The database isloaded into the IOC associated with the physical I/O point hardware. Process variable fields are available to otherIOCs and OPIs via a communication protocol called channel access [3].
It is clear that the initial step in interfacing the Johnson Controls Metasys System to EPICS is to provide the requisite
hardware and software links so that the Metasys object parameters could be mapped to EPICS process variable fields.

THE METASYS NETWORK PORTThe Metasys network port is a device which allows monitoring and controlling of the Metasys Facilities Management
System from a third-party computer system. The network port emulates an Allen-Bradley PLC-5 and will exchange
FMS data with a system that communicates with Allen-Bradley PLC-5 Word Range Read, Word Range Write, andRead-Modify-Write commands [2].
The network port must be actively programmed to map Metasys objects to the Allen-Bradley PLC-5 syntax. Up to800 analog Metasys objects may be assigned to the PLC-5 syntax F8:0 - F8:799. Only the present value parameter ofan analog object is available in four-byte analog words. Up to 3200 binary Metasys objects may be assigned to thePLC-5 syntax B3:800 - B3:3999. Binary Metasys object information is available in two-byte binary words. Individual
bits of this binary word can be parsed to read such binary object parameters as present value and the status parameters: on-line / off-line, defined / undefined, and reliable / unreliable status. Status parameters for analog objects areavailable for F8:0 - F8:799 from B3:4000 - B3:4799, respectively. The present values of these binary objects aremeaningless [2].
The active programming of the network port is accomplished with the Metasys Person Machine Interface (PMI) software. The process involves copying the existing Metasys objects one wishes to monitor from its location in the FMS
directory structure of Metasys systems into a directory structure of Metasys systems native to the network port. Thiscan become quite tedious for a large number of Metasys objects and is bound by the finite number of Metasys objects
the network port can translate to PLC-5 syntax.
Physically the network port communicates with the Metasys network via ARCNET and appears much like a network
control unit as a N1 LAN node. Communication to the PLC-5 system is accomplished via RS232 using the AllenBradley Full-Duplex Data Link Layer Protocol (DF/1) at a data rate of 9600 baud.

THE PLC-5 LINK TO METASYS
Since the Metasys network port emulates the communication of a PLC-5 and intercommunication between PLC-5modules is easily accomplished with a Data Highway DF/1 protocol link, a PLC-5 module was programmed so thatthe data to be monitored from the Metasys network is initially gathered by an Allen-Bradley PLC-5 module. ThePLC-5 was placed in a 1771 I/O chassis and connected to the network port. Since the PLC-5 processors communicatevia the Allen-Bradley Data Highway and the Metasys network port communicates via an RS232 interface, there wasan additional piece of hardware required, the Allen-Bradley 1770 KF2.

THE ALLEN-BRADLEY 1770-KF2
The Allen-Bradley 1770-KF2 module is a passive intelligent device which allows communication between the AllenBradley Data Highway and an intelligent asynchronous device programmed to handle the DF/1 communication protocol. Electrically the 1770-KF2 connects to the Allen-Bradley Data Highway in the standard multi-drop configuration, with the Data Highway station number set via DIP switches. Electrical connection to the asynchronous device isvia RS232 or RS422, at data rates of up to 9600 baud [4]. The 1770-KF2 was used to electrically connect the Data
Highway from the network port to the PLC-5 processor.

FIGURE 1. The METASYS-to-EPICS Link, a Hardware and Software View
HARDWARE

SOFTWARE

Metasys I/OProcessor

I/O Device
Example: Pump

Metasys I/OProcessor

I/O Device

I/O Device
N2 Bus: To other
Metasys I/O Processors
Metasys Network
Control Module

Metasys NetworkPort
RS232
Allen-Bradley
1770-KF2Metasys Network
Control Module

N1 LAN: To other
Metasys Network
Control Modules
Data HighwayPeer Communication
Interface

Allen-Bradley
PLC-5 Processor
Allen-BradleyDirect Communication
ModuleDevice: Metasys I/O Processor
Software: Metasys Facilities Management System
Metasys Person Machine Interface
System: Pump
Object: Pump Status - Binary - On / Off
Name: P1STAT
Object: Pump Flow - Analog - GPM
Name: P1FLOW

Device: Metasys Network Port
Software: Metasys Facilities Management System
Metasys Person Machine Interface
System: Network Port NP1
Object: Pump Status - Binary - On / Off
Name: P1STAT
Object: Pump Flow - Analog - GPM
Name: P1FLOW

Device: Allen-Bradley PLC-5Allen-Bradley Direct Communication
ModuleSoftware: Rockwell PLC-5 Development Software
PLC-5 Syntax: Pump Status - Binary - On / Off
Name: B3:810
PLC-5 Syntax: Pump Status - Analog - GPM
Name: F8:5

Allen-Bradley 1771 I/O Rack
Data Highway Remote I/O Interface

Allen-Bradley VME Remote
I/O Scanner

VMEIOC

Device: VME IOC with Allen-Bradley VME
Remote I/O Scanner Module
Software: EPICS
Process Variable: Pump Status - Binary - On / Off
Name: PUMP:1:Status:BI
Process Variable: Pump Flow - Analog - GPM
Name: PUMP:1:Status:AI

THE PLC-5 AS A BRIDGE TO EPICS
In addition to the PLC-5, a 1771-DCM Direct Communication Module also resides in the 1771 I/O chassis. TheDCM module provides the communication link to the APS control system with existing EPICS device support [5].
The PLC-5 is programmed with a Rockwell Software PLC-5 Development Software package. This ladder logic program reads the Metasys data which has been syntactically converted to PLC-5 binary (B3) and analog (F8) data representation by the network port via the Data Highway Peer Communication Interface. This data is then blocktransferred to the 1771-DCM on a time repetitive basis ensuring that the DCM module receives fresh data as readfrom Metasys. This repetition need only be fast enough to refresh the data every ten seconds. This is due to a timelimitation on the N1 LAN data update of the Metasys network port. The DCM is then read over a Data Highway
Remote I/O Protocol connection to an EPICS IOC with an Allen-Bradley VMEbus I/O scanner. The data read fromthe Johnson Controls conventional facilities control system may now be used in EPICS displays, alarm handling
applications to warn of impending failures, and data acquisition techniques familiar to operators and accelerator
physicists. Currently this interface is configured for read-only access of Metasys data. Modification for the control ofMetasys conventional facilities parameters from EPICS is easily accomplished with changes in the PLC-5 ladderlogic program.

SUMMARY
Figure 1 summarizes the network which provides the link between the EPICS-based accelerator control system andthe METASYS-based conventional facilities control system at the APS. It is intended that this system will provide avital link for data acquisition and monitoring so that correlations may be made between accelerator operation andenvironmental parameters.

ACKNOWEDGMENTS
This work was support by the U.S. Department of Energy, Office of Basic Energy Sciences, under Contract No. W31-109-ENG-38. Metasys is a registered trademark of Johnson Controls Inc. ARCNET is a registered trademark ofDatapoint Corporation. PLC-5 is a registered trademark of Allen-Bradley Corporation.

REFERENCE[1] Johnson Controls Inc., Metasys Interface Specification, 1994.
[2] Johnson Controls Inc., Metasys Network Technical Manual 636, Network Port Section, Technical Bulletin, 1992.
[3] W. McDowell, M. Knott, F. Lenkszus, M. Kraimer, N. Arnold, R. Daly, “Status and Design of the Advanced Photon Source Control System,” Proceedings of the 1993 Particle Accelerator Conference, pp. 1960-1962, 1993.
[4] Allen-Bradley Inc., Allen-Bradley 1770-KF2 Reference Manual, Publication 1784-6.5.3-DU3, 1988.
[5] J. Stein, C. Seaver, G. Nawrocki, M. Kraimer, “Data Exchange from Allen-Bradley PLC-Based Systems toEPICS,” these proceedings.