See also here an example, how to read out the list of all pending diagnostics using CXA_Autiomationcore_fbs at least version 1.14.0.1 and CXA_Datalayer:
Declaration:
PROGRAM common_log_diagnosis_fbs_DiagnosisIdentificationWithTimestamp
VAR
//fbs_DiagnosisIdentification: common_log_diagnosis_fbs_DiagnosisIdentification;
fbs_ErrorList: common_log_diagnosis_fbs_ListDiagnosisIdentificationWithTimestamp;
fbs_ErrorWithTimestamp: CXA_AutomationCore_fbs.common_log_diagnosis_fbs_DiagnosisIdentificationWithTimestamp;
fbs_DL_ReadNodeValue: DL_ReadNodeValue;
pDiagnosisTable: POINTER TO CXA_AutomationCore_fbs.common_log_diagnosis_fbs_DiagnosisIdentification;
bExecute: BOOL;
bDone: BOOL;
bActive: BOOL;
bError: BOOL;
ErrorID: CXA_Datalayer.ERROR_CODE;
ErrorIdent: CXA_Datalayer.ERROR_STRUCT;
NodePath: STRING(255) := 'diagnosis/get/actual/list';
DataRead: CXA_Datalayer.DL_NodeValue;
fb_R_TRIG: R_TRIG;
udiErrorListLength: UDINT;
i: INT;
arstrTimestamps: ARRAY[0..100] OF STRING;
arstrMainDiagnosisNumber: ARRAY[0..100] OF STRING;
arstrDetailedDiagnosisNumber: ARRAY[0..100] OF STRING;
arstrEntity: ARRAY[0..100] OF STRING;
END_VAR
Implementation:
fbs_DL_ReadNodeValue(
Execute:= bExecute,
Done=> bDone,
Active=> bActive,
Error=> bError,
ErrorID=> ErrorID,
ErrorIdent=> ErrorIdent,
ClientId:= ,
NodeName:= NodePath,
NodeValue:= DataRead);
fb_R_TRIG(CLK:= bDone, Q=> );
IF fb_R_TRIG.Q THEN
bExecute := FALSE;
fbs_ErrorList.getRootAsListDiagnosisIdentificationWithTimestamp(data:= DataRead.GetData(), size:= DataRead.GetSize());
udiErrorListLength := fbs_ErrorList.getListDiagnosisIdentificationWithTimestampLength();
FOR i := 0 TO TO_INT(udiErrorListLength)-1 BY 1 DO
fbs_ErrorList.getListDiagnosisIdentificationWithTimestamp(i,ADR(fbs_ErrorWithTimestamp));
arstrTimestamps[i] := fbs_ErrorWithTimestamp.getTimestamp();
pDiagnosisTable := fbs_ErrorWithTimestamp.getDiagnosisIdentification();
arstrMainDiagnosisNumber[i] := pDiagnosisTable^.getMainDiagnosisNumber();
arstrDetailedDiagnosisNumber[i] := pDiagnosisTable^.getDetailedDiagnosisNumber();
arstrEntity[i] := pDiagnosisTable^.getEntity();
END_FOR
END_IF
... View more