By default objects and add-ons do not have an output for any active error number, but they provide an array with all active events. By checking for an specific event you can program a specific behaviour.
This is how to realize it in an application:
Declaration:
Implementation in an waiting step after command execution:
PS: If the object or add-on do not provide a special functionality it is not possible to "mute" specific events or acknowledge them automatically.
Source code for copying:
VAR /// temporary FB instance with list of currently active events _eventQuery : OpconEventQuery; /// flag if a special event is currently active (found in query) _eventFound : BOOL; /// temporary counter of FOR loop _i : DINT; /// compared OOIDs are equal _equalOoids : BOOL; END_VAR -------------------------------------------------------------- IF( Station.PcdAccess.ExecState = OpconExecState.DONE ) THEN Station.PcdAccess.Execute := FALSE; _retVal := OK; ELSIF( Station.PcdAccess.ExecState = OpconExecState.ERROR ) THEN Station.PcdAccess.Execute := FALSE; // get currently active errors Station.PcdAccess.GetPendingEvents(OpconEventQueryType.ERROR, _eventQuery); // search for error "unkown identifier" _eventFound := FALSE; FOR _i := 1 TO _eventQuery.UsedEntries DO IF( _eventQuery.Entry[_i].Number = PcdAccessServerEvents.ERR_UNKOWN_ID ) THEN // OOID must also be compared because event numbers are not unique _equalOoids := OpconObjectIdIsEqual(_eventQuery.Entry[_i].ObjectId, PcdAccessConstants.OOID); IF( _equalOoids ) THEN _eventFound := TRUE; EXIT; END_IF END_IF END_FOR IF( _eventFound ) THEN // create new part if it doesn't exist on PCD server _retVal := JUMP1; ELSE // any other error -> stop automatic chain _env.ChainControl := OpconChainControl.ERROR; END_IF END_IF
... View more