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.
|
This section describes what an AIDA-PVA user should know about accessing the SLC Utilities through AIDA-PVA. This data provider:
see Basic Users Guide to Aida, and the EPICS javadoc.
Supports get and set operations.
operation | info | instance & attribute |
---|---|---|
get | Syntax | <prim>:<micr>:<unit>:TACT |
Examples | TRIG:LI31:109:TACT | |
set | Syntax | <prim>:<micr>:<unit>:TACT |
Examples | TRIG:LI31:109:TACT | |
set | Syntax | MKB:VAL |
Examples | MKB:VAL | |
set | Syntax | BGRP:VAL |
Examples | BGRP:VAL | |
get | Syntax | <prim>:<micr>:<unit>:LOOP_STAT |
Examples | FBCK:LI18:28:LOOP_STAT | |
set | Syntax | <prim>:<micr>:<unit>:LOOP_STAT |
Examples | FBCK:LI18:28:LOOP_STAT |
Attribute | operation | Description |
---|---|---|
TACT | get | Gets a status code or a status string for the specified trigger device on a beam code |
TACT | set | Deactivates or reactivates a specified trigger device on a beam code |
VAL | set | Sets devices referenced in a specified multiknob file, which is a required parameter |
VAL | set | Sets a BGRP variable to a new value |
LOOP_STAT | get | Gets a code or a string that describes the status of the specified SCP transverse feedback |
LOOP_STAT | set | Sets the specified SCP transverse feedback to: off, sample, compute/on, actuate, dither, or feedback |
Parameters
Parameter Names | Parameter Values | Description |
---|---|---|
TYPE * | Determines the return type of the request | |
SHORT | return a short value. | |
LONG | return a short 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" |
Parameters
Parameter Names | Parameter Values | Description |
---|---|---|
VALUE * | Short | 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 => deactivated, 1 => activated |
Parameters
Parameter Names | Parameter 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 |
Parameters
Parameter Names | Parameter Values | Description |
---|---|---|
VALUE * | Boolean | specifying the new variable value "`N`" or "`Y`". |
BGRP * | String | The BGRP name |
VARNAME * | String | A BGRP variable name for the specified BGRP.. |
Return value
None
Parameters
Parameter Names | Parameter Values | Description |
---|---|---|
TYPE * | 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 | Description |
---|---|
BOOLEAN | A boolean value containing the SCP transverse feedback status code for the loop device: 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", "sample", "compute", "actuate", "dither", or "feedback" |
Parameters
Parameter Names | Parameter Values | Description |
---|---|---|
VALUE * | String | flag string indicating the desired state: "off" => off, "sample" => sample, "compute" => compute. "on" => compute, "actuate" => actuate, "dither" => dither. "feedback" => feedback. |
Return value
None
example type | action | example |
---|---|---|
commandline pvcall | Get |
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 "FBCK:LI18:28:LOOP_STAT" TYPE=BOOLEAN
pvcall "FBCK:LI18:28:LOOP_STAT" TYPE=SHORT
pvcall "FBCK:LI18:28:LOOP_STAT" TYPE=LONG
pvcall "FBCK:LI18:28:LOOP_STAT" TYPE=STRING
|
Set |
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" VALUE='feedback'
| |
commandline eget | Get |
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 FBCK:LI18:28:LOOP_STAT -a BEAM 1 -a TYPE BOOLEAN
eget -s FBCK:LI18:28:LOOP_STAT -a BEAM 1 -a TYPE SHORT
eget -s FBCK:LI18:28:LOOP_STAT -a BEAM 1 -a TYPE LONG
eget -s FBCK:LI18:28:LOOP_STAT -a BEAM 1 -a TYPE STRING
|
Set |
eget -s TRIG:LI31:109:TACT -a BEAM 1 VALUE 0
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 1 VALUE compute
|
action | example |
---|---|
Get |
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('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
|
Set |
try
builder = pvaRequest('TRIG:LI31:109:TACT');
builder.with('BEAM', 1);
trigResponse = builder.set(0)
catch e
handleExceptions(e);
end
try
builder = pvaRequest('MKB:VAL');
builder.with('MKB', 'mkb:li02b_xb.mkb');
mkbResponse = builder.set(1.0)
catch e
handleExceptions(e);
end
try
builder = pvaRequest('BGRP:VAL');
builder.with('BGRP', 'LCLS');
builder.with('VARNAME', 'T_CAV');
builder.set('Y')
catch e
handleExceptions(e);
end
try
pvaSet('FBCK:LI18:28:LOOP_STAT', 'compute');
catch e
handleExceptions(e);
end
|
example type | action | example |
---|---|---|
java AidaPvaClient | Get |
import org.epics.pvaccess.server.rpc.RPCRequestException;
import static edu.stanford.slac.aida.client.AidaPvaClientUtils.*;
import static edu.stanford.slac.aida.client.AidaType.*;
public class AidaPvaClientExample {
public void getValues() throws RPCException {
Short shortValue = pvaRequest("TRIG:LI31:109:TACT").with("BEAM", 1).returning(SHORT).get();
Long longValue = pvaRequest("TRIG:LI31:109:TACT").with("BEAM", 1).returning(LONG).get();
String stringValue = pvaRequest("TRIG:LI31:109:TACT").with("BEAM", 1).returning(STRING).get();
Boolean fbckBooleanValue = pvaRequest("FBCK:LI18:28:LOOP_STAT").returning(BOOLEAN).get();
Short fbckShortValue = pvaRequest("FBCK:LI18:28:LOOP_STAT").returning(SHORT).get();
Long fbckLongValue = pvaRequest("FBCK:LI18:28:LOOP_STAT").returning(LONG).get();
String fbckStringValue = pvaRequest("FBCK:LI18:28:LOOP_STAT").returning(STRING).get();
}
}
|
Set |
import org.epics.pvaccess.server.rpc.RPCRequestException;
import static edu.stanford.slac.aida.client.AidaPvaClientUtils.*;
import static edu.stanford.slac.aida.client.AidaType.*;
public class AidaPvaClientExample {
private static String FBCK_OFF = "OFF";
private static String FBCK_COMPUTE = "COMPUTE";
private static String FBCK_FEEDBACK = "FEEDBACK";
public void setValues() throws RPCException {
AidaTable tableValue = pvaRequest("TRIG:LI31:109:TACT").with("BEAM", 1).set(0);
Map<String, List<Object>> values = tableValue.getValues();
Short status = values.get("status").get(0);
tableValue = pvaRequest("MKB:VAL").with("MKB", 1).set('mkb:li02b_xb.mkb');
values = tableValue.getValues();
List<String> names = values.get("name");
List<Float> values = values.get("value");
pvaRequest("BGRP:VAL").with("BGRP", "LCLS").with("VARNAME", "T_CAV").set(TRUE);
pvaSet("FBCK:LI18:28:LOOP_STAT", FBCK_FEEDBACK);
}
}
| |
java PvaClient | Get |
import org.epics.pvaClient.*;
import org.epics.pvaccess.server.rpc.RPCRequestException;
import org.epics.pvdata.factory.FieldFactory;
import org.epics.pvdata.factory.PVDataFactory;
import org.epics.pvdata.pv.*;
public class PvaClientExample {
public void getValues() throws RPCRequestException {
String pvName = "TRIG:LI31:109:TACT";
Structure arguments = fieldCreate.createStructure(
new String[]{"beam", "type"},
new Field[]{
fieldCreate.createScalar(ScalarType.pvInt),
fieldCreate.createScalar(ScalarType.pvString)
});
Structure uriStructure = fieldCreate.createStructure(
new String[]{"path", "scheme", "query"},
new Field[]{
fieldCreate.createScalar(ScalarType.pvString),
fieldCreate.createScalar(ScalarType.pvString),
arguments
});
PVStructure request = dataCreate.createPVStructure(uriStructure);
request.getStringField("scheme").put("pva");
request.getStringField("path").put(pvName);
PVStructure args = request.getStringField("query");
args.getIntField("beam").put(1);
args.getStringField("type").put("SHORT");
PvaClient client = PvaClient.get("pva");
PvaClientChannel channel = client.createChannel(pvName);
args.getStringField("type").put("SHORT");
PVStructure response = channel.rpc(request);
PVShort shortField = response.getSubField(PVInt.class, "value");
Short shortValue = shortField.get();
args.getStringField("type").put("LONG");
response = channel.rpc(request);
PVLong longField = response.getSubField(PVLong.class, "value");
Long longValue = longField.get();
args.getStringField("type").put("STRING");
response = channel.rpc(request);
PVString stringField = response.getSubField(PVString.class, "value");
String stringValue = stringField.get();
}
}
|
Set |
import org.epics.pvaClient.*;
import org.epics.pvaccess.server.rpc.RPCRequestException;
import org.epics.pvdata.factory.FieldFactory;
import org.epics.pvdata.factory.PVDataFactory;
import org.epics.pvdata.pv.*;
public class PvaClientExample {
public void setValues() throws RPCRequestException {
String trigPvName = "TRIG:LI31:109:TACT";
String mkbPvName = "MKB:VAL";
String bgrpPvName = "BGRP:VAL";
Structure trigArguments = fieldCreate.createStructure(
new String[]{"beam", "value"},
new Field[]{
fieldCreate.createScalar(ScalarType.pvInt),
fieldCreate.createScalar(ScalarType.pvShort)
});
Structure mkbArguments = fieldCreate.createStructure(
new String[]{"mkb", "value"},
new Field[]{
fieldCreate.createScalar(ScalarType.pvInt),
fieldCreate.createScalar(ScalarType.pvString)
});
Structure bgrpArguments = fieldCreate.createStructure(
new String[]{"bgrp", "varname", "value",},
new Field[]{
fieldCreate.createScalar(ScalarType.pvString),
fieldCreate.createScalar(ScalarType.pvString),
fieldCreate.createScalar(ScalarType.pvBoolean)
});
PvaClient client;
PvaClientChannel channel;
PVStructure args, request, response, values;
Structure uriStructure;
// TRIG
uriStructure = fieldCreate.createStructure(
new String[]{"path", "scheme", "query"},
new Field[]{
fieldCreate.createScalar(ScalarType.pvString),
fieldCreate.createScalar(ScalarType.pvString),
trigArguments
});
request = dataCreate.createPVStructure(uriStructure);
request.getStringField("scheme").put("pva");
request.getStringField("path").put(trigPvName);
args = request.getStringField("query");
args.getIntField("beam").put(1);
args.getShortField("value").put(0);
client = PvaClient.get("pva");
channel = client.createChannel(trigPvName);
response = channel.rpc(request);
Short shortStatus = response
.getSubField(PVStructure.class, "value") // The values
.getSubField(PVShortArray.class, "status") // The status vector
.get() // As a PvArray
.getShort(0); // First entry
// MKB
uriStructure = fieldCreate.createStructure(
new String[]{"path", "scheme", "query"},
new Field[]{
fieldCreate.createScalar(ScalarType.pvString),
fieldCreate.createScalar(ScalarType.pvString),
mkbArguments
});
request = dataCreate.createPVStructure(uriStructure);
request.getStringField("scheme").put("pva");
request.getStringField("path").put(mkbPvName);
args = request.getStringField("query");
args.getIntField("mkb").put(1);
args.getStringField("value").put("mkb:li02b_xb.mkb");
client = PvaClient.get("pva");
channel = client.createChannel(mkbPvName);
response = channel.rpc(request);
values = response.getSubField(PVStructure.class, "value"); // The values
PVStringArray stringNames = values.getSubField(PVStringArray.class, "name");
PVFloatArray floatValues = values.getSubField(PVStringArray.class, "value");
// BGRP
uriStructure = fieldCreate.createStructure(
new String[]{"path", "scheme", "query"},
new Field[]{
fieldCreate.createScalar(ScalarType.pvString),
fieldCreate.createScalar(ScalarType.pvString),
bgrpArguments
});
request = dataCreate.createPVStructure(uriStructure);
request.getStringField("scheme").put("pva");
request.getStringField("path").put(bgrpPvName);
args = request.getStringField("query");
args.getStringField("bgrp").put("LCLS");
args.getStringField("varname").put("T_CAV");
args.getBooleanField("value").put(true);
client = PvaClient.get("pva");
channel = client.createChannel(bgrpPvName);
channel.rpc(request);
}
}
| |
java EasyPVA | Get/Set |
PvaClient client = PvaClient.get("pva");
PvaClientChannel channel = client.createChannel(pvName);
PVStructure response = channel.rpc(request);
EasyChannel channel = easypva.createChannel(pvName);
if (!channel.connect(5.0)){
throw new RuntimeException("Unable to connect");
}
EasyRPC easyrpc=channel.createRPC();
if(!easypva.getStatus().isOK()){
throw new RuntimeException("Unable to create RPC channel");
}
if(!easyrpc.connect()){
throw new RuntimeException("Unable to connect to RPC channel");
}
PVStructure response=easyrpc.request(request);
if(!easypva.getStatus().isOK()){
throw new RuntimeException("Unable to get data");
}
|
Get/Set |
PvaClient client = PvaClient.get("pva");
PvaClientChannel channel = client.createChannel(pvName);
PVStructure response = channel.rpc(request);
RPCClientImpl client = new RPCClientImpl(pvName);
PVStructure response = client.request(request, 3.0);
client.destroy();
|