21
JavaIOC Overview and Update EPICS Seminar/Workshop Raja Ramanna Centre For Advanced Technology Indore India January 27-30 2009 Presented by: Marty Kraimer

JavaIOC Overview and Update EPICS Seminar/Workshop Raja Ramanna Centre For Advanced Technology Indore India January 27-30 2009 Presented by: Marty Kraimer

Embed Size (px)

Citation preview

Page 1: JavaIOC Overview and Update EPICS Seminar/Workshop Raja Ramanna Centre For Advanced Technology Indore India January 27-30 2009 Presented by: Marty Kraimer

JavaIOC Overview and Update

EPICS Seminar/WorkshopRaja Ramanna Centre For Advanced Technology

Indore IndiaJanuary 27-30 2009

Presented by:Marty Kraimer

Page 2: JavaIOC Overview and Update EPICS Seminar/Workshop Raja Ramanna Centre For Advanced Technology Indore India January 27-30 2009 Presented by: Marty Kraimer

January 2009 EPICS Seminar RRCAT 2

Background

Development started 01FEB2006 Vision – Develop an IOC similar to EPICS IOC but also

Structured Data EPICS records are flat

Better Array Data EPICS arrays are fixed length; allocated during initialization Can not address a sub-array

Allow any field to optionally have support For EPICS only INP and OUT can have soft/hard support Record type can hard code associated soft support for other fields

Must be constant, DB, or CA Why Java

Ease of implementation – Structured data is BIG step Was a good choice If (When?) implemented in C++ functionality will be defined

Page 3: JavaIOC Overview and Update EPICS Seminar/Workshop Raja Ramanna Centre For Advanced Technology Indore India January 27-30 2009 Presented by: Marty Kraimer

January 2009 EPICS Seminar RRCAT 3

Some Key JavaIOC Features

A PVDatabase contains definitions of the following: Structure

A structured set of data fields Provides an easy way to create a structured field in a record Defines “well known” things

Record A record instance Has a top level structure

AuxInfo describes auxiliary information about a field Just a structure How support is defined

Key features of a record or structure Every field has code that provides access to

Introspection interface Data interface

JavaIOC optionally adds support to any field XML support for creating structure and record definitions

Page 4: JavaIOC Overview and Update EPICS Seminar/Workshop Raja Ramanna Centre For Advanced Technology Indore India January 27-30 2009 Presented by: Marty Kraimer

January 2009 EPICS Seminar RRCAT 4

JavaIOC data types

Latest Version (not released) supports the following data types Type

Scalar – All Java primitives except char pvBoolean pvByte,pvShort,pvInt,pvLong,pvFloat,pvDouble pvString – Implemented as a Java String

Array – element type can be any scalar type Structure – ordered set of fields. Each field has name and type

Major changes from early versions of JavaIOC pvUnknown no longer exist – Unnecessary complication pvEnum – enumerated type like EPICS menu and enum

Replaced by structure Array element type can NOT be array or structure

Unneeded complication – Just use structure.

Page 5: JavaIOC Overview and Update EPICS Seminar/Workshop Raja Ramanna Centre For Advanced Technology Indore India January 27-30 2009 Presented by: Marty Kraimer

January 2009 EPICS Seminar RRCAT 5

Example: Alarm Structure Definitions

enumeratedFactory provides the name of a Java Factory Keeps index and choice in sync

AlarmSeverity is enumerated structure defining alarm severities Alarm is a structure for alarms

Has support Note message instead of EPICS status Will use in example to follow

<structure name = "enumeratedFactory"> <scalar name = "pvReplaceFactory" type = "string"> org.epics.pvData.misc.EnumeratedFactory</scalar></structure>

<structure name = "alarmSeverity"> <auxInfo name = "pvReplaceFactory" type = "string">enumeratedFactory</auxInfo> <scalar name = "index" type = "int" /> <scalar name = "choice" type = "string" /> <array name = "choices" type = "string"> none,minor,major,invalid</array></structure>

<structure name = "alarm"> <auxInfo name = "supportFactory" type = "string">alarmSupportFactory</auxInfo> <structure name = "severity" type = "alarmSeverity" /> <scalar name = "message" type = "string" /> <scalar name = "ackTransient" type = "boolean" /> <structure name = "ackSeverity" type = "alarmSeverity" /></structure>

