20
Server-Side Plugins Andrew Johnson, Ralph Lange EPICS Fall Collaboration Meeting, October 2010 BNL

Server-Side Plugins

  • Upload
    amelie

  • View
    37

  • Download
    2

Embed Size (px)

DESCRIPTION

Server-Side Plugins. Andrew Johnson, Ralph Lange EPICS Fall Collaboration Meeting, October 2010 BNL. Motivation. Things get faster Not all clients want all updates Wide use of timing/event systems Clients want to get updates only during “interesting” system states. Current Limitations. - PowerPoint PPT Presentation

Citation preview

Page 1: Server-Side  Plugins

Server-Side PluginsAndrew Johnson, Ralph Lange

EPICS Fall Collaboration Meeting, October 2010

BNL

Page 2: Server-Side  Plugins

Motivation

Things get fasterNot all clients want all updates

Wide use of timing/event systemsClients want to get updates only during “interesting” system states

Page 3: Server-Side  Plugins

Current Limitations

Update rate / deadband are configured in the databaseOne setup for all clients

Existing timing/event system driver and support• May cause records to process on event• May set time stamps from hardware

No filtering of updates for unrelated records

Page 4: Server-Side  Plugins

Design Considerations

Channel Access protocol compatibilityChanges create a lot of trouble

ModularitySmall systems need small footprint

API CompatibilityDon’t break existing “3rd party” code

Page 5: Server-Side  Plugins

EventQueue

ring

buffe

r

Server-Side Plugins

RecordEvent Subscription

field 1flags

Channel Access Client 1

Channel Access Client 2

MLISfield 1field 2field 3…

Channel Access Server

Event Task 1

Event Task 2

Event Subscription

field 2flags

Event Subscription

field 3flags

Event Subscription

field 1flags

EventQueue

ring

buffe

r

Ethernet

Record processing or field changes cause event updates

One set of event queues per client

Client

IOC

Pre-Event-Queue Filters

EventQueue

ring

buffe

r

Post-Event-Queue Filters

Stackable modulesInserted below or above

the event queue between database and Channel Access server

Configuration and InstantiationClient uses JSON

modifiers in PV name

Plug-in framework parses configuration and calls filter function

Page 6: Server-Side  Plugins

Plugin Integration

Plugin registers its interface (at boot-up):• Name and interface (jump table)• Filter function (and private pointer argument) to be inserted

into the pre- or post-event-queue chain• Description of the configuration options and config value

locations

Framework• Creates the plugin instance• Parses the configuration and stores results• Calls the registered filter function when appropriate

Page 7: Server-Side  Plugins

Plugins May

Manipulate the data Manipulate the meta data (alarm, timestamp) Change the type of data Change the size of arrays Drop updates Insert updates

Page 8: Server-Side  Plugins

ts – Timestamp “Now”

myPv.A{”ts”:{}}

Pre-event-queue: Sets the timestamp of the data update to “now”

Works around the issue that updates to fields which do not cause record processing create data updates that always show the (older) record timestamp, leading to e.g. the archiver creating wrong entries

Page 9: Server-Side  Plugins

dbnd – Deadband Throttling

myPv.RVAL{”dbnd”{”m”:”rel”,”d”:7.5}}

Pre-event-queue: Deadband throttling similar to analog records

Client specifies absolute or relative (%) delta Works for any field, not just .VAL

Page 10: Server-Side  Plugins

arr – Array Subset

myArray.VAL{”arr”:{”s”:-5,”i”:2}}

myArray.VAL[-5:2:]

Post-event-queue: Creates a sub-array with given start, increment, stop

Shorthand notation for commodity

Page 11: Server-Side  Plugins

sync – Sync with Timing System

myPv.VAL{”sync”:{”m”:”while”,”s”:”red”}}

Pre-event-queue: Synchronizes updates with timing system by pushing the update only under certain conditions

Refers to IOC globally configured named states that are defined by timing system events

Page 12: Server-Side  Plugins

sync Options

#17 #17#42 #42

Client subscribes to

State “red”

Client gets

Record my processing

Timing events

my.VAL

Page 13: Server-Side  Plugins

sync Options: before

#17 #17#42 #42

my.VAL{”sync”:{”m”:”before”,”s”:”red”}}Client subscribes to

State “red”

Client gets

Record my processing

Timing events

Page 14: Server-Side  Plugins

sync Options: first

#17 #17#42 #42

my.VAL{”sync”:{”m”:”first”,”s”:”red”}}Client subscribes to

State “red”

Client gets

Record my processing

Timing events

Page 15: Server-Side  Plugins

sync Options: last

#17 #17#42 #42

my.VAL{”sync”:{”m”:”last”,”s”:”red”}}Client subscribes to

State “red”

Client gets

Record my processing

Timing events

Page 16: Server-Side  Plugins

sync Options: after

#17 #17#42 #42

my.VAL{”sync”:{”m”:”after”,”s”:”red”}}Client subscribes to

State “red”

Client gets

Record my processing

Timing events

Page 17: Server-Side  Plugins

sync Options: while

#17 #17#42 #42

my.VAL{”sync”:{”m”:”while”,”s”:”red”}}Client subscribes to

State “red”

Client gets

Record my processing

Timing events

Page 18: Server-Side  Plugins

sync Options: unless

Client subscribes to

State “red”

Client gets

Record my processing

Timing events #17 #17#42 #42

my.VAL{”sync”:{”m”:”unless”,”s”:”red”}}

Page 19: Server-Side  Plugins

Status

Framework in place, interfaces stabilizing ts, dbnd, arr plugins: implemented Unit tests for framework and plugins exist sync plugin: in progress Next: rate based throttling Planned: atomic put/get, array stats,

default configuration values through info tags

Page 20: Server-Side  Plugins

Status

Unclear: access security integration Code is available (please give feedback):

lp:~ralph-lange/epics-base/server-side-plugins

Acknowledgements:• Michael Davidsaver• Supported by Helmholtz-Zentrum Berlin / BESSY II