Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Record types

Verified · no code on this page · docs-verify

The badge reports the whole docs-verify suite, not this chapter alone.

RecordType has seventeen variants (spvirit-server/src/types.rs:24). Not all seventeen are reachable by every route: the handle API, the server builder, and .db loading each cover a different subset. This page is that matrix, checked against the constructors that actually exist.

If you are not sure whether you want a record at all, read Records vs raw NT first.

The matrix

RecordEPICS meaningHandle APIBuilder.dbWritable
aianalog inPv::ai.ai()record(ai, …)no¹
aoanalog outPv::ao.ao()record(ao, …)yes
bibinary inPv::bi.bi()record(bi, …)no
bobinary outPv::bo.bo()record(bo, …)yes
longin32-bit integer inPv::longinno
longout32-bit integer outPv::longoutyes
stringinstring inPv::string_in.string_in()record(stringin, …)no
stringoutstring outPv::string_out.string_out()record(stringout, …)yes
mbbimulti-bit binary inPv::mbbi.mbbi()parses, then refused²yes³
mbbomulti-bit binary outPv::mbbo.mbbo()parses, then refused²yes³
waveformarrayPvArray::waveform.waveform()record(waveform, …)yes
aaiarray analog inPvArray::aai.aai()record(aai, …)no
aaoarray analog outPvArray::aao.aao()record(aao, …)yes
subArraywindow onto an array.sub_array()record(subarray, …)no
NtTabletable payload.nt_table()refused²yes⁴
NtNdArrayimage / detector frame.nt_ndarray()refused²yes⁴
Genericarbitrary structure.generic()refused²yes

¹ An ai becomes writable when SIMM is set — the simulation-mode path (spvirit-server/src/types.rs:308).

² RecordType::from_db_name maps twelve .db spellings, including mbbi (also spelled ntenum) and mbbo. Those two then reach an arm in spvirit-server/src/db.rs:550 that prints "is not a standard EPICS Base record type and cannot be loaded from .db files" and drops the record. mbbi and mbbo are standard EPICS Base record types; the message is wrong. See Known gaps.

³ Writable in the sense that the record accepts write access. A wire PUT of an enum index is currently dropped — see Known gaps.

⁴ Writable via a client PUT as well as store.put_nt(). The NtTable/ NtNdArray arms of RecordInstance::apply_put (spvirit-server/src/apply.rs:609) apply the wire fields and restamp the record.

Reading the columns

Handle APIPv<T> and PvArray constructors in spvirit-server/src/pv.rs. These give you a handle you keep after the server starts, so you can set(), scan(), calc() and on_put() on it. This is the level most of Part III works at.

BuilderPvaServer::builder().ai(…) and friends (spvirit-server/src/pva_server.rs). Declares records inline; you reach them afterwards through the store rather than through a handle. The builder is the only route to sub_array, nt_table, nt_ndarray and generic.

.db — text database files, as EPICS Base uses them. See Serving a .db file for the fields spvirit acts on.

Writable — whether the server grants write access (RecordInstance::writable, spvirit-server/src/types.rs:303). Output record types are always writable; a handful of input types are too, for the reasons in the footnotes. Everything else answers a PUT with Write access denied.

The derived record

Pv::calc (spvirit-server/src/pv.rs:392) is not a record type. It builds an ai whose value is recomputed from other Pv<f64> handles whenever one of them changes — the equivalent of a calc record's CALC expression, written as a Rust closure. The builder spelling is .link(output, inputs, compute).

Python

The Python module exposes the same handle-API set: ai, ao, bi, bo, string_in, string_out, longin, longout, mbbi, mbbo, waveform, aai, aao, calc, plus the generic pv and scalar constructors (spvirit-py/src/lib.rs:54). See Python API.