Accelerator Independent Data Access / PVAccess 2.0
AIDA-PVA is the latest version of the AIDA framework. Built on top of EPICS 7 it enables client applications to programmatically access and manage any device or database on the SLAC Network using simple channel names.
Loading...
Searching...
No Matches
1.7 - SLC Utilities Users Guide

This section describes what an AIDA-PVA user should know about accessing the SLC Utilities through AIDA-PVA. For general information on using AIDA-PVA see Basic Users Guide to Aida, and the EPICS javadoc.

Summary

  • Retrieve trigger device status
  • Deactivation and reactivation of a trigger device.
  • Control devices via knobs using multiknob files
  • Set BGRP variable value
  • Set and retrieve SCP transverse feedback
  • Execute correlation plots

Synopsis

PV Arguments Description
1.7.1 <prim>:<micr>:<unit>:TACT TYPE BEAM Retrieve trigger device status
1.7.2 <prim>:<micr>:<unit>:TACT VALUE BEAM Deactivation and reactivation of a trigger device
1.7.3 MKB:VAL VALUE MKB Control devices via knobs using multiknob files
1.7.4 BGRP:VAL VALUE BGRP VARNAME Set BGRP variable value
1.7.5 <prim>:<micr>:<unit>:LOOP_STAT TYPE Get SCP transverse feedback
1.7.6 <prim>:<micr>:<unit>:LOOP_STAT VALUE Set SCP transverse feedback
1.7.7 CORRPLOT:SCAN FILE STEPVARS Execute correlation plots

1.7.1. Retrieve trigger device status

  • <prim>:<micr>:<unit>:TACT
    • TYPE* : type
      • SHORT
      • LONG
      • STRING
    • BEAM* : beam code

Allows the retrieval of the status code or a status string for a specified trigger device on a beam code.

Arguments

Argument Names Argument Values Description
TYPE* string
Determines the return type of the request
SHORT return a short value
LONG return a long value
STRING return a string value
BEAM* Integer Beam code number

Return value

TYPE Description
SHORT A short value containing the status code for the trigger device on a beam code:
0 => deactivated, 1 => activated
LONG A long value containing the status code for the trigger device on a beam code:
0 => deactivated, 1 => activated
STRING A string value containing a status string having one of two values: "deactivated" or "activated"

Examples

operation Response
TRIG:LI31:109:TACT BEAM=1 TYPE=SHORT 1
TRIG:LI31:109:TACT BEAM=1 TYPE=LONG 0
TRIG:LI31:109:TACT BEAM=1 TYPE=STRING "activated"

1.7.2. Deactivation and reactivation of a trigger device

  • <prim>:<micr>:<unit>:TACT
    • VALUE* : operation
    • BEAM* : beam code

Allows the deactivation or reactivation of a specified trigger device on a beam code.

Arguments

Argument Names Argument Values Description
VALUE* integer
Flag code indicating the desired operation
0 deactivate
1 reactivate
BEAM* integer
Beam code number

Return value

TYPE Return Column Column Type Description
TABLE value SHORT_ARRAY status code for the specified trigger device on a beam code
0 trigger device has been deactivated
1 trigger device has been activated

Examples

Operations

  • TRIG:LI31:109:TACT BEAM=1 VALUE=1
  • TRIG:LI31:109:TACT BEAM=1 VALUE=0

Response

value
value
1

1.7.3. Control devices via knobs using multiknob files

  • MKB:VAL
    • VALUE* : knob rotation value
    • MKB* : multiknob filename

Allows the setting of devices referenced in a specified multiknob file by knob rotation using a specified relative delta value. Only a relative (not absolute) multiknob file may be specified.

Arguments

Argument Names Argument Values Description
VALUE* float
relative delta knob rotation value.
MKB string
multiknob filename. The filename path specification
(including the prefix "mkb:", if file is in the standard
multiknob file directory) of a multiknob file

Return value

TYPE Return Column Column Type Description
TABLE name STRING_ARRAY name of each device referenced in the specified multiknob file
value DOUBLE_ARRAY value of each device after the knob rotation set operation

Examples

Operations

  • ‘MKB:VAL MKB='mkb:li02b_xb.mkb’ VALUE=1.0`

Response

name value
name value
KLYS:LI31:31:PDES 0.26
KLYS:LI11:31:PDES 0.11

1.7.4. Set BGRP variable value

  • BGRP:VAL
    • VALUE* : value
    • BGRP* : button group name
    • VARNAME* : button group variable name

Allows for the setting of a BGRP variable value. Sets the value of a specified variable for a specified BGRP

Arguments

Argument Names Argument Values Description
VALUE* boolean
specifying the new variable value
true
false
BGRP* string
The BGRP name
VARNAME* string
A BGRP variable name for the specified BGRP..

Return value

None

Examples

operation
‘BGRP:VAL BGRP=LCLS VARNAME=T_CAV VALUE='Yes’`

1.7.5. Get SCP transverse feedback

  • <prim>:<micr>:<unit>:LOOP_STAT
    • TYPE* : type

