Cosylab / nds3_epics

EPICS module for NDS3
GNU General Public License v3.0
0 stars 5 forks source link

PVAction writes back the result to the "calling" PV. #12

Open NickeZ opened 7 years ago

NickeZ commented 7 years ago

Currently the generated db is something like below. This means that the result of the RPC is written back to the first PV. This makes sense in some cases, but is not correct in other cases.

The idea would be that the action PV (test1-Square) is set to 1, to initiate the action, and then it would drop back to 0, to indicate completion. But since we have the readback PV, this is not required. I see two possibilities:

1) we have a boolean action, where you set it, and then it resets itself. In this case, explicitly calling setValueBack is not even necessary. 2) we have any other kind of action, which is essentially a function receiving an input, which outputs the value through the feedback record. In this case, the action PV would not be "reset" via the database.

$ cat /tmp/fileOuiqAt
record(longin, "test1-Square_r") {
    field(DESC, "Feedback for test1-Square")
    field(DTYP, "asynInt32")
    field(SCAN, "I/O Intr")
    field(INP, "@asyn(test1, 0)Square_r")
}
record(longout, "test1-Square") {
    field(DESC, "Soft trigger to acquire data.")
    field(DTYP, "asynInt32")
    field(SCAN, "Passive")
    field(OUT, "@asyn(test1, 0)Square")
}
record(longin, "test1-Square_r") {
    field(FLNK, "test1-Square_c")
}
record(calcout, "test1-Square_c") {
    field(DESC, "Calculation fortest1-Square")
    field(SCAN, "Passive")
    field(INPA, "test1-Square_r")
    field(CALC, "A")
    field(OOPT, "Every Time")
    field(OUT, "test1-Square")
}