Post by tvm on Discussion for Home page
JSON parsing and composing library
home
(Post)
good catch, I'll add that to future versions
Last updated: 2020-05-05
Post by jumax on Discussion for Home page
JSON parsing and composing library
home
(Post)
Hello, I have a problem parsing a JSON string and I need help. The string I receive: '[{"device_id":"1","pgt_id":"2","usertag":"3","hgl":"4","ls":"5","rs":"6","erg":"7"}]' The struct I devined: TYPE strPGTdataSet: STRUCT device_id :JSONVAR; pgt_id :JSONVAR; usertag :JSONVAR; hgl :JSONVAR; ls :JSONVAR; rs :JSONVAR; erg :JSONVAR; END_STRUCT END_TYPE The FB I call: ParseJSON( Execute:=xParseJSON, JSONString:= ADR(hTTPClient_0.httpResult.sContent), JSONStringSize:= SIZEOF(hTTPClient_0.httpResult.sContent), JSONVars:= ADR(NewJSONObj), NumberOfVars:= SIZEOF(NewJSONObj) / SIZEOF(JSONVAR) ); The NewJSONObj always remains empty. I also tried to define the NewJSONObj as an array of struct like this: TYPE strPGToutputSet: STRUCT recordset :ARRAY [0..0] OF strPGTdataSet; END_STRUCT END_TYPE I don't know if you need more information to help. Also I'm new to CODESYS programming. Thank you!
Last updated: 2020-05-05
Post by tvm on Discussion for Home page
JSON parsing and composing library
home
(Post)
Hi, I haven't had time to test it, but have you tried recordset :ARRAY [1..1] OF strPGTdataSet;
Last updated: 2020-05-05
Post by schwi on Discussion for Home page
JSON parsing and composing library
home
(Post)
Hi, you should add (GPL_JSON.MAX_VALUE_SIZE) on this string. Because if bigger value sizes it runs into faulty parse. TYPE JSONNAMEVALUE : STRUCT Value: STRING(GPL_JSON.MAX_VALUE_SIZE); //value of the object at this level END_STRUCT END_TYPE Greetings
Last updated: 2020-04-12
Post by tvm on Discussion for Home page
JSON parsing and composing library
home
(Post)
I'll see if I can find some time to test this out.
Last updated: 2020-05-05
Post by nothinrandom on Discussion for Home page
JSON parsing and composing library
home
(Post)
Hello Guys, I believe there's an issue with nested structs on all verions. For example: TYPE stDebugJson : STRUCT timestamp : JSONVAR; messageType : JSONVAR; //message : JSONVAR; //works fine with setting MaxLevel to 1 message : stDebugMessageDetails; // missing end bracket END_STRUCT END_TYPE stDebugMessageDetails is just another type: TYPE stDebugMessageDetails : STRUCT message : JSONVAR; END_STRUCT END_TYPE The output looks like: {"debugMessageJson":{"timestamp":"2020-03-06T23:27:22.966Z","messageType":"DEBUG","message":{"message":"test22"}}
Last updated: 2020-03-06
Post by svenjotec on Discussion for Home page
JSON parsing and composing library
home
(Post)
It's cleared.
Last updated: 2019-12-03
Home (version 1) discussion
JSON parsing and composing library
home
(Thread)
Home (version 1) discussion
Last updated: 2018-11-08
Home (version 4) discussion
JSON parsing and composing library
home
(Thread)
Home (version 4) discussion
Last updated: 2020-03-06
Home (version 2) discussion
JSON parsing and composing library
home
(Thread)
Home (version 2) discussion
Last updated: 2018-12-07
Home (version 3) discussion
JSON parsing and composing library
home
(Thread)
Home (version 3) discussion
Last updated: 2020-02-10
Home
rickj
wiki
(WikiPage)
This is the personal project of rickj. This project is created automatically during user registration as an easy place to store personal data that doesn't need its own project such as cloned repositories.
Last updated: 2018-11-06
(no subject)
rickj
wiki
(Thread)
Last updated: 2018-11-06
Home (version 1) discussion
rickj
wiki
(Thread)
Home (version 1) discussion
Last updated: 2018-11-08
wiki Discussion
wwadepohl
wiki
(Discussion)
Forum for wiki comments
Last updated: 2018-11-09
wiki Discussion
rickj
wiki
(Discussion)
Forum for wiki comments
Last updated: 2018-11-06
Home
wwadepohl
wiki
(WikiPage)
This is the personal project of wwadepohl. This project is created automatically during user registration as an easy place to store personal data that doesn't need its own project such as cloned repositories.
Last updated: 2018-11-09
Home
axilleas
wiki
(WikiPage)
This is the personal project of axilleas. This project is created automatically during user registration as an easy place to store personal data that doesn't need its own project such as cloned repositories.
Last updated: 2018-11-09
Home (version 1) discussion
wwadepohl
wiki
(Thread)
Home (version 1) discussion
Last updated: 2018-11-14
(no subject)
wwadepohl
wiki
(Thread)
Last updated: 2018-11-09
(no subject)
axilleas
wiki
(Thread)
Last updated: 2018-11-09
Home (version 1) discussion
axilleas
wiki
(Thread)
Home (version 1) discussion
Last updated: 2018-11-13
(no subject)
robert
wiki
(Thread)
Last updated: 2018-11-12
Home (version 1) discussion
robert
wiki
(Thread)
Home (version 1) discussion
Last updated: 2018-11-14
wiki Discussion
axilleas
wiki
(Discussion)
Forum for wiki comments
Last updated: 2018-11-09