From b4d2cdb79852f936b7262864470deddbc9ef8d28 Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Mon, 21 Oct 2024 09:46:17 +0200 Subject: [PATCH] Don't process writeComplete on struct elements that have not been written If writing to an optstruct or union, processing the records for all elements, not only the one that has been written to, with a writeComplete callback would clear errors for non-existing options and not selected choices. This clears the INVALID alarm for those elements. This becomes visible only if the value did not change and thus the optsruct or union did not send back a monitor update. --- devOpcuaSup/RecordConnector.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/devOpcuaSup/RecordConnector.cpp b/devOpcuaSup/RecordConnector.cpp index c2c6bff4..590683d5 100644 --- a/devOpcuaSup/RecordConnector.cpp +++ b/devOpcuaSup/RecordConnector.cpp @@ -96,6 +96,10 @@ void processCallback (epicsCallback *pcallback, const ProcessReason reason) prec = static_cast(pUsr); if (!prec || !prec->dpvt) return; + // Do not process writeComplete on struct elements that have not been written + if (reason == writeComplete && !prec->pact) + return; + RecordConnector *pvt = static_cast(prec->dpvt); dbScanLock(prec); ProcessReason oldreason = pvt->reason;