Allows for getting SCP transverse feedback status. Gets a code or a string that describes the status of the specified SCP transverse feedback

Arguments

Argument Names Argument Values Description
TYPE* Return type string:
Determines the return type of the request
BOOLEAN return a boolean value.
SHORT return a short value.
INTEGER return an integer value.
LONG return a long value.
STRING return a string value.

Return value

TYPE Return Value Description
BOOLEAN A boolean value containing the SCP transverse feedback
true in feedback state
false not in feedback state
SHORT A short value containing the SCP transverse feedback
status code for the loop device
0 off
1 compute
2 feedback
INTEGER An integer value containing the SCP transverse feedback
status code for the loop device
0 off
1 compute
2 feedback
LONG A long value containing the SCP transverse feedback
status code for the loop:
the HSTA bitmask
STRING A string value containing a SCP transverse feedback
status string having one of six values
"off" loop is in off state
"sample" loop is in sample state
"compute" loop is in compute state
"actuate" loop is in actuate state
"dither" loop is in dither state
"feedback" loop is in feedback state

Examples

operation Response
FBCK:LI18:28:LOOP_STAT TYPE=BOOLEAN true
FBCK:LI18:28:LOOP_STAT TYPE=SHORT 1
FBCK:LI18:28:LOOP_STAT TYPE=LONG 2
FBCK:LI18:28:LOOP_STAT TYPE=STRING "feedback"

1.7.6. Set SCP transverse feedback

  • <prim>:<micr>:<unit>:LOOP_STAT
    • VALUE* : value

Allows for setting and getting SCP transverse feedback status. Sets the specified SCP transverse feedback to: off , sample, compute/on, actuate, dither, or feedback

Arguments

Argument Names Argument Values Description
VALUE* string
Determines the return type of the request
"OFF" set transverse feedback status to off.
"SAMPLE" set transverse feedback status to sample.
"COMPUTE" set transverse feedback status to compute.
"ON" set transverse feedback status to on.
"ACTUATE" set transverse feedback status to actuate.
"DITHER" set transverse feedback status to dither.
"FEEDBACK" set transverse feedback status to feedback.

Return value

None

Examples

operation
FBCK:LI18:28:LOOP_STAT VALUE=OFF
FBCK:LI18:28:LOOP_STAT VALUE=COMPUTE
FBCK:LI18:28:LOOP_STAT VALUE=ON
FBCK:LI18:28:LOOP_STAT VALUE=FEEDBACK

1.7.7. Execute correlation plots

  • CORRPLOT:SCAN
    • FILE* : plot-config-button-file
    • PRIMSTV* : primary-step-variable-structure
      • name*: device
      • low*: low-value
      • high*: high-value
      • steps*: number-of-steps
      • settle: settle-time
      • extrasettle: extra-settle-time
    • SECNSTV : secondary-step-variable-structure
      • name*: device
      • low*: low-value
      • high*: high-value
      • steps*: number-of-steps
      • settle: settle-time
      • extrasettle: extra-settle-time
    • BPMD : measurement-definition-number
    • BPMAVG: number-of-pulses-to-average
    • DTIZAVG: dtiz-average
    • MAGFUNC: trim-operation

Executes a correlation plot by loading the parameters from the given file and applying the specified primary step variable (and optionally secondary step variable). The function returns a matrix that cross references the step variable values with the sample values at each step.

Note
this returns a special kind of AIDA-PVA table. Normally the number of columns are fixed, but in this case we return a variable number of columns, albeit with predictable names. The labels for these columns are variable.

Prior to calling this AIDA-PVA endpoint the operator needs to set up the parameters of a Correlation Plot in the Data Acquisition panel for "Correlation Plots" of the SCP application program and save them to a button file.

Note
some correlation plots may take an extended amount of time to run so you may need to increase the timeout for a request when running this command.

Arguments

FILE and PRIMSTV are always needed. The contents and value of these arguments determine the number and values of the remaining parameters that will be required for a successful scan. e.g. if the PRIMSTV parameter refers to a BPM reading then a BPM measurement definition (BPMD) argument is required. Selecting and setting a coherent set of arguments requires a lot of operator skill and domain knowledge. Not for the faint hearted.

Argument Names Argument Values Description
FILE* <file-name> string
Button file name including the "BTN" suffix.
The file must be in the standard button file directory
SLC_CRR_BUTTON:
PRIMSTV* {name, low, high, steps} structure
Specifies the primary step variable parameters
name: <step-source>* string
The name of the SLC data source to use
low: <start-value>* float
The start value that the plot function will
step the value of the source from
high: <end-value>* float
The end value that the plot function will
step the value of the source to
steps: <number-of-steps>* integer
The number of steps that the plot function will
take to scan from low to high
SECNSTV {name, low, high, steps} structure
Specifies the secondary step variable parameters
name: <step-source>* string
The name of the SLC data source to use
low: <start-value>* float
The start value that the plot function will
step the value of the source from
high: <end-value>* float
The end value that the plot function will
step the value of the source to
steps: <number-of-steps>* integer
The number of steps that the plot function will
take to scan from low to high
BPMD <measurement-definition-number> integer
This specifies the timing profile of the acquisition.
Each BPMD corresponds to exactly one DGRP.