Page 6: JavaIOC Overview and Update EPICS Seminar/Workshop Raja Ramanna Centre For Advanced Technology Indore India January 27-30 2009 Presented by: Marty Kraimer

January 2009 EPICS Seminar RRCAT 6

Generic structure

<structure name = "genericFactory"> <scalar name = "supportFactory" type = "string"> org.epics.ioc.support.basic.GenericFactory</scalar></structure>

<structure name = "generic"> <auxInfo name = "supportFactory" type = "string">genericFactory</auxInfo></structure>

Structure generic Has NO fields Has support named genericFactory

Support generic Supports a structure Looks at each sub-field. If it has support, the support is called

Page 7: JavaIOC Overview and Update EPICS Seminar/Workshop Raja Ramanna Centre For Advanced Technology Indore India January 27-30 2009 Presented by: Marty Kraimer

January 2009 EPICS Seminar RRCAT 7

Really Simple Record Instance

The above record instance Has a single field named value of type double. This is the ONLY data

associated with this record. The field value is appended to structure generic which has no fields The record can be processed but not much happens except monitoring

<record name = "reallySimple” type = “generic” > <scalar name = “value” type = “double” /></record>

Page 8: JavaIOC Overview and Update EPICS Seminar/Workshop Raja Ramanna Centre For Advanced Technology Indore India January 27-30 2009 Presented by: Marty Kraimer

January 2009 EPICS Seminar RRCAT 8

Not So Simple Record Instance

The above record instance has the following fields value – type is double alarm data and support timeStamp display – display properties. input – input is from another record. Could be EPICS V3 record scan – The record is scanned once a second

<record name = "notSoSimple" type = “generic”> <scalar name = “value” type = "double" /> <structure name = “alarm” type = "alarm" /> <structure name = “timeStamp” type = "timeStamp" /> <structure name = “display” type = "display" /> <structure name = “input” type = "inputSupport"> <scalar name = “pvname”>somePV</structure> </structure> <structure name = “scan” type = "scan"> <structure name = “type”> <scalar name = “choice”>periodic</scalar> </structure> <scalar name = “rate”>1.0</scalar> </structure></record>

Page 9: JavaIOC Overview and Update EPICS Seminar/Workshop Raja Ramanna Centre For Advanced Technology Indore India January 27-30 2009 Presented by: Marty Kraimer

January 2009 EPICS Seminar RRCAT 9

Current Development

Phase II SBIR (Small Business Innovative Research) Grant from USA DOE Bob Dalesio applied for and manages the grant. Phase I was just Bob and me. Phase II includes others

Goals: Development of JavaIOC itself Channel Access that supports structured data

Matej Sekoranja (cosyLab) is responsible Define some Controls Related Structures and Support

Changes to October 2008 release of JavaIOC pvData is a separate project - In source forge look for EPICS-pvData The XML syntax completely changed

Now possible to define XSD (XML Schema Definition) New data types are supported

Array element type must be a scaler, i.e. Can not be array or structure

Page 10: JavaIOC Overview and Update EPICS Seminar/Workshop Raja Ramanna Centre For Advanced Technology Indore India January 27-30 2009 Presented by: Marty Kraimer

January 2009 EPICS Seminar RRCAT 10

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

Page 11: JavaIOC Overview and Update EPICS Seminar/Workshop Raja Ramanna Centre For Advanced Technology Indore India January 27-30 2009 Presented by: Marty Kraimer

January 2009 EPICS Seminar RRCAT 11

Features

PV (Process Variable) Database Structure – Predefined Structures Record Instances

XML Parser

Record Processing and Monitoring

Record Scanning: Periodic and Event

Channel Access – BUT remote is only via EPICS Channel Access

Generic structure and support definitions and implementation

Port Driver is replacement for EPICS asynDriver Currently no hardware support thus not useful

Calculation engine – JavaIOC replacement for EPICS calc support.

Page 12: JavaIOC Overview and Update EPICS Seminar/Workshop Raja Ramanna Centre For Advanced Technology Indore India January 27-30 2009 Presented by: Marty Kraimer

January 2009 EPICS Seminar RRCAT 12

PV Database

Field – Has a name and type

Field types

