Hello,
I am trying to implement a FB to make JSON formatted WSTRING type message using JSON Utilities 1.9.0.0 included in the IIoT library.
In my case, I want to set some objects or arrays and set values to them later.
But when I wrote as the sample below,
// init builderbuilder(pJsonData:=pJsonData,diRootObj=>diRootObj);// set the 1st key to rootdiKey1:=builder.SetKeyWithArray(wsKey:="key1",diParentIndex:=diRootObj,eError=>eError);// set a value to the 1st keywsValue:="value01";builder.SetValue(Value:=wsValue,diParentIndex:=diKey1,eError=>eError);// set the 2nd key to rootdiKey2:=builder.SetKeyWithArray(wsKey:="key2",diParentIndex:=diRootObj,eError=>eError);// set a value to the 2nd keywsValue:="value02";builder.SetValue(Value:=wsValue,diParentIndex:=diKey2,eError=>eError);// set a value to the 1st key againwsValue:="value03";builder.SetValue(Value:=wsValue,diParentIndex:=diKey1,eError=>eError);// set a value to the 2nd key againwsValue:="value04";builder.SetValue(Value:=wsValue,diParentIndex:=diKey2,eError=>eError);// write build resultwriter(xExecute:=TRUE,pwData:=ADR(wsResult),udiSize:=SIZEOF(wsResult),xAsyncMode:=FALSE,jsonData:=pJsonData^);
Hello,
I am trying to implement a FB to make JSON formatted WSTRING type message using JSON Utilities 1.9.0.0 included in the IIoT library.
In my case, I want to set some objects or arrays and set values to them later.
But when I wrote as the sample below,
the result was:
while my expection was:
Inspecting pJsonData^, JSONData itself seems to be ok, so I believe the issue is something caused by the writer FB.
Does anyone know how to fix it?
Thanks,