To find likely BPMDs, go to the BPM Device panel
of a SCP and hit the 'HELP' button.
Then select the button corresponding to
the bpm orbit you would have wanted
to see.
The button name for that acquisition, as displayed
in the help, is the BPMD for the selected orbit. Use
that number for this parameter.

Eg, for 'HER Bunch train' BPMD=38.
NRPOS <number-of-pulses> positive integer
1 =< N >= 10000
This is the number of pulses to average BPM readings over
DTIZAVG Average DTIZ
MAGFUNC <trim-operation> Specifies trim operation
TRIM Perform a trim operation
PTRB Perform perturb operation
NOFUNC Perform neither a trim or perturb operation

Return value

Primary and secondary step variables will be returned in a table along with an arbitrary number of sample variable columns. Sample variable fields are named sample<samp-number>, e.g. sample1, sample2, sample3 and so on with the table field label being the name of the sampled variable.

If the field is not a TIME, ATIME (absolute time), or SAMP field, an extra OK and Error column will be returned. The name of these fields will be constructed by concatenating OK and Error to the respective field names. e.g. sample1OK, sample3Error, primaryOK, secondaryError. The label names for these columns are appended with " OK?" and " Error" respectively.

TYPE Return Column / Label Column Type Description
TABLE primary/
<name-of-primary-step-variable>
FLOAT_ARRAY value of the primary
step variable for
this step
primaryOK /
<name-of-primary-step-variable> OK?
BOOLEAN_ARRAY If the primary step
variable is not
TIME, ATIME, or
SAMP, this field is
included and
indicates whether
the primary step
variable was set
correctly
primaryError /
<name-of-primary-step-variable> Error
FLOAT_ARRAY If the primary step
variable is not
TIME, ATIME, or
SAMP, this field is
included and
indicates the error
in the setting
secondary /
<name-of-secondary-step-variable>
FLOAT_ARRAY value of the secondary
step variable for
this step. If no
secondary step value
is defined then this
column will be
omitted from the
output table
secondaryOK /
<name-of-secondary-step-variable> OK?
BOOLEAN_ARRAY If the secondary step
variable is not
TIME, ATIME, or
SAMP, this field is
included and
indicates whether the
secondary step
variable was set
correctly
secondaryError /
<name-of-secondary-step-variable> Error
FLOAT_ARRAY If the secondary step
variable is not
TIME, ATIME, or
SAMP, this field is
included and
indicates the error in
the setting
sample<samp-number> /
<name-of-sample-variable>
FLOAT_ARRAY Column names are
created by
concatenating
"sample" with the
sample number.
e.g. first non-ZERO
sample variable will
be called: sample1 .
The label of the
field will be set to
the sample SLC data
source name. e.g.
BPMS:LI20:2445:TMIT
sample<samp-number>OK /
<name-of-sample-variable> OK?
BOOLEAN_ARRAY If this sample
variable is not
TIME, ATIME, or
SAMP, this field
is included and
indicates the
whether the value
was read correctly
sample<samp-number>Error /
<name-of-sample-variable> Error
FLOAT_ARRAY If this sample
variable is not
TIME, ATIME, or
SAMP, this field is
included and
indicates the error in the
reading
... ... Repeat for each
sample variable

Examples

Operations

  • CORRPLOT:SCAN FILE=CRRSIMPL.BTN PRIMSTV={"name": "TIME", "low": 0.5, "high": 1.0, "steps": 10}
  • CORRPLOT:SCAN FILE=FACET_BPMS.BTN PRIMSTV={"name": "KLYS:LI31:31:PDES", "low": 0.5, "high": 1.0, "steps": 6} BPMD=57 NRPOS=1

Response

KLYS:LI31:31:PDES KLYS:LI31:31:PDES OK? KLYS:LI31:31:PDES Error? BPMS:LI20:2445:X BPMS:LI20:2445:X OK? BPMS:LI20:2445:X Error BPMS:LI20:2445:Y BPMS:LI20:2445:Y OK? BPMS:LI20:2445:Y Error
primary primaryOK primaryError sample1 sample1OK sample1Error sample2 sample2OK sample2Error
0.5 1 0.00001 0.103910382 1 0.0000002 0.9549588893 1 0.0000009
0.6 1 0.00001 0.103910383 1 0.0000003 0.9549588892 1 0.0000009
0.7 1 0.00001 0.103910384 1 0.0000004 0.9549588891 1 0.0000009
0.8 1 0.00001 0.103910385 1 0.0000005 0.9549588880 1 0.0000008
0.9 1 0.00001 0.103910386 1 0.0000006 0.9549588889 1 0.0000008
1.0 1 0.00001 0.103910387 1 0.0000007 0.9549588888 1 0.0000008

Increasing timeout for AIDA-PVA requests

For requests that can take a long time you may need to increase the request timeout. Depending on how you are accessing AIDA-PVA the method you use to do this will vary.

method Steps
matlab 1. Add the timeout() to the builder

