Presentation is loading. Please wait.

Presentation is loading. Please wait.

JavaIOC EPICS Meeting SSRF March 12-14 2008 Presented by: Marty Kraimer.

Similar presentations


Presentation on theme: "JavaIOC EPICS Meeting SSRF March 12-14 2008 Presented by: Marty Kraimer."— Presentation transcript:

1 JavaIOC EPICS Meeting SSRF March 12-14 2008 Presented by: Marty Kraimer

2 Overview JavaIOC – What is it. Features. What is implemented. What is missing. Example of Implementing a “Device”  positioner record.

3 March 8-10 2008EPICS Meeting SSRF3 JavaIOC – What Is It? IOC - Input/Output Controller Has a “smart” real time database  Record instances can be processed.  Records can be accessed via Channel Access.  Records can link to hardware, other records, etc. Has functionality like an EPICS IOC but  Structured data  Better Array data  Generic Support  Written in Java

4 March 8-10 2008EPICS Meeting SSRF4 Features PV (Process Variable) Database DBD - Database Definition Database DB – Runtime Database of record instances XML Parsers for DBD and DB Record Processing and Monitoring Record Scanning: Periodic and Event Channel Access Generic structure/recordTypes and support

5 March 8-10 2008EPICS Meeting SSRF5 PV Database Field types  Primitive: all Java primitives except char boolean, byte, short, int, long, float, double  string: implemented as a Java String  structure: has fields. Each field can be any type  array: has elementType which can be any type Complex Structures fully supported Introspection and Data interfaces: Provide access to any field.

6 March 8-10 2008EPICS Meeting SSRF6 PV Introspection Introspection Interfaces, i.e. no data  Field: Methods: getType, getFieldName,...  Array: extends Field: Method: getElementType  Structure: extends Field Methods: getFields, getStructureName FieldFactory  Implements introspection interfaces  Can be extended but probably not necessary

7 March 8-10 2008EPICS Meeting SSRF7 PV Data Interfaces PVField: Base for data: Methods: getField,...  PVBoolean,...,PVString : Methods: get,put  PVArray: Base for array data interfaces PVBooleanArray,...,PVArrayArray : Methods get,put  PVStructure provides access to a structure.  PVRecord provides access to a record instance. PVDataFactory  Default implementation.  Any PVField can be replaced. Often useful ConvertFactory: Convert between data types

8 March 8-10 2008EPICS Meeting SSRF8 org.epics.ioc.pv Self Contained Java package for PV Data Can be used for purposes other than JavaIOC Database  Example: Channel Access Local and EPICS client use PVData  It is designed to be used for other purposes. Via structures it could support  Vector/Matrix Data  Image Data  etc.

9 March 8-10 2008EPICS Meeting SSRF9 XML Parsers DBD - Database Definitions  structure  recordType - A top level structure  create – defines factory that replaces default data implementation.  support – defines a factory that implements support for a field. DB – Database of record Instances Macro Substitution and Include supported for both DBD and DB

10 March 8-10 2008EPICS Meeting SSRF10 DB Database and Record Processing DB Database provides  Record Locking – A record instance can be locked.  Ability to monitor puts to any field of a record instance.  Register and locate support for record and fields of a record. Record Processing  Coordinates processing of a record instance.  Both synchronous and asynchronous processing are supported.  Each instance can have at most one record processor. A record can be self processed. Simulates multiple processors. Get and Put support  Can process after put. Also supported by EPICS.  Can process before get. Not supported by EPICS.  Can put, then process, then get. Not supported by EPICS.

11 March 8-10 2008EPICS Meeting SSRF11 Record Processing A record instance is basic process unit  It is locked during any processing or I/O  RecordProcess is master. It calls support for record instance.  Support modules implement semantics  ANY field can optionally have support  Record instance must have support

12 March 8-10 2008EPICS Meeting SSRF12 Record Scanning Scan  Types: passive, periodic, event  Priority Uses Java priorities  Threads created as required Periodic  Arbitrary rate: minRate,deltaRate Event  Based on eventName  Replaces EPICS event and I/O Inter

13 March 8-10 2008EPICS Meeting SSRF13 Support Implements Record Processing Semantics Each record instance has support Each field can optionally have support Support can call other support Support provided with javaIOC is as generic as possible  During initialization looks for required fields and support  If required fields not found then does not start Example: generic – support for a structure or array  Calls support for each sub field that has support  Each support must finish before next is called  Supports a recordType or a structure or an array of arrays or structures

