Read Log data in Datalayer in PLC

Hello, I would like to read Log data in PLC, but the data return is always wrong data.

I used these 2 functions "DL_ReadNodeValue" and "common_log_diagnosis_fbs_DiagnosisIdentification" to read MainDiagnosisNumber, DetailedDiagnosisNumber and Entity back to PLC.

But the data return only "(" in Main Diagnosis, "timestamp" in Detailed Diagnosis and no data return in Entity.

I using the same programs to read PLC info by CXA_PLC_fbs fuction, the results returned correctly without problem. Could you help me check whether there is any mistake of the fuction of read diagnosis log?

Thanks.

 

Best reply by bostroemc

Data layer node diagnosis/get/actual/log is associated to schema types/diagnosis/identification-timestamp.  The POU for this schema is common_log_diagnosis_fbs_DiagnosisIdentificationWithTimestamp, not common_log_diagnosis_fbs_DiagnosisIdentification.

After the initial call to DL_ReadNodeValue, use common_log_diagnosis_fbs_DiagnosisIdentificationWithTimestamp to get the root structure, then a pointer to common_log_diagnosis_fbs_DiagnosisIdentification to get the inner structure:

EDIT: Tested with ctrlX CORE 2.6.x, but should apply equally with ctrlX CORE 1.20.x.

View original
3 replies