e.g. .timeout(30)
aida-pva-client 1. Add the timeout() to the builder

e.g. .timeout(30)
pvaClient 1. Add the timeout field to query

e.g. .addQueryInt("timeout")

2. Set timeout field to desired value

e.g. uri.getQuery().getIntField("timeout").put(30)

3. Set pvaClient timeout

e.g. client.channel(pvName, "pva", 30.0)
PvAccess 1. Add the timeout field to query


e.g. .addQueryInt("timeout")

2. Set timeout field to desired value

e.g. uri.getQuery().getIntField("timeout").put(30)

3. Set pvAccess timeout when executing

e.g. client.request(uri.getPVStructure(), 30.0)
pvcall 1. Add the timeout field to query

e.g. ... TIMEOUT=30

2. Set pvcall timeout when executing

e.g. pvcall -w 30 ...
eget 1. Add the timeout field to query

e.g. ... TIMEOUT=30

2. Set eget timeout when executing

e.g. eget -w 30 ...

CLI and Code Examples

Commandline Examples

example typeexample

pvcall

pvcall "TRIG:LI31:109:TACT" BEAM=1 TYPE=SHORT
pvcall "TRIG:LI31:109:TACT" BEAM=1 TYPE=LONG
pvcall "TRIG:LI31:109:TACT" BEAM=1 TYPE=STRING
pvcall "TRIG:LI31:109:TACT" BEAM=1 VALUE=0
pvcall "MKB:VAL" MKB='mkb:li02b_xb.mkb' VALUE=1.0
pvcall "BGRP:VAL" BGRP=LCLS VARNAME=T_CAV VALUE='Yes'
pvcall "FBCK:LI18:28:LOOP_STAT" TYPE=BOOLEAN
pvcall "FBCK:LI18:28:LOOP_STAT" TYPE=SHORT
pvcall "FBCK:LI18:28:LOOP_STAT" TYPE=INTEGER
pvcall "FBCK:LI18:28:LOOP_STAT" TYPE=LONG
pvcall "FBCK:LI18:28:LOOP_STAT" TYPE=STRING
pvcall "FBCK:LI18:28:LOOP_STAT" VALUE='feedback'
pvcall "CORRPLOT:SCAN" FILE='FACET_BPMS.BTN' PRIMSTV='{"name": "KLYS:LI31:31:PDES", "low": 0.5, "high": 1.0, "steps": 6}'

eget

eget -s TRIG:LI31:109:TACT -a BEAM 1 -a TYPE SHORT
eget -s TRIG:LI31:109:TACT -a BEAM 1 -a TYPE LONG
eget -s TRIG:LI31:109:TACT -a BEAM 1 -a TYPE STRING
eget -s TRIG:LI31:109:TACT -a BEAM 1 VALUE 0
eget -s FBCK:LI18:28:LOOP_STAT 1 VALUE compute
eget -s MKB:VAL -a MKB 'mkb:li02b_xb.mkb' -a VALUE 1.0
eget -s BGRP:VAL -a BGRP LCLS -a VARNAME T_CAV -a VALUE=Y
eget -s FBCK:LI18:28:LOOP_STAT -a TYPE BOOLEAN
eget -s FBCK:LI18:28:LOOP_STAT -a TYPE SHORT
eget -s FBCK:LI18:28:LOOP_STAT -a TYPE INTEGER
eget -s FBCK:LI18:28:LOOP_STAT -a TYPE LONG
eget -s FBCK:LI18:28:LOOP_STAT -a TYPE STRING
eget -s FBCK:LI18:28:LOOP_STAT -a VALUE 'FEEDBACK'
eget -s CORRPLOT:SCAN -a FILE 'FACET_BPMS.BTN' -a PRIMSTV '{"name": "KLYS:LI31:31:PDES", "low": 0.5, "high": 1.0, "steps": 6}'

Matlab Examples

Note
For general details about accessing AIDA-PVA from matlab see User Guide for Matlab Users
example