14 March 8-10 2008EPICS Meeting SSRF14 Channel Access Local: Within javaIOC Server: Channel Access Client javaIOC Database  Any field that is primitive or array of primitive.  Support for all DBR types.  Support for process, getProcess, and putProcess Client: javaIOC EPICS IOC or CAS  Support for all EPICS data types.  Support for DBR types, i.e. Can get display, control, alarm, etc.  Link support for javaIOC records. Both Server and Client implemented via JCA/CAJ.  Cosylab extended JCA/CAJ to support CA Server as well as Client  Matej Sekoranja from Cosylab implemented the javaIOC Server. Currently no full javaIOC Channel Access, e.g. No support for structures.

15 March 8-10 2008EPICS Meeting SSRF15 PV Naming for CA Server EPICS pvname is.field JavaIOC is.name.name....{options}  name can be field name or a property  Some examples example.value example (same as example.value) example.value.display.limit.low powerSupply.power.value psArray.supply[0].power.value Options are of the form name=value. Currently only  getProcess=true and putProcess=true  Examples using EPICS base ca utilities caget example.value{getProcess=true} camonitor psArray[1].power caput powerSupply.power{putProcess=true} 10.0

16 March 8-10 2008EPICS Meeting SSRF16 Swtshell Shell for javaIOC GUI shell for javaIOC implemented via Eclipse SWT. My most important tool for testing javaIOC.  Before Channel Access support only convenient way to test.  Still very usefull. GUI part should be remote.  Not until full Channel Access Support for javaIOC Next slide shows appearance.

17 March 8-10 2008EPICS Meeting SSRF17

18 March 8-10 2008EPICS Meeting SSRF18 Implemented PV (Process Variable) Database XML Parsers: DBD and Record Instance Record Processing/Scanning/Monitoring Channel Access  Channel Access Local  EPICS CA Server  EPICS CA Client Generic record/structures and support PortDriver – JavaIOC implementation of ASYN Support SWTSHELL: GUI iocshell

19 March 8-10 2008EPICS Meeting SSRF19 Not Implemented Replacement for EPICS calc support. Replacement for EPICS sequencer. Channel Access  JavaIOC client JavaIOC server  Full Introspection and structure support VDCT: Visual Database Configuration Tool Access security Error logging ??? Lots to do!! BUT – It is ready for at least soft IOC Support.

20 March 8-10 2008EPICS Meeting SSRF20 Device Record Example: Positioner Positioner Requirements  Coordinate the movement of a set of motors  A movement consists of Start all motors. Monitor motors for movement When all motors have stopped finish processing. Example Usage – Xray beam line  Scan Sample – repeat following until done. Move sample to new position Take data  Positioner coordinates two steps. Design must also support a single motor

21 March 8-10 2008EPICS Meeting SSRF21 Structure and enum Definition For MotorCommand <field name = "choices" type = "array" elementType = "string" default = "idle stop move monitor jog reset" /> public enum MotorCommand { idle,stop,move,monitor,jog,reset }  structure definition Commands can be issued via Channel Access  For EPICS V3 Channel Access the field appears as a DBR_ENUM  enum definition for use by code  This talk mostly about move and monitor

22 March 8-10 2008EPICS Meeting SSRF22 Structure and enum Definition For MotorMonitorCommand <field name = "choices" type = "array" elementType = "string" default = "idle monitor" /> public enum MotorMonitorCommand { idle,monitor } Structure Definition  Commands can be issued via Channel Access  For EPICS V3 Channel Access the field appears as a DBR_ENUM Enum definition for use by code.

23 March 8-10 2008EPICS Meeting SSRF23 Monitor Not Compatible With Other Commands All commands except monitor start some action Monitor (get current position) must be done repeatedly until motors stop Solution: Two record instances Record type positioner – Has an array of embeded motors  Motor is both a structure and a recordType The structure is embeded in positioner The recordType is for single motor Record type motorMonitor  Has link to a positioner or motor record  Action for a putProcess to command.monitor Monitor linked record until not moving Finish processing

