javaioc status epics meeting vancouver may 2 2009 presented by : marty kraimer contributions by:...

26
JavaIOC Status EPICS Meeting Vancouver May 2 2009 Presented by : Marty Kraimer Contributions by: Matej Sekoranja(cosyLab), Shen Guobao(BNL), Sheng Peng

Upload: madison-lamb

Post on 01-Jan-2016

218 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: JavaIOC Status EPICS Meeting Vancouver May 2 2009 Presented by : Marty Kraimer Contributions by: Matej Sekoranja(cosyLab), Shen Guobao(BNL), Sheng Peng

JavaIOC Status

EPICS Meeting Vancouver May 2 2009

Presented by : Marty KraimerContributions by:

Matej Sekoranja(cosyLab), Shen Guobao(BNL), Sheng Peng

Page 2: JavaIOC Status EPICS Meeting Vancouver May 2 2009 Presented by : Marty Kraimer Contributions by: Matej Sekoranja(cosyLab), Shen Guobao(BNL), Sheng Peng

Vancouver May 2 2009 EPICS Meeting: javaIOC 2

Outline of Talk Major changes since EPICS Meeting last October at INFN in Italy

Overview of pvData

Types

Xml syntax

Work in Progress

Channel Access

VDCT

JavaIOC Extensions:

Model Server for Physics Application Standard records for JavaIOC

JavaIOC developments

Next Release

Logic Support and Finite State Machine

Page 3: JavaIOC Status EPICS Meeting Vancouver May 2 2009 Presented by : Marty Kraimer Contributions by: Matej Sekoranja(cosyLab), Shen Guobao(BNL), Sheng Peng

Vancouver May 2 2009 EPICS Meeting: javaIOC 3

Major Changes Since INFN Meeting JavaIOC moved to source forge: epics-pvdata

Sorry no current release.

Multiple source forge modules. Each is eclipse project

pvData: The PV database.

CAJv4: Version 4 of CAJ. Uses pvData.

JavaIOC: Uses pvData and will use CAJv4

pvData changes

Simplified Types. Array elements can not be structure or array.

Idea came from example XSD created by Matej XML syntax completely changed

At INFN meeting Matej and Andrew Johnson said: The way elements and attributes were defined is weird. Was not possible to develop XSD for syntax.

Another minor change being implemented.

Page 4: JavaIOC Status EPICS Meeting Vancouver May 2 2009 Presented by : Marty Kraimer Contributions by: Matej Sekoranja(cosyLab), Shen Guobao(BNL), Sheng Peng

Vancouver May 2 2009 EPICS Meeting: javaIOC 4

Source Forge Can import into eclipse from CVS

Host: epics-pvdata.cvs.sourceforge.net

Repository Path: /cvsroot/epics-pvData

Module, i.e. Eclipse project:

pvData CAJv4 javaIOC

User: anonymous

Before first sourceforge release

CAJv4 working

Another module that is example application

Local xml files. Skeleton support module. Jar files for pvData, CAJv4, javaIOC.

Page 5: JavaIOC Status EPICS Meeting Vancouver May 2 2009 Presented by : Marty Kraimer Contributions by: Matej Sekoranja(cosyLab), Shen Guobao(BNL), Sheng Peng

Vancouver May 2 2009 EPICS Meeting: javaIOC 5

Overview of JavaIOC Basic Ideas are:

PVDatabase has records consisting of structured data

For JavaIOC each field of a record can optionally have support

pvData

PVDatabase

Introspection and data interfaces for each field.

Factories for creating everything for PVDatabase.

PVRecord Has top level PVStructure. Can monitor any field including a PVStructure.

JavaIOC adds:

Record processing

Support

Page 6: JavaIOC Status EPICS Meeting Vancouver May 2 2009 Presented by : Marty Kraimer Contributions by: Matej Sekoranja(cosyLab), Shen Guobao(BNL), Sheng Peng

Vancouver May 2 2009 EPICS Meeting: javaIOC 6