try
builder = pvaRequest('TRIG:LI31:109:TACT');
builder.with('BEAM', 1);
builder.returning(AIDA_SHORT)
shortResponse = builder.get()
catch e
handleExceptions(e);
end
shortResponse =
0
try
builder = pvaRequest('TRIG:LI31:109:TACT');
builder.with('BEAM', 1);
builder.returning(AIDA_LONG)
longResponse = builder.get()
catch e
handleExceptions(e);
end
longResponse =
0
try
builder = pvaRequest('TRIG:LI31:109:TACT');
builder.with('BEAM', 1);
builder.returning(AIDA_STRING)
stringResponse = builder.get()
catch e
handleExceptions(e);
end
stringResponse =
deactivated
try
builder = pvaRequest('TRIG:LI31:109:TACT');
builder.with('BEAM', 1);
tableResponse = ML(builder.set(0))
catch e
handleExceptions(e);
end
tableResponse =
size: 1
labels: {'value'}
units: []
descriptions: []
fieldnames: {'value'}
values: [1x1 struct]
try
builder = pvaRequest('MKB:VAL');
builder.with('MKB', 'mkb:li02b_xb.mkb');
tableResponse = ML(builder.set(1.0))
catch e
handleExceptions(e);
end
tableResponse =
size: 1
labels: {'value'}
units: []
descriptions: []
fieldnames: {'value'}
values: [1x1 struct]
try
builder = pvaRequest('BGRP:VAL');
builder.with('BGRP', 'LCLS');
builder.with('VARNAME', 'T_CAV');
builder.set('Y')
catch e
handleExceptions(e);
end
try
builder = pvaRequest('FBCK:LI18:28:LOOP_STAT');
builder.returning(AIDA_BOOLEAN)
booleanResponse = builder.get()
catch e
handleExceptions(e);
end
booleanResponse =
true
try
builder = pvaRequest('FBCK:LI18:28:LOOP_STAT');
builder.returning(AIDA_SHORT)
shortResponse = builder.get()
catch e
handleExceptions(e);
end
shortResponse =
0
try
builder = pvaRequest('FBCK:LI18:28:LOOP_STAT');
builder.returning(AIDA_LONG)
longResponse = builder.get()
catch e
handleExceptions(e);
end
longResponse =
1
try
builder = pvaRequest('FBCK:LI18:28:LOOP_STAT');
builder.returning(AIDA_STRING)
stringResponse = builder.get()
catch e
handleExceptions(e);
end
stringResponse =
feedback
try
pvaSet('FBCK:LI18:28:LOOP_STAT', 'compute');
catch e
handleExceptions(e);
end
try
builder = pvaRequest('CORRPLOT:SCAN"');
builder.with('FILE', 'FACET_BPMS.BTN');
jstruct = AidaPvaStruct();
jstruct.put('name', { 'KLYS:LI31:31:PDES'});
jstruct.put('low', { 0.5 } );
jstruct.put('high', { 1.0 } );
jstruct.put('steps', { 6 } );
builder.with('PRIMSTV', jstruct);
builder.timeout(30);
tableResponse = ML(builder.get())
catch e
handleExceptions(e);
end
tableResponse =
size: 6
labels: {'KLYS:LI31:31:PDES' 'BPMS:LI20:2445:X' 'BPMS:LI20:2445:Y' 'BPMS:LI20:2445:TMITS'}
units: []
descriptions: []
fieldnames: {'primary' 'samp1' 'samp2' 'samp3' }
values: [1x1 struct]
tableResponse.values
ans =
primary: [0.5 0.6 0.7 0.8 0.9 1.0]
samp1: [0.103910382 0.103910383 0.103910384 0.103910385 0.103910386 0.103910387 ]
samp2: [0.9549588893 0.9549588892 0.9549588891 0.9549588880 0.9549588889 0.9549588888]
samp3: [0.0000000012 0.0000000013 0.0000000014 0.0000000015 0.0000000016 0.0000000017]

Java Examples

example typeexample

AidaPvaClient

import edu.stanford.slac.aida.client.PvaTable;
import org.epics.pvaccess.server.rpc.RPCRequestException;
import java.util.HashMap;
import java.util.Map;
import static edu.stanford.slac.aida.client.AidaPvaClientUtils.*;
import static edu.stanford.slac.aida.client.AidaType.*;
public class Example {
public Short getTrigStatusShort() throws RPCRequestException {
return (Short) pvaRequest("TRIG:LI31:109:TACT")
.with("BEAM", 1)
.returning(AIDA_SHORT)
.get();
}
public Long getTrigStatusLong() throws RPCRequestException {
return (Long) pvaRequest("TRIG:LI31:109:TACT")
.with("BEAM", 1)
.returning(AIDA_LONG)
.get();
}
public String getTrigStatusString() throws RPCRequestException {
return (String) pvaRequest("TRIG:LI31:109:TACT")
.with("BEAM", 1)
.returning(AIDA_STRING)
.get();
}
public PvaTable setTrigStatusStatus(Integer status) throws RPCRequestException {
return pvaRequest("TRIG:LI31:109:TACT")
.with("BEAM", 1)
.set(status);
}
public PvaTable turnKnob(Float turnAmount) throws RPCRequestException {
return pvaRequest("MKB:VAL")
.with("MKB", "MKB:LI02B_XB.MKB")
.set(turnAmount);
}
public void setBgrp(Boolean value) throws RPCRequestException {
pvaRequest("BGRP:VAL")
.with("BGRP", "LCLS")
.with("VARNAME", "T_CAV")
.set(value);
}
public Boolean getFeedbackStatusBoolean() throws RPCRequestException {
return (Boolean) pvaGet("FBCK:LI18:28:LOOP_STAT", AIDA_BOOLEAN);
}
public Short getFeedbackStatusShort() throws RPCRequestException {
return (Short) pvaGet("FBCK:LI18:28:LOOP_STAT", AIDA_SHORT);
}
public Long getFeedbackStatusLong() throws RPCRequestException {
return (Long) pvaGet("FBCK:LI18:28:LOOP_STAT", AIDA_LONG);
}
public String getFeedbackStatusString() throws RPCRequestException {
return (String) pvaGet("FBCK:LI18:28:LOOP_STAT", AIDA_STRING);
}
public void setFeedbackStatus(String status) throws RPCRequestException {
pvaSet("FBCK:LI18:28:LOOP_STAT", status);
}
public PvaTable getCorrelatedPlot() throws RPCRequestException {
Map<String, Object> primStepVar = new HashMap<String, Object>();
primStepVar.put("name", "KLYS:LI31:31:PDES");
primStepVar.put("low", 0.5);
primStepVar.put("high", 1.0);
primStepVar.put("steps", 6);
return (PvaTable) pvaRequest("CORRPLOT:SCAN")
.with("FILE", "FACET_BPMS.BTN")
.with("PRIMSTV", primStepVar)
.get();
}
}

