<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to How to convert JSON file to a WSTRING? (with IIOT)</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/a8eec3f7f9/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/a8eec3f7f9/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/a8eec3f7f9/</id><updated>2022-12-16T15:06:22.471000Z</updated><subtitle>Recent posts to How to convert JSON file to a WSTRING? (with IIOT)</subtitle><entry><title>How to convert JSON file to a WSTRING? (with IIOT)</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/a8eec3f7f9/?limit=25#438a" rel="alternate"/><published>2022-12-16T15:06:22.471000Z</published><updated>2022-12-16T15:06:22.471000Z</updated><author><name>mdirzpr13</name><uri>https://forge.codesys.com/u/mdirzpr13/</uri></author><id>https://forge.codesys.com9cb3e73931cebca0d76e52029b4510c535839602</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;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?&lt;/p&gt;
&lt;p&gt;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?&lt;/p&gt;
&lt;p&gt;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?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>