By default QSRV exposes all Process Variables (fields of process database records). In addition to these "single" PVs are special "group" PVs.
"single" PVs are the same set of names server by the Channel Access server (RSRV). This is all accessible record fields. So all data which is accessible via Channel Access is also accessible via PVAccess.
QSRV presents all "single" PVs as Structures conforming to the Normative Types NTScalar, NTScalarArray, or NTEnum depending on the native DBF field type.
A group is defined using a JSON syntax. Groups are defined with respect to a Group Name, which is also the PV name. So unlike records, the "field" of a group have a different meaning. Group field names are not part of the PV name.
A group definition may be split among several records, or included in separate JSON file(s).
For example of a group including two records is:
Or equivalently with separate .db file and .json files.
This group, named "grp:name", has two fields "X" and "Y".
The "scalar" mapping places an NTScalar or NTScalarArray as a sub-structure.
The "plain" mapping ignores all meta-data and places only the "value" as a field. The "value" is equivalent to '.value' of the equivalent NTScalar/NTScalarArray as a field.
The "any" mapping places a variant union into which the "value" is placed.
The "meta" mapping ignores the "value" and places only the alarm and time meta-data as sub-fields. Placing an entry in a blank field name '"": {+type:"meta"}' allows these meta-data fields to be placed in the top-level structure.
The "proc" mapping uses neither "value" nor meta-data. Instead the target record is processed during a put.
The "structure" mapping allows an "+id" to be attached without a "+channel". So none of "+channel", "+trigger", nor "+putorder" are meaningful for a "structure" mapping.
The field triggers define how changes to the consitutent field are translated into a subscription update to the group.
The most use of these are "" which means that changes to the field are ignored, and do not result group update. And "*" which results in a group update containing the most recent values/meta-data of all fields.
It may be useful to specify a comma seperated list of field names so that changes may partially update the group.
QSRV has the ability to perform certain transformations on the timestamp before transporting it. The mechanism for configuring this is the "Q:time:tag" info() tag.
Setting "Q:time:tag" to a value of "nsec:lsb:#", where # is a number between 0 and 32, will split the nanoseconds value stored in the associated record. The least significant # bits are stored in the 'timeStamp.userTag' field. While the remaining 32-# bits are stored in 'timeStamp.nanoseconds' (without shifting).
For example, in the following situation 20 bits are split off into userTag. If the nanoseconds part of the record timestamp is 0x12345678, then the PVD structure would include "timeStamp.nanoseconds=0x12300000" and "timeStamp.userTag=0x45678".
The value of the OPI display form hint ('display.form') can be set set with the "Q:form" info() tag. This hint, along with 'display.precision', is used by some OPI clients to control how values are rendered.
The text value of the tag must be one of the following choices.
QSRV will enforce an optional access control policy file (.acf) loaded by the usual means (cf. asSetFilename() ). This policy is applied to both Single and Group PVs. With Group PVs, restrictions are not defined for the group, but rather for the individual member records. The same policy will be applied regardess of how a record is accessed (individually, or through a group).
Policy application differs from CA (RSRV) in several ways:
Client hostname is always the numeric IP address. HAG() entries must either contained numeric IP addresses, or that asCheckClientIP=1 flag must be set to translate hostnames into IPs on ACF file load (effects CA server as well). This prevents clients from trivially forging "hostname". In additional to client usernames. UAG definitions may contained items beginning with "role/" which are matched against the list of groups of which the client username is a member. Username to group lookup is done internally to QSRV, and depends on IOC host authentication configuration. Note that this is still based on the client provided username string.
The "special" UAG will match CA or PVA clients with the username "someone". It will also match a PVA client if the client provided username is a member of the "op" group (supported on POSIX targets and Windows).
When built against Base >= 3.16.1, support is enabled for PVAccess links, which are analogous to Channel Access (CA) links. However, the syntax for PVA links is quite different.
A simple configuration using defaults is
This is a shorthand for
Some additional keys (beyond "pv") may be used. Defaults are shown below:
The PV name to search for. This is the same name which could be used with 'pvget' or other client tools.
The name of a sub-field of the remotely provided Structure. By default, an empty string "" uses the top-level Structure.
If the top level structure, or a sub-structure is selected, then it is expeccted to conform to NTScalar, NTScalarArray, or NTEnum to extract value and meta-data.
If the sub-field is an PVScalar or PVScalarArray, then a value will be taken from it, but not meta-data will be available.
When true, link will not connect unless the named PV is provided by the local (QSRV) data provider.
Requests a certain monitor queue depth. The server may, or may not, take this into consideration when selecting a queue depth.
Expect that the server supports PVA monitor flow control. If not, then the subscription will stall (ick.)
The meaning of this option depends on the direction of the link.
For output links, this option allows a request for remote processing (side-effects).
For input links, this option controls whether the record containing the PVA link will be processed when subscription events are received.
This option controls whether reading a value from an input PVA link has the addition effect of propagating any alarm via the Maximize Severity process.
Somewhat analogous to sevr: applied to timestamp. When true, the record TIME field is updated when the link value is read.
When multiple record target the same target PV, and request processing on subscription updates. This option allows the order of processing to be specified.
Record are processed in increasing order. monorder=-1 is processed before monorder=0. Both are processed before monorder=1.
By default (defer=false) an output link will immediately start a PVA Put operation. defer=true will store the new value in an internal cache, but not start a PVA Put.
This option, in combination with field: allows a single Put to contain updates to multiple sub-fields.
Allow a Put operation to be queued while the link is disconnected. The Put will be executed when the link becomes connected.
By default (always:false) a subscription update will only cause a CP input link to scan if the structure field (cf. field: option) is marked as changed. Set to true to override this, and always process the link.
This section attempts to answer some questions about how links behave in certain situations.
Links are evaluated in three basic contexts.
An input link can bring in a Value as well as meta-data, alarm, time, and display/control info. For input links, the PVA link engine attempts to always maintain consistency between Value, alarm, and time. However, consistency between these, and the display/control info is only ensured during a CP scan.