Common Database patterns

From EPICSWIKI
Revision as of 16:35, 23 March 2010 by MichaelDavidsaver (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Combined Setting and Readback

Use when a single PV is desired. Could be used to show the results of rounding in a float to fixed precision conversion.

In the following example the value read from a 'bi' is inverted so that the associated 'bo' acts as a toggle.

record(bi, "$(P):rbv") {
  field(DTYP, "...")
  field(INP , "...")
  field(PINI, "YES")
  field(FLNK, "$(P):inv")
}
record(calcout, "$(P):inv")
  field(CALC, "!A")
  field(INPA, "$(P):rbv")
  field(OUT , "$(P) NPP")
}
record(bo, "$(P)") {
  field(DTYP, "...")
  field(OUT , "...")
  field(FLNK, "$(P):rbv")
}

The important point is the NPP modifier on output link of the 'calcout' record. This updates the VAL field of the 'bo' record (and posts monitors) without processing it.