FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
Dear Community User! We have started the migration process.
This community is now in READ ONLY mode.
Read more: Important
information on the platform change.
12-16-2022 03:44 PM
I want to use WebClient Function Block from Web_Client_SL library in IIOT to PUT an APPLICATION_JSON. For this goal I need to define the PostValue as a WSTRING and then define a Pointer for it to give the pointer as an input to FB. The first problem which I have is that when I give a json file to a WSTRING variable, the compiler returns an error. So what is the proper way to assign this json string in a variable?
For solving this problem, I used the JSON_Utilities_SL library in IIOT to convert a JSON file to a WSTRING. With JSONFileReader FB, I can make a JSONData object. How we can convert this JSONData object to WSTRING?
There is a function called JSONElementToString. For implementing it we need to extract the JSON elements. So I used the GetElementByIndex method to get the JSON elements. But the problem is that, I do not know the number of indexes for an arbitrary JSON file. What should I do?
Solved! Go to Solution.
12-19-2022 01:51 PM
I guess you are using a CODESYS based library so I moved this topic to the CODESYS - PLC Add-ons forum.
12-20-2022 03:05 PM
Yes, I am using IIOT library. Thank you.
12-21-2022 09:34 AM
I'm not sure, if I understand your description correct. I see 2 differnet use cases:
A: Pass the JSON file content, without changing anything
B: Pass the JSON file content, with changing it
Remarks:
03-30-2023 05:28 PM
Hello,
has your problem been solved in the meantime?
kind regards