PvaClient

import org.epics.nt.NTURI;
import org.epics.pvaClient.PvaClient;
import org.epics.pvaClient.PvaClientChannel;
import org.epics.pvaccess.client.rpc.RPCClientImpl;
import org.epics.pvaccess.server.rpc.RPCRequestException;
import org.epics.pvdata.pv.*;
public class Example {
public Short getTrigStatusShort() throws RPCRequestException {
String pvName = "TRIG:LI31:109:TACT";
NTURI uri = NTURI.createBuilder()
.addQueryString("type")
.addQueryInt("beam")
.create();
uri.getPath().put(pvName);
uri.getQuery().getStringField("type").put("SHORT");
uri.getQuery().getIntField("beam").put(1);
PvaClient client = PvaClient.get("pva");
PvaClientChannel channel = client.createChannel(pvName);
PVStructure response = channel.rpc(uri.getPVStructure());
PVShort field = response.getSubField(PVShort.class, "value");
return field.get();
}
public Long getTrigStatusLong() throws RPCRequestException {
String pvName = "TRIG:LI31:109:TACT";
NTURI uri = NTURI.createBuilder()
.addQueryString("type")
.addQueryInt("beam")
.create();
uri.getPath().put(pvName);
uri.getQuery().getStringField("type").put("LONG");
uri.getQuery().getIntField("beam").put(1);
PvaClient client = PvaClient.get("pva");
PvaClientChannel channel = client.createChannel(pvName);
PVStructure response = channel.rpc(uri.getPVStructure());
PVLong field = response.getSubField(PVLong.class, "value");
return field.get();
}
public String getTrigStatusString() throws RPCRequestException {
String pvName = "TRIG:LI31:109:TACT";
NTURI uri = NTURI.createBuilder()
.addQueryString("type")
.addQueryInt("beam")
.create();
uri.getPath().put(pvName);
uri.getQuery().getStringField("type").put("STRING");
uri.getQuery().getIntField("beam").put(1);
PvaClient client = PvaClient.get("pva");
PvaClientChannel channel = client.createChannel(pvName);
PVStructure response = channel.rpc(uri.getPVStructure());
PVString field = response.getSubField(PVString.class, "value");
return field.get();
}
public PVStructure setTrigStatusStatus(Integer status) throws RPCRequestException {
String pvName = "TRIG:LI31:109:TACT";
NTURI uri = NTURI.createBuilder()
.addQueryInt("value")
.addQueryInt("beam")
.create();
uri.getPath().put(pvName);
uri.getQuery().getIntField("value").put(status);
uri.getQuery().getIntField("beam").put(1);
PvaClient client = PvaClient.get("pva");
PvaClientChannel channel = client.createChannel(pvName);
return channel.rpc(uri.getPVStructure());
}
public PVStructure turnKnob(Float turnAmount) throws RPCRequestException {
String pvName = "MKB:VAL";
NTURI uri = NTURI.createBuilder()
.addQueryDouble("value")
.addQueryString("mkb")
.create();
uri.getPath().put(pvName);
uri.getQuery().getDoubleField("value").put(turnAmount);
uri.getQuery().getStringField("mkb").put("MKB:LI02B_XB.MKB");
PvaClient client = PvaClient.get("pva");
PvaClientChannel channel = client.createChannel(pvName);
return channel.rpc(uri.getPVStructure());
}
public void setBgrp(Boolean value) throws RPCRequestException {
String pvName = "BGRP:VAL";
NTURI uri = NTURI.createBuilder()
.addQueryDouble("value")
.addQueryString("bgrp")
.addQueryString("varname")
.create();
uri.getPath().put(pvName);
uri.getQuery().getStringField("value").put(value.toString());
uri.getQuery().getStringField("bgrp").put("LCLS");
uri.getQuery().getStringField("varname").put("T_CAV");
PvaClient client = PvaClient.get("pva");
PvaClientChannel channel = client.createChannel(pvName);
channel.rpc(uri.getPVStructure());
}
public Boolean getFeedbackStatusBoolean() throws RPCRequestException {
String pvName = "FBCK:LI18:28:LOOP_STAT";
NTURI uri = NTURI.createBuilder().addQueryString("type").create();
uri.getPath().put(pvName);
uri.getQuery().getStringField("type").put("BOOLEAN");
PvaClient client = PvaClient.get("pva");
PvaClientChannel channel = client.createChannel(pvName);
PVStructure response = channel.rpc(uri.getPVStructure());
PVBoolean field = response.getSubField(PVBoolean.class, "value");
return field.get();
}
public Short getFeedbackStatusShort() throws RPCRequestException {
String pvName = "FBCK:LI18:28:LOOP_STAT";
NTURI uri = NTURI.createBuilder().addQueryString("type").create();
uri.getPath().put(pvName);
uri.getQuery().getStringField("type").put("SHORT");
PvaClient client = PvaClient.get("pva");
PvaClientChannel channel = client.createChannel(pvName);
PVStructure response = channel.rpc(uri.getPVStructure());
PVShort field = response.getSubField(PVShort.class, "value");
return field.get();
}
public Long getFeedbackStatusLong() throws RPCRequestException {
String pvName = "FBCK:LI18:28:LOOP_STAT";
NTURI uri = NTURI.createBuilder().addQueryString("type").create();
uri.getPath().put(pvName);
uri.getQuery().getStringField("type").put("LONG");
PvaClient client = PvaClient.get("pva");
PvaClientChannel channel = client.createChannel(pvName);
PVStructure response = channel.rpc(uri.getPVStructure());
PVLong field = response.getSubField(PVLong.class, "value");
return field.get();
}
public String getFeedbackStatusString() throws RPCRequestException {
String pvName = "FBCK:LI18:28:LOOP_STAT";
NTURI uri = NTURI.createBuilder().addQueryString("type").create();
uri.getPath().put(pvName);
uri.getQuery().getStringField("type").put("STRING");
PvaClient client = PvaClient.get("pva");
PvaClientChannel channel = client.createChannel(pvName);
PVStructure response = channel.rpc(uri.getPVStructure());
PVString field = response.getSubField(PVString.class, "value");
return field.get();
}
public void setFeedbackStatus(String status) throws RPCRequestException {
String pvName = "FBCK:LI18:28:LOOP_STAT";
NTURI uri = NTURI.createBuilder().addQueryString("value").create();
uri.getPath().put(pvName);
uri.getQuery().getStringField("value").put(status);
PvaClient client = PvaClient.get("pva");
PvaClientChannel channel = client.createChannel(pvName);
channel.rpc(uri.getPVStructure());
}
public PVStructure getCorrelatedPlot() throws RPCRequestException {
String pvName = "CORRPLOT:SCAN";
NTURI uri = NTURI.createBuilder()
.addQueryString("file")
.addQueryString("primstv")
.create();
uri.getPath().put(pvName);
uri.getQuery().getStringField("file").put("FACET_BPMS.BTN");
uri.getQuery().getStringField("primstv").put("{\"name\": \"KLYS:LI31:31:PDES\", \"low\": 0.5, \"high\": 1.0, \"steps\": 6}");
RPCClientImpl client = new RPCClientImpl(pvName);
PVStructure response = client.request(uri.getPVStructure(), 30.0);
client.destroy();
return response;
}
}

