FB jsonFileWriter gives a NULL_POINTER error, why?
JSONByteArrayWriter works fine so the JSONData FB should be fine.
The device is CODESYS Control Win V3 x64 in simulation mode.
Codesys version is V3.5 SP16 Patch 5
JSON_Utilities_SL version is 1.3.0.0
Src:ST_TestStruct1a;TXT:WSTRING(10000);MakeJSON:BOOL:=TRUE;SrcJSONData:JSON.JSONData;jsonFileWriter:JSON.JSONFileWriter;IFMakeJSONTHENMakeJSON:=FALSE;// Struct data to JSONData FBF_TestStructToJSON(ADR(Src),ADR(SrcJSONData));// Writing to filejsonFileWriter(xExecute:=TRUE,sFileName:='c:\JSONTEST\JSON.txt',eEncoding:=JSON.Encoding.UTF_16,xAsyncMode:=TRUE,jsonData:=SrcJSONData);// Waiting to finishWHILEjsonFileWriter.xBusyDO;END_WHILE// To textjsonArrayWriter(xExecute:=TRUE,pwData:=ADR(TXT),udiSize:=SIZEOF(TXT),jsonData:=SrcJSONData,xAsyncMode:=FALSE,);END_IF
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
FB jsonFileWriter gives a NULL_POINTER error, why?
JSONByteArrayWriter works fine so the JSONData FB should be fine.
The device is CODESYS Control Win V3 x64 in simulation mode.
Codesys version is V3.5 SP16 Patch 5
JSON_Utilities_SL version is 1.3.0.0