Hello CodeShepherd, Thank you for your reply. The image was taken from RM 22.11 update on ctrlX PLC v1.18. Implemetation: // set diagnostics
MyDiagnostics.MainDiagnosticCode := 16#0A0A0115; // Plc iec info
MyDiagnostics.DetailedDiagnosticCode := 0;
MyDiagnostics.DynamicDescription := 'this is a iec-info-diagnostics';
MyDiagnostics.Entity := 'CompanyName';
SetDiagnostics(IecDiag:= MyDiagnostics );
MyDiagnostics.MainDiagnosticCode := 16#0A0F0115; // Plc iec error
MyDiagnostics.DetailedDiagnosticCode := 0;
MyDiagnostics.DynamicDescription:= 'this is a plc-error-diagnostics';
MyDiagnostics.Entity := 'BoschRexroth';
SetDiagnostics(IecDiag:=MyDiagnostics, Reset :=FALSE );
//get a list of all pending diagnostics
GetPendingDiagnostics(PendingElements=>MyPendingElements , PendingDiagnosticsList=>ReadPendingList );
// reset my diagnosites in the pending diagnostics
MyPendingDiagnostics.MainDiagnosticCode := 16#0A0F0115; // Plc iec error
MyPendingDiagnostics.DetailedDiagnosticCode := 0;
MyPendingDiagnostics.Entity := 'BoschRexroth';
MyResult:=ResetDiagnostics(IecDiag:= MyPendingDiagnostics );
// clear, delete my diagnostics in the pending diagnostics
MyPendingDiagnostics.MainDiagnosticCode := 16#0A0F0115; // Plc iec error
MyPendingDiagnostics.DetailedDiagnosticCode := 0;
MyPendingDiagnostics.Entity := 'BoschRexroth';
MyResult:=ClearDiagnostics (IecDiag:= MyPendingDiagnostics );
// read again all pending diagnostics -> my diagnostics must be deleted
GetPendingDiagnostics(PendingElements=>MyPendingElements , PendingDiagnosticsList=>ReadPendingList ); Here is my declaration: PROGRAM POU
VAR
MyDiagnostics: CXAC_Diagnostics.IEC_Diagnostics;
MyPendingElements: word;
ReadPendingList: ARRAY [0..63] OF CXAC_Diagnostics.Pending_Diagnostics;
MyPendingDiagnostics: CXAC_Diagnostics.Pending_Diagnostics;
MyResult: CXAC_Diagnostics.DIAG_RESULT;
END_VAR I am unsure if i declare the variables correctly? Warmest regards,
... View more