Scalar: all Java primitives except char boolean boolean, byte, short, int, long, float, double string: implemented as a Java String

ScalarArray Element type is any scalar type.

Structure has fields. Each field has a name and can be any type

Complex Structures fully supported

Introspection and Data interfaces: Provide access to any field.

Page 13: JavaIOC Overview and Update EPICS Seminar/Workshop Raja Ramanna Centre For Advanced Technology Indore India January 27-30 2009 Presented by: Marty Kraimer

January 2009 EPICS Seminar RRCAT 13

PV Introspection

Introspection Interfaces, i.e. no data

Field: Methods: getType, getFieldName, ...

Scalar getScalarType

Array: extends Field: Method: getElementType

Structure: extends Field Methods: getFields, ...

FieldFactory

Implements introspection interfaces

Can be extended but probably not necessary

Page 14: JavaIOC Overview and Update EPICS Seminar/Workshop Raja Ramanna Centre For Advanced Technology Indore India January 27-30 2009 Presented by: Marty Kraimer

January 2009 EPICS Seminar RRCAT 14

PV Data Interfaces

PVField: Base for data: Methods: getField, ...

PVScalar Base for scalar data interfaces PVBoolean,...,PVString : Methods: get,put

PVArray: Base for array data interfaces

PVBooleanArray,...,PVStringArray : 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

Page 15: JavaIOC Overview and Update EPICS Seminar/Workshop Raja Ramanna Centre For Advanced Technology Indore India January 27-30 2009 Presented by: Marty Kraimer

January 2009 EPICS Seminar RRCAT 15

org.epics.pvData

Java project for PV Data Packages: pv, factory, property, xml, misc

Can be used for purposes other than JavaIOC Database

Example: Channel Access It is designed to be used for other purposes.

Via structures it could support

Vector/Matrix Data Image Data Etc.

PVRecord

Record Locking – A record instance can be locked. Ability to monitor puts to any field of a record instance.

Page 16: JavaIOC Overview and Update EPICS Seminar/Workshop Raja Ramanna Centre For Advanced Technology Indore India January 27-30 2009 Presented by: Marty Kraimer

January 2009 EPICS Seminar RRCAT 16

JavaIOC Support and Record Processing

Support Database

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.

Page 17: JavaIOC Overview and Update EPICS Seminar/Workshop Raja Ramanna Centre For Advanced Technology Indore India January 27-30 2009 Presented by: Marty Kraimer

January 2009 EPICS Seminar RRCAT 17

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

No lock sets

Page 18: JavaIOC Overview and Update EPICS Seminar/Workshop Raja Ramanna Centre For Advanced Technology Indore India January 27-30 2009 Presented by: Marty Kraimer

January 2009 EPICS Seminar RRCAT 18

Record Scanning

Scan

Types: passive, periodic, event

Priority Uses Java priorities

Threads created as required

Periodic

Arbitrary rate: minPeriod,deltaPeriod

Event

Based on eventName

Replaces EPICS event and I/O Inter

Page 19: JavaIOC Overview and Update EPICS Seminar/Workshop Raja Ramanna Centre For Advanced Technology Indore India January 27-30 2009 Presented by: Marty Kraimer

January 2009 EPICS Seminar RRCAT 19

Support

Methods Lifetime: initialize, start, stop, uninitialize process

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

Calls support for each sub field that has support

Each support must finish before next is called

Page 20: JavaIOC Overview and Update EPICS Seminar/Workshop Raja Ramanna Centre For Advanced Technology Indore India January 27-30 2009 Presented by: Marty Kraimer

January 2009 EPICS Seminar RRCAT 20

Implemented

PV (Process Variable) Database

XML Parser

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

Expression Calculator – features like EPICS calc.

Page 21: JavaIOC Overview and Update EPICS Seminar/Workshop Raja Ramanna Centre For Advanced Technology Indore India January 27-30 2009 Presented by: Marty Kraimer

January 2009 EPICS Seminar RRCAT 21

Not Implemented

Replacement for EPICS sequencer.

JavaIOC Channel Access Currently under development

Full Introspection and structure support for JavaIOC client <-> JavaIOC server

VDCT: Visual Database Configuration Tool

Access security

Error logging

???

Lots to do!!

BUT It is ready for at least soft IOC Support and soon for serial, gpib, and

vxi11.