Hi all,
I am looking for some tips on the best way to implement logic such as
the following using EPICS records:
flag = 1;
for (each new set of readings) {
if (readbackA == fixedVal1) flag = 1; else
if (flag == 1) setVal = readbackB; else
if (readBackC == fixedVal2) setVal = readbackD;
flag = 0;
}
For the initial setting I figured simply a record that includes the
initial value in the VAL field (and PINI set to "Yes"?).
The for "loop" would be simply an FLNK in the record (or last in a
sequence of records) that gets the new readings, triggering the
processing of the the record that handles the 1st if condition (in this
case, I have one record that gets them all at once).
At that point how to best to proceed is not obvious to me, and there are
probably lots of possibilities (A sequence of calcout or scalcout
records? Maybe a transform record?)
Suggestions?
--
Mark Davis
NSCL/FRIB Control Systems Software Engineer
[email protected]