Hello, Thanks a lot for your sample. It's pretty helpful. I'm reading fbs script_manager_fbtypes_DiagInfo which inculdes string type and array of string type, there are sitll some problems for me: 1. When trying to parse array of string, I can get a valid value of pointer to string by getLasetErrTrace method, but when convert it to string type, I always get invalid result. 2. Besides, I can always get a value(not zero) by method strPtr := fbsDiag_Read.getLastErrTrace(idx), even though idx is bigger than count. count := fbsDiag_Read.getLastErrTraceLength();
FOR idx := 0 TO count - 1 DO
strPtr := fbsDiag_Read.getLastErrTrace(idx);
IF strPtr <>0 THEN
Stu.StrCpyA(pBuffer:=ADR(testStr), iBufferSize := SIZEOF(testStr), pStr := strPtr);
END_IF
END_FOR 3. When trying to read a string longer than 80 length, it's limited to 80(default string length in codesys). For some case, it's not enough to get a string with wrong length. ErrorStr := fbsDiag_Read.getLastErrText();
... View more