Hey everyone,
I'm having a problem with a calcout record that seems to process before it has passed control to its input record(s). I have a database with two records,
record(calc, "Current:Coil") {
field(DESC, "Coil Current")
field(SCAN, "Passive")
field(MDEL, ".1")
field(ADEL, ".1")
field(INPA, "Current:Coil.VAL NPP")
field(INPB, "$(MUX)VOLT:Chan203.VAL PP MS")
field(CALC, "A + B")
field(PINI, "NO")
field(EGU, "A")
field(SDIS, "0")
}
record(calcout, "Voltage:Output") {
field(DESC, "Output Voltage")
field(SCAN, "Passive")
field(INPA, "Current:Coil.VAL PP MS")
field(OOPT, "Every Time")
field(DOPT, "Use CALC")
field(CALC, "A")
field(OUT, "$(VLTPROG)P25V.VAL PP MS")
field(PINI, "YES")
field(EGU, "V")
field(SDIS, "0")
}
and when I start my ioc, I get:
Starting iocInit
############################################################################
## EPICS R3.14.11 $R3-14-11$ $2009/08/28 18:47:36$
## EPICS Base built Sep 2 2010
############################################################################
2010/09/13 14:37:11.593 172.25.100.69:1234 write 32
MEAS:VOLT:DC? (@203)\n++read eoi\n
2010/09/13 14:37:11.593 172.25.100.97:1234 write 25
APPL P25V, 0.000000, 0.1\n
iocRun: All initialization complete
## Start any sequence programs
#seq sncxxx,"user=andrewwagnerHost"
epics> 2010/09/13 14:37:11.870 172.25.100.69:1234 read 16
+8.92303000E-04\n
It seems the calcout record processes at init (as desired) passes control to input A which issues the MEAS:VOLT:DC? command but doesn't wait for input A to actually return a value. Input A returns control to the calcout record too quickly so if I print the record I get:
epics> dbpr Voltage:Output
A: 0 ASG: B: 0 C: 0
CALC: A D: 0 DESC: Output Voltage
DISA: 0 DISP: 0 DISV: 1 DLYA: 0
E: 0 F: 0 G: 0 H: 0
I: 0 J: 0 K: 0 L: 0
NAME: Voltage:Output OCAL: 0 OEVT: 0
OVAL: 0 POVL: 0 PVAL: 0 SEVR: INVALID
STAT: LINK TPRO: 0 VAL: 0
with an INVALID LINK. How can I guarantee that control from the input is not passed back to the calcout record until it has finished measuring the voltage? Should I set SDIS "Current:Coil.PACT" ? Thanks very much for your help.
Andrew