24 March 8-10 2008EPICS Meeting SSRF24 Positioner vs synAPPS SynAPPS (Beam line Control Software used by many EPICS facilities)  Has table record which is positioner  It links to motor or other records. Positioner record encapsulates all motors within a single record  Makes sense when motors only used for positioning  The user thinks of the positioner as a single device that happens to have components

25 March 8-10 2008EPICS Meeting SSRF25 Typical Client Usage Assume  A three motor positioner named P and a motorMonitor named M  To start movement the client does a put to a field named command Put P.command move PutProcess M.command monitor To make a move to a new position the client:  put P.axis[0].move value  put P.axis[0].speed value ... same for axis[1] and axis[2]  Put P.command move  putProcess M.command monitor The operation does not complete until all motors have stopped moving.

26 March 8-10 2008EPICS Meeting SSRF26 Additional Requirements Support multiple types of motor Generic Support  Motor Support should be usable for purposes other than in a positioner For maintainability, monitoring, and diagnosis it must be possible to access each motor individually.

27 March 8-10 2008EPICS Meeting SSRF27 Design: Five Support Modules The five Support Modules are:  motorMonitor  positioner  motor  Hardware Specific Motor Support  PortDriver MotorMonitor is generic and supports a recordType positioner is generic and supports a recordType motor  Is generic.  It can support a record or a structure impeded in another record. Hardware Specific Motor Support and portDriver: next slide

28 March 8-10 2008EPICS Meeting SSRF28 Hardware Specific Motor Support Hardware Specific Motor Support and portDriver  Must be created for each different type of motor/controller  Example is for a Hytec8601 which is an Industry Pack four axis motor controller.  Supports an embeded structure. For example a field in a motor record or structure. PortDriver for Hytec8601  Coordinates access to the four axis controller

29 March 8-10 2008EPICS Meeting SSRF29 motorMonitorRecord.xml <field name = "priority" type = "structure" structureName = "scanPriority" /> <field name = "command" type = "structure" structureName = "motorMonitorCommand" supportName = "motorMonitor" /> <field name = "monitor" type = "structure" structureName = "monitor" /> <field name = "alarm" type = "structure" structureName = "alarm"/> <field name = "timeStamp" type = "structure" structureName = "timeStamp"/> <support name = "motorMonitor" factoryName = "org.epics.ioc.sbirDemo.MotorMonitorFactory" />

30 March 8-10 2008EPICS Meeting SSRF30 MotorMonitor Support The linked record must have following two fields:  command which must be a motorCommand structure  moving which must have type boolean. motorMonitor spawns a thread that monitors the linked record  The thread is only active while the linked record is moving.  Monitoring is done be issuing a put, process, get to the linked record The put is a monitor command to the linked record The process waits until the linked record completes the monitor The get reads the moving field from the linked record When a putProcess to command is issued  Sets moving true.  Activates the monitor thread  When the monitor thread detects that the linked record is not moving Sets moving false and command to idle Completes processing.

31 March 8-10 2008EPICS Meeting SSRF31 Design: Five Support Levels The five levels are:  motorMonitor  positioner  motor  Hardware Specific Motor Support  PortDriver motorMonitor is generic and supports a recordType positioner is generic and supports a recordType motor  Is generic.  It can support a record or a structure impeded in a positioner. Hardware Specific Motor Support and portDriver

32 March 8-10 2008EPICS Meeting SSRF32 positionerRecord.xml <field name = "command" type = "structure" structureName = "motorCommand" supportName = "positioner" /> <field name = "alarm" type = "structure" structureName = "alarm"/> <field name = "timeStamp" type = "structure" structureName = "timeStamp"/> <support name = "positioner" factoryName = "org.epics.ioc.sbirDemo.PositionerFactory" />

33 March 8-10 2008EPICS Meeting SSRF33 positioner Support Each element of the array field axis must be a structure that has the fields  command which must be a motorCommand structure command must have Support MotorSupport  moving which must have type boolean. positioner monitors it’s command field  When a command is issued, it issues the same command to each axis.  It’s process method just waits for the command to complete  NOTE: A move command completes when the move has started NOT when the move completes  Any command except monitor sets moving true if not already true  When a monitor command is given A monitor command is issued to each axis After each axis has completed the monitor  The moving field of each axis is read  If any axis is moving the positioner is moving.

