600 likes | 728 Views
Abeans and ACS: A control system based on J ava and CORBA. M.Plesko and KGB Team J. Stefan Institute , Slovenia Cosylab, Ltd., Slovenia. Riken, March 4-th, 2002. Cosylab Facts. Spin-off company from largest Slovenian institute 40 man-years experience in control systems
E N D
Abeans and ACS: A control systembased on Java and CORBA M.Plesko and KGB Team J. Stefan Institute, Slovenia Cosylab, Ltd., Slovenia Riken, March 4-th, 2002
Cosylab Facts • Spin-off company from largest Slovenian institute • 40 man-years experience in control systems • students start during undergraduate study • Customer service oriented • develop, install and support complete control systems • custom development (software, device integration,…) • consulting From the Detector to the Director™ M. Plesko and KGB Team, Abeans and ACS
Products • Abeans: Java client library (framework) • CosyBeans: Java powerful GUI components • ACS: CORBA core, developed for ALMA • DataBush: Java accelerator physics libraries • C+S: low-cost control system • Abeans, ACS, LonWorks fieldbus - our I/O boards • LOCO: cheap&precise vacuum measuring • Visual DCT: EPICS graphic development M. Plesko and KGB Team, Abeans and ACS
Main References • Elettra high level software 89-95 • ANKA control (hard+software): 96- • SLS consulting and software: 99- • Ultra Ltd.: CORBA development 99-01 • ESO, IRAM, NRAO: ACS development 2000- • DESY: Java/Abeans applications 2001- • Delta U55 beamline control (hard+soft) 2002 • 25 conference articles in 5 years • European Physical Society (EPS-EPCS) Award 2001 M. Plesko and KGB Team, Abeans and ACS
eManagement Cycle Order • Project Web • Sources • Manuals • … • Internal Pages • open project • select project manager • select people included Scripts Customer • Request Tracker • To-Do • Activity list Bug report • Actual work • Code • XML Docs Testing • Source Repository • Sources • Manuals (in XML) • Resources M. Plesko and KGB Team, Abeans and ACS
Part 1 • Overview • ACS: saying CORBA is not enough • Abeans: features that all clients need • Abeans/CORBA or EPICS: use cases M. Plesko and KGB Team, Abeans and ACS
... VME PLC Distributed Control fieldbus Branch controller LAN Control Room switch Internet M. Plesko and KGB Team, Abeans and ACS
Evolution is the solution Collect know-how • Design based on best features of EPICS, TACO, Elettra/LEP CS, ACOP/TINE, Arhus CS,… • 5 years of development and improvement • Continuous usage in ANKA and ESO • ACS: ACI/Visibroker -> BACI+MACI/TAO • Abeans: R1 -> R2 -> R3 • CosyBeans: R1 -> redesigned for R3 Experience is gained from diverse projects • ESO, ANKA, DESY, SLS, Riken M. Plesko and KGB Team, Abeans and ACS
ACS (server) and Abeans (client) • ACS and Abeans should solve the following needs: • full framework for distributed control, not only few libraries • enforcestandardisation with design patterns (rather than rules). • runs on many platforms (TAO/ACE + Java): VxWorks, UN*X, Win • professional quality • well testedoptimized software and professional documentation • contain standard tools and components with extensive features • provideconfiguration and management & installation procedures • ALMA: array of 64 radiotelescopes (EU-USA-Japan project) • ANKA, Karlsruhe, Germany: synchrotron light source • DESY, Hamburg: Abeans on TINE (in-house protocol) • Delta, Dortmund, Germany: UV-light beamline (in development) • Riken, SLS, SNS,…? M. Plesko and KGB Team, Abeans and ACS
Goal: Be User Friendly • Make the Best CS… • in Terms of Maintenance (lowest TCO) • safe & simple installation/configuration • centralised & consistent management • powerful & easy application creation M. Plesko and KGB Team, Abeans and ACS
Why not EPICS: • EPICS optimized for other criteria • compare assembler to high level language • use new technology to guarantee long lifetime • leverage industry standards • need option for low cost hardware • don’t require VME • PC, but don’t lock to UN*X • need platform independent libraries M. Plesko and KGB Team, Abeans and ACS
EPICS Problems • steep learnig curve • no standard logging • no good tool to find arbitrary channels • no standard control system management • no application development tools • difficult to find bugs and fix them • difficult to divide work between GUI developers, database developers and hardware developers M. Plesko and KGB Team, Abeans and ACS
The Result • ACS – Advanced Control Software (server) • model: device/property/field: ps.voltage().max() • services for common application support • life-cycle, naming, “mulitcasting”, logging, management,… • Abeans client library • wrap CORBA communication into Java Beans • services for common client support • connection management, time-out, error, alarm handling,… • CosyBeans – powerful GUI components • connect GUI components with Abeans in RAD (Rapid Application Development) tools M. Plesko and KGB Team, Abeans and ACS
ACS tools Management, ObjectExplorer, Logging, Alarms Abeans Application config database plain Java code CosyBeans GUI widgets i n t e r f a c e ACS CORBA server I/O boards CORBA Abeans: libraries, device beans, plugs implementation replace with any CS, e.g. TANGO, EPICS, etc. Abeans and ACS channel access, CORBA… M. Plesko and KGB Team, Abeans and ACS
Data Flow Configdata Monitor: 0.1-10Hz, onChange Equip-ment GUI Clients Device driver Control server Alarm Command Log file Remote communication VME, fieldbus M. Plesko and KGB Team, Abeans and ACS
Set, get flow chart for FG frequency ASCII strings over serial cable RPC requests Calls on CORBA remote objects, as defined with IDL Ariadne board PC with Windows NT Any platform with JVM LonWorks Driver, Nevron C DeviceServer, C++ Client Panel, Java RS232 LonWorkspackages CORBA / Internet SET SET SET nvmFrequency nvmFrequency RWProperty RWPropertyBean HP FG 33120A GET GET GET TIMER MONITOR Actual GET is done in a duty cycle, the driver always returns latest fetched value M. Plesko and KGB Team, Abeans and ACS
Panels M. Plesko and KGB Team, Abeans and ACS
ACAD view in Browser! M. Plesko and KGB Team, Abeans and ACS
CosyBeans • CosyBeans in PSpanel • Aframe (with glasspane) • a) selector • b) gauger • c) slider • d) LEDder • e) ATextPane • Extensive features • initialize from CS at run-time • monitors -> events • alarms,timeout,shortcuts • resize-able, adjust shape,… • trend: history, save as CSV, histogram, zoom, … M. Plesko and KGB Team, Abeans and ACS
Part 2 • Overview • ACS: saying CORBA is not enough • Abeans: features that all clients need • Abeans/CORBA or EPICS: use cases M. Plesko and KGB Team, Abeans and ACS
How Do We Define the Device Interfaces • “Narrow” ctrlObj.remote(device,"msg", dataIn, dataOut) 1 master interface client server • “Wide” 1 interface/device server client dataOut=device.msg(dataIn) M. Plesko and KGB Team, Abeans and ACS
interface PS { ADC: double RO DAC: double RW status: bits RO on(): void off(): void } RampedPS : PS { start(): void stop(): void } An Accelerator Device Maps to an Object ps.getADC() ps.getDAC() ps.setDAC() ps.off() ps.getStatus() M. Plesko and KGB Team, Abeans and ACS
Properties are Objects by Themselves ADC.getHistory() ADC.description() ADC.max() t ADC.get() ADC.unit() M. Plesko and KGB Team, Abeans and ACS
String str = current.get() ; double cur ; sscanf (str, "%lf", &cur) ; ROdouble Current ; double cur = Current.get() ; Current.getAsync (doubleCallback CB) ; … interface doubleCallback { void exec (double value); } String str = status.get() ; unsigned int stat ; sscanf (str, "%u", &stat) ; ROuint Status ; unsigned int stat = Status.get() ; Status.getAsync (uintCallback CB) ; … interface uintCallback { void exec(unsigned int value); } Enforce Type-Checking at all Levels Weak typing (casting = run-time checking): Strong typing (no casting = compile-time checking): M. Plesko and KGB Team, Abeans and ACS
interface Pdouble { void get(CBdouble cb); void history(doubleSeq values); Monitor newMonitor(CBdouble cb); double graphMax(); string description(); } interface RWdouble : Pdouble { void set(double value, CBvoid cb) ; double minValue; ... } interface SimpleMonitor { void suspend(); void resume(); destroy(); } interface Monitor : SimpleMonitor { void setTimer (deltaTime time); ... } interface Device { string name(); double position() ; DeviceServer deviceServer() ; privileges access(); ... } interface PowerSupply : Device { readonly attribute RWdouble current; readonly attribute ROdouble readback; readonly attribute ROpattern status; void on(CBvoid cb); void off(CBvoid cb); void reset(CBvoid cb); } interface RampedPowerSupply:PowerSupply{ void loadCurve(doubleSeq values, longSeq steps, CBvoid cb); void start(CBvoid started, CBvoid done); void abort(CBvoid aborted); } Example Interfaces M. Plesko and KGB Team, Abeans and ACS
Don’t model interface after I/O e.g. interface ADC_16channel expose hardware interface, e.g. send_ RS232(String s) ; create device-specific interfaces e.g. interface PS_100_Ampere interface extra database access Object should know its constants Do define an interface with the least common denominator then use inheritance consider whether all hardware specifics has to be available from control system rather provide “raw” debugging channel for experts (LabView) provide self-description where flexibility is paramount Ulong bitPattern() color[] whenSet() color[] whenCleared() String[] bitDescription() Devices/Properties Must Not Reflect Specific Hardware M. Plesko and KGB Team, Abeans and ACS
Main ACS Features • Monitors (one to many) • Data Channel (many to many) • Logging • Error Handling (exceptions, ErrStack) • Alarm System • Archiving System • Management and Access Control M. Plesko and KGB Team, Abeans and ACS
Data Channel M. Plesko and KGB Team, Abeans and ACS
Logging M. Plesko and KGB Team, Abeans and ACS
Management and Access Control M. Plesko and KGB Team, Abeans and ACS
Archiving System M. Plesko and KGB Team, Abeans and ACS
OE and Admin Client M. Plesko and KGB Team, Abeans and ACS
CORBA Services Used • Naming service (built into manager) • Telecom log service • Notification service (successor of Event) • Interface repository • Property Service • Implementation repository (activator) M. Plesko and KGB Team, Abeans and ACS
Which CORBA? M. Plesko and KGB Team, Abeans and ACS
Part 3 • Overview • ACS: saying CORBA is not enough • Abeans: features that all clients need • Abeans/CORBA or EPICS: use cases M. Plesko and KGB Team, Abeans and ACS
Same patterns in GUI and data access Consistent interface from API, data management, data souce and remote system Generator: write interface (example PS) and get all other clases Can this concept, based od OO patterns, be used all over the CS? Map Device to Bean M. Plesko and KGB Team, Abeans and ACS
Applications Applications Abeans Device server Device server Hardware Hardware Abeans • Application framework • Hide comm layer • Provide application services • Provide CS models • RAD, easier maintenance : M. Plesko and KGB Team, Abeans and ACS
Abeans Features • Hide details of CORBA - just one of many: • Logging, alarm, and communication error reporting • Resource initialization and destruction • choose and connect to selected device • supports different protocol via plugs (e.g. CORBA, EPICS,…) • Same core code is used everywhere • The code is tested very well • Fix bug for one customer, enjoy everywhere • Visual composition and normal programming together • choose device type and command through menu! • almost all errors detected by compiler not during operation • Abeans discover vis/man mode => change behaviour M. Plesko and KGB Team, Abeans and ACS
Ulong bitPattern() color[] whenSet() color[] whenCleared() String[] bitDescription() CosyBeans Widgets } ADC.description() Gauge ADC.max() ADC.get() ADC.unit() } Status M. Plesko and KGB Team, Abeans and ACS
CosyBeans Features • Optimized for Control Systems, not just GUIs • A result of long thinking, designing, comparing, testing, use at other laboratories, reconsiderations, eg. • initialize from CS at run-time • control system connection status+timeout handling • colour coding of states and alarms • Consistent behaviour of widgets in all panels • no subtle differences to learn • user can fully configure at run-time • resize-able, adjust shape to fully use available space • intuitive/safe modification of CS parameters (clever slider,…) • trend everywhere: history, save as CSV, histogram, zoom, … • No duplication of programming efforts M. Plesko and KGB Team, Abeans and ACS
Java Beans GUI Builder • Like SCADA quality, but more • automatically generated source • just standard components • completely open to additions • visual and textual programming • Abeans+CosyBeans enforce same look&feel • allow efficient horizontal division of work (same organization in Cosylab) • GUI-work reduced from 60% to 20% of project M. Plesko and KGB Team, Abeans and ACS
Visual Programming • Panels in RAD (no hand-written code) • implement default behavior • notifications to user when communication errors occur • timeouts • exceptions • interpret error numbers • callback, monitor and alarm queued&dispatched as event • default lifecycle management • initialization when GUI becomes visible • connection when all necessary parameters have been set • destruction when application closes • ServiceBean provides access to services in “visual programming” mode M. Plesko and KGB Team, Abeans and ACS
Serious Programming • Manual programming with Abean device Beans • device manual = API (Bean properties & methods) • compile-time error checking through strong typing • sync and async program flow (through lock object) • group Abeans into families for same behaviour • fine-grained control:~10 event types, ~15 system properties • Abeans discover vis/man mode => change behaviour • Aggregate data for display of large number of similar devices (i.e. tables) M. Plesko and KGB Team, Abeans and ACS
Common Services • Hide details of CORBA - just one of many: • Resource initialization and destruction • Connection management • choose and connect to selected device • connect to selected protocol (via plugs) • Data delivery (timeouts, threading options)... • Logging (to outside world) • Reporting (inside application) • Exception and error handling • Policy and configuration management • Authentication (to be done) M. Plesko and KGB Team, Abeans and ACS
Part 4 • Overview • ACS: saying CORBA is not enough • Abeans: features that all clients need • Abeans/CORBA or EPICS: use cases M. Plesko and KGB Team, Abeans and ACS
Use Case 1 – Addition of a device GOAL: Integrate a new type of device into CS. • Specify a description for it • CORBA IDL, specify EPICS or TINE channels, etc. • “Plug it” into the bottom CS layer • EPICS, TINE, CORBA, … • Write a simple GUI application for it M. Plesko and KGB Team, Abeans and ACS
Use Case 1 – Addition of a device, on EPICS • Application: Java+MEDM or Motif+TCL / TK • Write code for CS logic and features • Check for errors, broken connections, etc. • Create monitors • Log processes • UI relatively easy to implement • Limited number of features offered Start from scratch, duplicate CS code. Addition of a another device type? M. Plesko and KGB Team, Abeans and ACS
Use Case 1 – Addition of a device, with Abeans • Application: Java + Abeans and CosyBeans libraries • For CS logic and features • Write or generate device beans for this device type • UI easy to implement – use CosyBeans • Designed to complement Abeans • A powerful library with widgets, designed for CS users • Monitors, errors, timeouts are displayed and handled in a consistent way • Visual Composition is possible Generate device beans, compose a GUI Addition of a another device type? M. Plesko and KGB Team, Abeans and ACS
Use Case 2 – A complex application GOAL: Create an application that computes an average of all the currents of CS magnets and sets this value on all magnets where this is possible. • Get the list of all magnets in the CS • Get all the currents • Compute the average • Set the values where possible • Display the procedure with a GUI. All the time check for possible problems. M. Plesko and KGB Team, Abeans and ACS