PVDatabase A PVDatabase contains instances of the following:

structure

A structured set of fields. Is used to create a default set of fields in a sub-field of:

Another structure definition A record instance

record

A record instance.

Page 7: JavaIOC Status EPICS Meeting Vancouver May 2 2009 Presented by : Marty Kraimer Contributions by: Matej Sekoranja(cosyLab), Shen Guobao(BNL), Sheng Peng

Vancouver May 2 2009 EPICS Meeting: javaIOC 7

PVData: field types

enum Type { scalar,scalarArray,structure;}

enum ScalarType { // for xml is boolean, ... string pvBoolean,pvByte,pvShort,pvInt,pvLong,pvFloat,pvDouble, pvString; // The following are convenience methods public boolean isInteger(); public boolean isNumeric() public boolean isPrimitive() public static ScalarType getScalarType(String type);}

A scalar field must have a scalarType. An array field must have all elements with the same scalarType. A structure can have an arbitrary number of subfields.

Each subfield has a Type.

Page 8: JavaIOC Status EPICS Meeting Vancouver May 2 2009 Presented by : Marty Kraimer Contributions by: Matej Sekoranja(cosyLab), Shen Guobao(BNL), Sheng Peng

Vancouver May 2 2009 EPICS Meeting: javaIOC 8

PVData XML Syntax Concise Description

<package name = “packageName” /><import name = “packageName” />

<structure structureName = "name" extends = "structureName" > <!-- field definitions: sequence of scalar, array, and structure --></structure>

<record recordName = "name" extends = "structureName"> <!-- field definitions: sequence of scalar, array, and structure --> <scalar name = "name" scalarType = "scalarType" >scalarValue/scalar> <array name = "name" scalarType = "scalarType" capacity = "capacity" capacityMutable = "true/false" length = "length" offset = "offset"> arrayValues </array> <structure name = "name" extends = "structureName"> <!-- field definitions: sequence of scalar, array, and structure --> </structure></record>

Page 9: JavaIOC Status EPICS Meeting Vancouver May 2 2009 Presented by : Marty Kraimer Contributions by: Matej Sekoranja(cosyLab), Shen Guobao(BNL), Sheng Peng

Vancouver May 2 2009 EPICS Meeting: javaIOC 9

Example structure definitions<package name = “org.epics.pvData” /><import name = “org.epics.pvData.*” />

<structure structureName = "timeStamp"> <scalar name = "secondsPastEpoch" scalarType = "long" /> <scalar name = "nanoSeconds" scalarType = "int" /></structure>

<structure structureName = "alarmSeverity"> <auxInfo name = "pvReplaceFactory" type = "string"> org.epics.pvData.enumeratedFactory </auxInfo> <scalar name = "index" type = "int" /> <scalar name = "choice" type = "string" /> <array name = "choices" type = "string">none,minor,major,invalid</array></structure><structure structureName = "org.epics.ioc.alarm"> <structure name = "severity" extends = "alarmSeverity" /> <scalar name = "message" type = "string" /> <scalar name = "ackTransient" type = "boolean" /> <structure name = "ackSeverity" extends = "Severity" /></structure>

Page 10: JavaIOC Status EPICS Meeting Vancouver May 2 2009 Presented by : Marty Kraimer Contributions by: Matej Sekoranja(cosyLab), Shen Guobao(BNL), Sheng Peng

Vancouver May 2 2009 EPICS Meeting: javaIOC 10

Example Record Instances<import package = "org.epics.ioc.*" /><import package = "org.epics.pvData.*" />

<record name = "valueOnly"> <scalar name = "value" scalarType = "double">1.0></scalar></record>

<record name = "valueAlarmTimeStamp"> <scalar name = "value" scalarType = "double"/> <structure name = "alarm" extends = "alarm" /> <structure name = "timeStamp" extends = "timeStamp" /></record>

<record name = "valueAlarmTimeStampLink"> <scalar name = "value" scalarType = "double"/> <structure name = "alarm" extends = "alarm" /> <structure name = "timeStamp" extends = "timeStamp" /> <structure name = "link" extends = "caInputLink"> <scalar name = "pvname">somePV</scalar> </structure></record>

Page 11: JavaIOC Status EPICS Meeting Vancouver May 2 2009 Presented by : Marty Kraimer Contributions by: Matej Sekoranja(cosyLab), Shen Guobao(BNL), Sheng Peng

Vancouver May 2 2009 EPICS Meeting: javaIOC 11

Work In Progress CAJv4 – CAJv4 supports PVData, i.e. Structured data

VDCT

CosyLab is developing next generation. Will support pvData.

Not discussed further in this report.

Model server for High Level Physics Application.

Proof of concept.

Record Templates for Process Control.

JavaIOC

New Install features.

PortDriver developments.

Logic Support.

Page 12: JavaIOC Status EPICS Meeting Vancouver May 2 2009 Presented by : Marty Kraimer Contributions by: Matej Sekoranja(cosyLab), Shen Guobao(BNL), Sheng Peng

Vancouver May 2 2009 EPICS Meeting: javaIOC 12

CAJv4 Structured data (pvData) support.

Possible to transfer arrays by parts.

Client-specified monitor filters.

New (simple) CA header, no repeater needed, reduced beacon traffic, copy-less get, flow control improvements, advanced search (introspection), etc.

Status:

base “framework” completed (tx/rx queues, connection mgmt, etc.)

get, put and basic monitoring done (on-put, on-change, on absolute/relative change).

completing flow control…

Planned features: group get/put, on-event actions/monitors, multicast monitoring.

Page 13: JavaIOC Status EPICS Meeting Vancouver May 2 2009 Presented by : Marty Kraimer Contributions by: Matej Sekoranja(cosyLab), Shen Guobao(BNL), Sheng Peng

Online model server prototype

Online model server Based on a so-called “virtual accelerator”

Originally developed by SOLEIL and Diamond

Wrap into EPICS based Integrate with the narrow API interface Support Tracy-3 and Elegant Use CA-V3 for the communication protocol

Tracy/Elegant simulator (shared library)

Lattice configuration

Distributed IOC Process Databases

EPICS device support (API Interface)

EPICS Channel Access

LatticeLattice

Page 14: JavaIOC Status EPICS Meeting Vancouver May 2 2009 Presented by : Marty Kraimer Contributions by: Matej Sekoranja(cosyLab), Shen Guobao(BNL), Sheng Peng

Online model server prototype

Plan for updating model server

A structured data is neededUsing PVdata structure

javaIOC will be used for the prototype

A support will be developed

Communication protocolCA-v3/CA-v4

Fetching lattice information from IRMIS instead of local file

Page 15: JavaIOC Status EPICS Meeting Vancouver May 2 2009 Presented by : Marty Kraimer Contributions by: Matej Sekoranja(cosyLab), Shen Guobao(BNL), Sheng Peng

Vancouver May 2 2009 EPICS Meeting: javaIOC 15

Record Templates For Process Control A set of record templates are under design and implementation

Most of the features of the existing basic record types will be preserved

Some possible new features are planned and will be implemented

Dynamic load/unload records Improved alarm handling Integration with event system

How to define the hardware interface is still under design

The deployment facility is under design

Page 16: JavaIOC Status EPICS Meeting Vancouver May 2 2009 Presented by : Marty Kraimer Contributions by: Matej Sekoranja(cosyLab), Shen Guobao(BNL), Sheng Peng

Vancouver May 2 2009 EPICS Meeting: javaIOC 16

Before Next Release JavaIOC uses CAJv4

Server

Client for links Make sure all support takes advantage of new AfterStart facility (See below).

More effort on portDriver but will not delay release.

Develop sourceforge module for Example Application.

Create a nice homepage for epics-pvdata.

Should be in the next couple of months.

Goal is Beta release by fall Epics Meeting.

Page 17: JavaIOC Status EPICS Meeting Vancouver May 2 2009 Presented by : Marty Kraimer Contributions by: Matej Sekoranja(cosyLab), Shen Guobao(BNL), Sheng Peng

Vancouver May 2 2009 EPICS Meeting: javaIOC 17

JavaIOC: Install New Database: Background JavaIOC supports on line add of structures or records.

PVDatabase master holds completely installed structures and records.

PVDatabase beingInstalled holds structures or records to install. Structures are easy.

If xml file is parsed without error beingInstalled is merged into master. Records are harder.

Must create RecordProcess for each record.

Must create,initialize, and start the support for each field with support.

If any support does not start just fail.

If all support starts then merge beingInstalled into master

BUT what about initialization for asynchronous support EPICS has PINI and initHooks JavaIOC has afterStart – Recent development.

Next slide provides motivation.

Page 18: JavaIOC Status EPICS Meeting Vancouver May 2 2009 Presented by : Marty Kraimer Contributions by: Matej Sekoranja(cosyLab), Shen Guobao(BNL), Sheng Peng

Vancouver May 2 2009 EPICS Meeting: javaIOC 18

Initialization of asynchronous support For both input and output:

Normally want initial value before posting any monitors.

May be dependence between supports: For example output before input.

PortDriver

Provide time to connect. Port must connect before device can connect. Give device time to connect before link support initializes. Can be dependence between supports. Allow unrelated ports to initialize in parallel.

Servers, e. g. Channel Access

Should not allow access to new records until initialization done.

Page 19: JavaIOC Status EPICS Meeting Vancouver May 2 2009 Presented by : Marty Kraimer Contributions by: Matej Sekoranja(cosyLab), Shen Guobao(BNL), Sheng Peng

Vancouver May 2 2009 EPICS Meeting: javaIOC 19

Condensed Version of Support

// following is condensed version of Supportinterface Support { void initialize(LocateSupport locateSupport); // WHAT IS AfterStart. Next Slide void start(AfterStart afterStart); void stop(); void uninitialize(); void process(SupportProcessRequester supportProcessRequester);}

Page 20: JavaIOC Status EPICS Meeting Vancouver May 2 2009 Presented by : Marty Kraimer Contributions by: Matej Sekoranja(cosyLab), Shen Guobao(BNL), Sheng Peng

Vancouver May 2 2009 EPICS Meeting: javaIOC 20

AfterStart

Support.start calls requestCallback.

Before or after beingMerged is merged into master.

A set of queues is kept for both before and after merge. All callbacks at a requested priority must complete before the

callbacks at the next lower priority are called. Support is called back when it's queue is being emptied.

It must not block but use another thread for blocking calls.

Must call done when it is finished.

Can issue doneAndRequest for later queue.

interface AfterStart { void callRequesters(boolean afterMerge); void requestCallback(AfterStartNode node,boolean afterMerge,ThreadPriority priority); void done(AfterStartNode node); void doneAndRequest(AfterStartNode node,boolean afterMerge,ThreadPriority priority);}

Page 21: JavaIOC Status EPICS Meeting Vancouver May 2 2009 Presented by : Marty Kraimer Contributions by: Matej Sekoranja(cosyLab), Shen Guobao(BNL), Sheng Peng

Vancouver May 2 2009 EPICS Meeting: javaIOC 21

AfterStart – Other definitions

NewAfterStart is for servers, e. g. Channel Access and portDriver.

Calls newAfterStartRegister.

Each time a new database is being called NewAfterStartRequester.callback is called Server can call AfterStart.requestCallback.

public interface AfterStartNode {}interface AfterStartRequester { void callback(AfterStartNode node);}class AfterStartFactory { public static AfterStart create(); public static AfterStartNode allocNode(AfterStartRequester requester); public static void newAfterStartRegister(NewAfterStartRequester requester); public static void newAfterStartUnregister(NewAfterStartRequester requester);}interface NewAfterStartRequester { void callback(AfterStart afterStart);}

Page 22: JavaIOC Status EPICS Meeting Vancouver May 2 2009 Presented by : Marty Kraimer Contributions by: Matej Sekoranja(cosyLab), Shen Guobao(BNL), Sheng Peng

Vancouver May 2 2009 EPICS Meeting: javaIOC 22

InstallFactory

InstallRecords does the following

Creates PVDatabase beingInstalled and asks that definitions from file be put into it. If any errors quit.

Creates RecordProcess for each record and Support for each field.

Calls recordProcess.initialize for each record. If failure quit.

Creates a new AfterStart.

Calls recordProcess.start for each record. If any failure quit.

Empty the beforeMerge callback queues in priority order.

Merge beingInstalled into master.

Empty the afterMerge callback queues in priority order.

ALL DONE!!

class InstallFactory { public static boolean installStructures(String file,Requester requester); public static boolean installRecords(String file,Requester requester);}

Page 23: JavaIOC Status EPICS Meeting Vancouver May 2 2009 Presented by : Marty Kraimer Contributions by: Matej Sekoranja(cosyLab), Shen Guobao(BNL), Sheng Peng

Vancouver May 2 2009 EPICS Meeting: javaIOC 23

PortDriver Status Have communicated with:

Keithley 2000 Multimeter via Agilent E2050A LAN/GPIB Gateway. Thus VXI11 has been tested.

Serial port of a MOXA UC7408 LAN Gateway.

Canadian Light Source Loaned hardware. Many thanks to Elder Matias and Carl Finlay!!!!!!

AutoConnect changes (Note: asyn has similar change for port).

Periodically try to connect to unconnected port or device.

Queue and lockPort requests fail if port or device not connected. AfterStart incorporated.

For connection to port and device.

Link support still needs changes.

Page 24: JavaIOC Status EPICS Meeting Vancouver May 2 2009 Presented by : Marty Kraimer Contributions by: Matej Sekoranja(cosyLab), Shen Guobao(BNL), Sheng Peng

Vancouver May 2 2009 EPICS Meeting: javaIOC 24

PortDriver Status Cont. SCPI (Standard Commands For Programmable Instruments)

Command and Query Should also work for many non-SCPI devices.

Beginning of support for SCPI data model. So far just scalars.

Must investigate Status and Reporting Model. Structure support that only processes when error is detected.

Asyn Interpose Interface

Removed. Not needed.

Same goal attained via structures. STREAMS

I think not needed.

Again structures solve the problem.

No need for separate syntax, parser, etc.

Page 25: JavaIOC Status EPICS Meeting Vancouver May 2 2009 Presented by : Marty Kraimer Contributions by: Matej Sekoranja(cosyLab), Shen Guobao(BNL), Sheng Peng

Vancouver May 2 2009 EPICS Meeting: javaIOC 25

Logic Support EPICS has

FLNK – In dbCommon

Record Types Fanout Sequence Select Others

JavaIOC has generic support

Supports a structure Calls support for each field that has support Can process in parallel or wait for previous support to finish

Replaces FLNK, Fanout, and sequence Will add additional logic support

Page 26: JavaIOC Status EPICS Meeting Vancouver May 2 2009 Presented by : Marty Kraimer Contributions by: Matej Sekoranja(cosyLab), Shen Guobao(BNL), Sheng Peng

Vancouver May 2 2009 EPICS Meeting: javaIOC 26

Future Logic Support logicIf – Semantics like Java or C if statement.

logicSwitch – Semantics like Java or C switch statement.

Finite State Machine

Top level support that Is the record process requester, i. e. It decides when to process. Emulates a finite state machine.

LogicStateSet – Semantics like SNL ss.

logicWhen – Semantics like SNL (State Notation Language) when.

Comments VDCT will be GUI. Channel Access can monitor internal state. Full Channel Access, portDriver, etc support.