34 March 8-10 2008EPICS Meeting SSRF34 Design: Five Support Levels The five levels are:  motorMonitor  positioner  motor  Hardware Specific Motor Support  PortDriver motorMonitor is generic and supports a recordType positioner is generic and supports a recordType motor  Is generic.  It can support a record or a structure impeded in a positioner. Hardware Specific Motor Support and portDriver

35 March 8-10 2008EPICS Meeting SSRF35 motorCommon.xml <field name = "command" type = "structure" structureName = "motorCommand" supportName = "motor" /> <field name = "move" type = "structure" structureName = "double" /> <field name = "speed" type = "structure" structureName = "double" /> <field name = "display" type = "structure" structureName = "display" />

36 March 8-10 2008EPICS Meeting SSRF36 motorRecord.xml

37 March 8-10 2008EPICS Meeting SSRF37 Structure double <field name = "control" type = "structure" structureName = “control” /> Is used for fields speed and move  Structure control has fields limit.low and limit.high  Attempting to set a value outside the limits causes an alarm  Note that Motor Support and HYTEC8601 Support do not have to check the limits. There is generic support that enforces the limits.

38 March 8-10 2008EPICS Meeting SSRF38 Generic Motor Support The field motor is a hardware specific structure The structure must have a field named command  command must be a motorCommand structure  command must have Support MotorSupport Units  Generic motor support uses engineering units  Hardware specific motor support does what it wants  display.limit.low and display.limit.high are engUnitsLow and endUnitsHigh  motor support calls motorSupport.setEngUnits When motor support receives a command the same command is given to hardware specific support. When speed is modified motorSupport.setSpeed is called. When move is modified motorSupport.setMove is called.

39 March 8-10 2008EPICS Meeting SSRF39 MotorSupport Interface interface MotorSupport extends Support{ void setSpeed(double speed); void setMove(double distance); double getPosition(); boolean isMoving(); boolean command(MotorCommand command); void setEngUnits(double engLow,double engHigh); } Implemented by Motor Support  Called by positioner  For now positioner only calls command. Could do more. Implemented by Hardware Specific Motor Support  Called by Motor Support  Converts from Engineering Units to Steps.

40 March 8-10 2008EPICS Meeting SSRF40 Design: Five Support Levels The five levels are:  motorMonitor  positioner  motor  Hardware Specific Motor Support  PortDriver motorMonitor is generic and supports a recordType positioner is generic and supports a recordType motor  Is generic.  It can support a record or a structure impeded in a positioner. Hardware Specific Motor Support and portDriver

41 March 8-10 2008EPICS Meeting SSRF41 Design: Hardware Level Support portDriver - Hytec8601Driver  Implements interface HYTEC8601 which is called by supportHYTEC8601  Uses JNI because linux driver requires ioctl file commands.  PortDriver synchronizes access to 8601, which is a four axis controller. Hardware Specific Motor Support – HYTEC8601 Support  Understands commands for Hytec8601  Structure for configuration and low level commands  Implements MotorSupport which is called by motor support

42 March 8-10 2008EPICS Meeting SSRF42 PortDriver Interface HYTEC8601 public interface HYTEC8601 { void setStartSpeed(short speed); short getStartSpeed(); void setAcceleration(short acceleration); short getAcceleration(); void setSpeed(short velocity); short getSpeed(); void setSteps(int steps); int getSteps(); void setPosition(int position); int getPosition(); short getCSR(); void setCSR(short value); void start(byte value); }

43 March 8-10 2008EPICS Meeting SSRF43 Structure Definition for HYTEC8601 <field name = "io" type = "structure" structureName = "pdrvSupport" /> <field name = "command" type = "structure" structureName = "motorCommand" /> <field name = "direction" type = "structure" structureName = "motorDirection" />

44 March 8-10 2008EPICS Meeting SSRF44 Comments about Hardware Specific Design Can be used by generic motor support The hardware specific structure allows low level access  Generic tools, e.g. Edm, can access hardware specific details  Needed for maintenance and diagnosis.

45 March 8-10 2008EPICS Meeting SSRF45 Positioner Record Instance

46 March 8-10 2008EPICS Meeting SSRF46 Record Instance Continued ${name}  Above is motorCommandTemplateDB.xml  hytec8601TemplateDB.xml is too long to show on one slide


Download ppt "JavaIOC EPICS Meeting SSRF March 12-14 2008 Presented by: Marty Kraimer."

Similar presentations


Ads by Google