Beam Synchronous Acquisition on IOC Definition/Requirements Current Implementation (based on SLC BPM Acq) Code - MikeZ, Debbie, Mods/Test - saa Alternative to BSA To add.

Download Report

Transcript Beam Synchronous Acquisition on IOC Definition/Requirements Current Implementation (based on SLC BPM Acq) Code - MikeZ, Debbie, Mods/Test - saa Alternative to BSA To add.

Beam Synchronous Acquisition on IOC
Definition/Requirements
Current Implementation (based on SLC BPM Acq)
Code - MikeZ, Debbie, Mods/Test - saa
Alternative to BSA
To add BSA to an IOC, see:
http://www.slac.stanford.edu/grp/lcls/controls/glo
bal/subsystems/timing/lclsBsa.ppt
Sep 22, 2008
LCLS Meeting
Stephanie Allison
[email protected]
Definition/Requirements
Acquire all beam-dependent scalars across multiple IOCs
on the same pulse over multiple pulses of a certain kind
(not just x-pulses-in-a-row) up to 120Hz.
Acquire up to 2800 values per scalar in one acquisition
request.
Each value of the 2800 values can be an average of up to
1000 values.
Each acquisition request can specify:
Beam code (defines project, 1 = LCLS)
Machine conditions of interest – rate, TS, permits, etc
Maximum severity which data is considered good
Provide constant 1HZ beam-synchronous data for channel
archiver and displays (reduce network load without losing
synchronicity).
Sep 22, 2008
LCLS Meeting
Stephanie Allison
[email protected]
Current Implementation
Three Parts to BSA:
User request for an acquisition (aka event
definition or EDEF) done by CA client.
Data gathering done on the EVG and EVR IOCs
When gathering is finished, access of prepared
data waiting on IOCs done by CA clients, with
checks for a good acquisition.
Only the data gathering part is discussed in this
talk.
Sep 22, 2008
LCLS Meeting
Stephanie Allison
[email protected]
IOC Data Gathering
CA
Client
BPM FEE
Triggers
Data
P
I
E
E I
BSA Data
N
O
V EDEF Flags, V O
E
G Pattern, etc R C BPM
Timing C
T
EDEF Setup
Crate
CA
Client
Crate
Data gathering part consists of the following actions:
EDEF setup and start request done on the EVG IOC.
360hz checking on the EVG IOC with user notification when finished.
360hz requests (acquisition control) sent by the EVG IOC to all EVR IOCs via fast
fiber optic link.
Data checking, averaging, and array update per scalar record per request on the
EVR IOCs.
Data on EVR IOC must be available within 7.3 msec after beam or it will be lost,
even when beam is less than 120hz. EDEF will finish with arrays that are not
complete if this time budget cannot be met.
For an acquisition at full beam rate (ie, 30hz), if data is acquired at a lower rate
(ie, 10hz), the array will not be complete. Use rate-limit bits as-needed when
setting up the EDEF.
Implementation is all EPICS record-based.
Sep 22, 2008
LCLS Meeting
Stephanie Allison
[email protected]
Data Acquisition Across IOCs
EVR IOC1
EDEF #1
EDEF #1
…
…
…
…
EDEF #15
…
…
EDEF #15
…
Scalar 1
Scalar n
EVR IOC2
EVG IOC
EDEF #1
EDEF #1
…
…
EDEF #15
…
Scalar 1
EVR IOC scalar data – X, Y, TMIT, Phase,
Amplitude, PMT, Position, Bunch Length
…
…
…
…
nth
element
of all
arrays is
on the
same
pulse.
EDEF #15
…
Pattern 1
EVG IOC Scalar data – 32 bit patterns (6),
pulse ID, timestamp secs, timestamp nsec
All arrays have 2800 values, # values used depends on user request
IOC
Timing pattern
from EVG
EVR
EDEF
e.g. 10 Hz
BSA
Storage
For 20 EDEFs
1
…
2
TH
BPMS:IN20:221:XHSTTH
BPMS:IN20:221:YHSTTH
BPMS:IN20:221:TMITHSTTH
BR
F1
From
BPM
BPM
module
F2
Data at
full rate
Controls
network
OPI
Matlab
X=lcaGet(‘BPMS:IN20:221:XHSTTH’);
Conceptual data flow for Beam Synchronous Acquisition – 10Hz System EDEF
Slide from Patrick Krejcik, modified by saa
EVR Event Time Line – 4 Fiducials/120Hz Beam
BPM
BSA
BPM Records
Records Done
Ready
360Hz
Fiducial
F3
Time (msec) 0 1.0
120Hz BEAM
B3
F2
2.8
Slower
GADC
Slower BSA
GADCs Done
Ready
F1
5.6
All B3
BSA
MUST be
finished
before F0
F0
8.3
9.3
B0
Implementation – EVG IOC – Global Event Display
Implementation – EVG IOC – All EDEF Diag Display
Put new app name in
reserve record –
edefReserve sequence
will assign next available
EDEF number
15 user-defined
requests at one time,
is this enough?
Issue – apps that
crash before freeing.
“alan” app is using
EDEF 12 until freed
by the app – “alan”
can do multiple acqs
System EDEFs are
reserved and setup
at EVG IOC boot and
never freed.
Implementation – EVG IOC – EDEF Diag Display
Turn “ON” when ready. EVG IOC 360Hz
event task will turn “OFF” when finished. Turn
back “ON” to flush and restart the acq.
Set machine conditions –
values acquired only on
pulses where ALL inclusion
conditions are true AND NO
exclusion condition is true
Beam code describes project, 1 = LCLS
(0=any beam code – good for testing)
Define # in each average, #
measurements, severity at or above which
data is not included in average. Forever
option used by system EDEFs.
Push “FREE” to free this EDEF number. Name
and user will be blanked out.
Implementation – EVG IOC – EDEF Mask Diag Display
Condition (bit) names come
from the SLC Database
(PNBN) and ordered
alphabetically in new records
by the edefMask sequence.
Choose conditions that define the pulses of interest. Only pulses with these conditions will provide values to
the acquisition. The edefMask sequence on the EVG IOC creates the masks used by the 360Hz event task.
Alternative to BSA – Client does all the work!
Clients monitor all data (data, status, pattern, etc)
from all IOCs using channel access.
Timestamps are checked to determine data on the
same pulse.
Extra logic and retries needed for missing data
when at higher rates (IOC CA server runs at low
priority and may skip some updates). Also,
network glitches and high traffic an issue.
Client does same pattern checking, timestamp
validation, averaging, RMS, etc, now done on
IOCs.
Sep 22, 2008
LCLS Meeting
Stephanie Allison
[email protected]
Background on Implementation
Sep 22, 2008
LCLS Meeting
Stephanie Allison
[email protected]
Implementation – EVG IOC 360Hz Task
The 360hz event task wakes up on interrupt from the PNET
module. One of its many duties is to check for a match
between the new pulse’s pattern and beam code and each
active EDEFs. It keeps a count of the number of
measurements and the number of values in the current
average per EDEF. Masks are prepared:
Pattern match
Average done
New request (clear history)
Bad data severity
A detail - pulse information is pipelined - the new pulse is
actually for 3 pulses ahead.
For the current pulse, for each EDEF that matches, if the
average is done, the pattern (5 “modifier” 32bit integers)
and pulse ID are stored in arrays for that EDEF that match
the arrays provided by the EVR IOCs for scalar data.
Sep 22, 2008
LCLS Meeting
Stephanie Allison
[email protected]
Implementation – EVG-to-EVR 360Hz Data Transfer
8-bit Event Code
8-bit Event Code
EVR
...
42.0 50.4
8-bit Event Buffer
8-bit MPS Data
(Shared Data Bus)
33.6
8-bit Event Buffer
25.2
8-bit Event Code
16.8
8-bit Event Buffer
8-bit MPS Data
(Shared Data Bus)
8-bit Event Buffer
8-bit MPS Data
(Shared Data Bus)
8.4
8-bit MPS Data
(Shared Data Bus)
...
8-bit Event Code
8-bit Event Code
8-bit Event Code
8-bit Event Code
8-bit Event Code
EVG
58.8
65.2
Time (nsec)
EDEF bit masks included in 360Hz data sent by EVG to EVR. EVR IOC caches the data on data
interrupt. The EVR IOC 360Hz event task is activated on the next fiducial interrupt (event code 1) and it
copies the data to records at the end of the pipeline and then moves up the pipeline. Records with
current conditions are then available to BSA record processing done later in the same pulse. The task
also triggers sequences via event to clear history and averaging when a new measurement is started.
Sep 22, 2008
LCLS Meeting
Stephanie Allison
[email protected]
EVR IOC BSA Record Processing (TORO example)
SCAN=IO Intr
<ioc>:EDEFAVGDONE.A,
<ioc>:EDEFMEASSEVR.A
TORO TMIT
ai Record
VAL, SEVR, timestamp
Arrays used by BSA CA client:
TMIT1
sSub Record:
<ioc>:MODIFIER5.A
SDIS
LCLS
Time
Stamps
LNK1
timestamp
TMIT1GO
bo Record
VAL
Averages good values,
finds RMS,
FLNK
counts # good values X (SDIS)
in the average,
checks timestamps
<ioc>:MODIFIER5.B
FLNK
TMIT2GO
bo Record
TMITEF Fanout
Records
<ioc>:MODIFIER5.T
SDIS
“LNK20”
TMIT1HST
compress Record
FLNK
M
SDIS
LNK2
FLNK
.
.
.
TMITF2GO
bo Record
FLNK
sSub and compress
records reset via
TMITINIT1 sequence
record on acq startup.
TMITCNT1HST
X (SDIS) compress Record
L
FLNK
X (SDIS)
FLNK
TMITRMS1HST
compress Record
EVR IOC BSA Record Processing – Event Device Display
EVR IOC BSA Record Proc – Event Device Diag Display
EVR IOC BSA Record Processing – BSA Diag Display
Copied from
EDEF diag
display
Last averaged
values
RMS zero when
# avg is 1
Various
inputs/outputs
to averaging
sSub record
Last 100 values
of value