PVAccess

import org.epics.nt.NTURI;
import org.epics.pvaccess.client.rpc.RPCClientImpl;
import org.epics.pvaccess.server.rpc.RPCRequestException;
import org.epics.pvdata.pv.*;
public class Example {
public Short getTrigStatusShort() throws RPCRequestException {
String pvName = "TRIG:LI31:109:TACT";
NTURI uri = NTURI.createBuilder()
.addQueryString("type")
.addQueryInt("beam")
.create();
uri.getPath().put(pvName);
uri.getQuery().getStringField("type").put("SHORT");
uri.getQuery().getIntField("beam").put(1);
RPCClientImpl client = new RPCClientImpl(pvName);
PVStructure response = client.request(uri.getPVStructure(), 3.0);
client.destroy();
PVShort field = response.getSubField(PVShort.class, "value");
return field.get();
}
public Long getTrigStatusLong() throws RPCRequestException {
String pvName = "TRIG:LI31:109:TACT";
NTURI uri = NTURI.createBuilder()
.addQueryString("type")
.addQueryInt("beam")
.create();
uri.getPath().put(pvName);
uri.getQuery().getStringField("type").put("LONG");
uri.getQuery().getIntField("beam").put(1);
RPCClientImpl client = new RPCClientImpl(pvName);
PVStructure response = client.request(uri.getPVStructure(), 3.0);
client.destroy();
PVLong field = response.getSubField(PVLong.class, "value");
return field.get();
}
public String getTrigStatusString() throws RPCRequestException {
String pvName = "TRIG:LI31:109:TACT";
NTURI uri = NTURI.createBuilder()
.addQueryString("type")
.addQueryInt("beam")
.create();
uri.getPath().put(pvName);
uri.getQuery().getStringField("type").put("STRING");
uri.getQuery().getIntField("beam").put(1);
RPCClientImpl client = new RPCClientImpl(pvName);
PVStructure response = client.request(uri.getPVStructure(), 3.0);
client.destroy();
PVString field = response.getSubField(PVString.class, "value");
return field.get();
}
public PVStructure setTrigStatusStatus(Integer status) throws RPCRequestException {
String pvName = "TRIG:LI31:109:TACT";
NTURI uri = NTURI.createBuilder()
.addQueryInt("value")
.addQueryInt("beam")
.create();
uri.getPath().put(pvName);
uri.getQuery().getIntField("value").put(status);
uri.getQuery().getIntField("beam").put(1);
RPCClientImpl client = new RPCClientImpl(pvName);
PVStructure response = client.request(uri.getPVStructure(), 30.0);
client.destroy();
return response;
}
public PVStructure turnKnob(Float turnAmount) throws RPCRequestException {
String pvName = "MKB:VAL";
NTURI uri = NTURI.createBuilder()
.addQueryDouble("value")
.addQueryString("mkb")
.create();
uri.getPath().put(pvName);
uri.getQuery().getDoubleField("value").put(turnAmount);
uri.getQuery().getStringField("mkb").put("MKB:LI02B_XB.MKB");
RPCClientImpl client = new RPCClientImpl(pvName);
PVStructure response = client.request(uri.getPVStructure(), 30.0);
client.destroy();
return response;
}
public void setBgrp(Boolean value) throws RPCRequestException {
String pvName = "BGRP:VAL";
NTURI uri = NTURI.createBuilder()
.addQueryDouble("value")
.addQueryString("bgrp")
.addQueryString("varname")
.create();
uri.getPath().put(pvName);
uri.getQuery().getStringField("value").put(value.toString());
uri.getQuery().getStringField("bgrp").put("LCLS");
uri.getQuery().getStringField("varname").put("T_CAV");
RPCClientImpl client = new RPCClientImpl(pvName);
client.request(uri.getPVStructure(), 3.0);
client.destroy();
}
public Boolean getFeedbackStatusBoolean() throws RPCRequestException {
String pvName = "FBCK:LI18:28:LOOP_STAT";
NTURI uri = NTURI.createBuilder().addQueryString("type").create();
uri.getPath().put(pvName);
uri.getQuery().getStringField("type").put("BOOLEAN");
RPCClientImpl client = new RPCClientImpl(pvName);
PVStructure response = client.request(uri.getPVStructure(), 3.0);
client.destroy();
PVBoolean field = response.getSubField(PVBoolean.class, "value");
return field.get();
}
public Short getFeedbackStatusShort() throws RPCRequestException {
String pvName = "FBCK:LI18:28:LOOP_STAT";
NTURI uri = NTURI.createBuilder().addQueryString("type").create();
uri.getPath().put(pvName);
uri.getQuery().getStringField("type").put("SHORT");
RPCClientImpl client = new RPCClientImpl(pvName);
PVStructure response = client.request(uri.getPVStructure(), 3.0);
client.destroy();
PVShort field = response.getSubField(PVShort.class, "value");
return field.get();
}
public Long getFeedbackStatusLong() throws RPCRequestException {
String pvName = "FBCK:LI18:28:LOOP_STAT";
NTURI uri = NTURI.createBuilder().addQueryString("type").create();
uri.getPath().put(pvName);
uri.getQuery().getStringField("type").put("LONG");
RPCClientImpl client = new RPCClientImpl(pvName);
PVStructure response = client.request(uri.getPVStructure(), 3.0);
client.destroy();
PVLong field = response.getSubField(PVLong.class, "value");
return field.get();
}
public String getFeedbackStatusString() throws RPCRequestException {
String pvName = "FBCK:LI18:28:LOOP_STAT";
NTURI uri = NTURI.createBuilder().addQueryString("type").create();
uri.getPath().put(pvName);
uri.getQuery().getStringField("type").put("STRING");
RPCClientImpl client = new RPCClientImpl(pvName);
PVStructure response = client.request(uri.getPVStructure(), 3.0);
client.destroy();
PVString field = response.getSubField(PVString.class, "value");
return field.get();
}
public void setFeedbackStatus(String status) throws RPCRequestException {
String pvName = "FBCK:LI18:28:LOOP_STAT";
NTURI uri = NTURI.createBuilder().addQueryString("value").create();
uri.getPath().put(pvName);
uri.getQuery().getStringField("value").put(status);
RPCClientImpl client = new RPCClientImpl(pvName);
client.request(uri.getPVStructure(), 3.0);
client.destroy();
}
public PVStructure getCorrelatedPlot() throws RPCRequestException {
String pvName = "CORRPLOT:SCAN";
NTURI uri = NTURI.createBuilder()
.addQueryString("file")
.addQueryString("primstv")
.create();
uri.getPath().put(pvName);
uri.getQuery().getStringField("file").put("FACET_BPMS.BTN");
uri.getQuery().getStringField("primstv").put("{\"name\": \"KLYS:LI31:31:PDES\", \"low\": 0.5, \"high\": 1.0, \"steps\": 6}");
RPCClientImpl client = new RPCClientImpl(pvName);
PVStructure response = client.request(uri.getPVStructure(), 30.0);
client.destroy();
return response;
}
}