<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to FbHTTPs_Get how to get data from a website and use it in codesys</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3f33a5b45e/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3f33a5b45e/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/3f33a5b45e/</id><updated>2025-06-16T13:32:28.198000Z</updated><subtitle>Recent posts to FbHTTPs_Get how to get data from a website and use it in codesys</subtitle><entry><title>FbHTTPs_Get how to get data from a website and use it in codesys</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3f33a5b45e/?limit=25#10d3" rel="alternate"/><published>2025-06-16T13:32:28.198000Z</published><updated>2025-06-16T13:32:28.198000Z</updated><author><name>levih</name><uri>https://forge.codesys.com/u/levih/</uri></author><id>https://forge.codesys.comfd971061652511e2de7e174b1dbc3328fea07d58</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;You get an array of DWORD into your receive buffer. You need to process this into usable data, before you can fit it into your DUT. I've made it work using FbWrite_ToIEC_ByRule in stead of Fb_JSON_ParseAndModify. I've attached images of the code.&lt;/p&gt;
&lt;p&gt;You receive the data into ARRAY&lt;span&gt;[0..1023]&lt;/span&gt; OF DWORD. Then you use that array as the input for fbWrite_ToIEC_ByRule. To get the output from this you define a rule to fit the expected data structure including nesting levels. The you feed the rule into FbWrite_ToIEC_ByRule and then you can set the output to be of your DUT type.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>FbHTTPs_Get how to get data from a website and use it in codesys</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3f33a5b45e/?limit=25#cab7" rel="alternate"/><published>2021-11-23T22:30:38.872000Z</published><updated>2021-11-23T22:30:38.872000Z</updated><author><name>espenbo</name><uri>https://forge.codesys.com/u/espenbo/</uri></author><id>https://forge.codesys.com014458b3c5e16f90c06af10d15ec3e8d36e811e3</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello&lt;br/&gt;
How sombody used the Function FbHttps_get from e!cockpit wagoAppHTTP.&lt;br/&gt;
I'm trying to get data from a webpage, but I can't get it to read from a page.&lt;br/&gt;
I have Internett aksess from the PLS. I can ping google. &lt;br/&gt;
Does sombody have an example I can look at?&lt;/p&gt;
&lt;p&gt;I tried to makee a DUT&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="err"&gt;TYPE DUT_Norpolbuffer:&lt;/span&gt;
&lt;span class="err"&gt;UNION&lt;/span&gt;
&lt;span class="c"&gt;bData: BYTE;&lt;/span&gt;
&lt;span class="c"&gt;sData: STRING;&lt;/span&gt;
&lt;span class="c"&gt;dwData: DWORD;&lt;/span&gt;
&lt;span class="c"&gt;charData: CHAR;&lt;/span&gt;
&lt;span class="err"&gt;END_UNION&lt;/span&gt;
&lt;span class="err"&gt;END_TYPE&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The program&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="err"&gt;VAR&lt;/span&gt;
&lt;span class="err"&gt;FbHTTPs_Get_1 : FbHTTPs_Get;&lt;/span&gt;
&lt;span class="err"&gt;// INput&lt;/span&gt;
&lt;span class="err"&gt;sURI : STRING(1023):='https://www.nordpoolgroup.com/api//marketdata/page/10';&lt;/span&gt;
&lt;span class="err"&gt;eAuthentication : eAuthentication :=1; &lt;/span&gt;
&lt;span class="err"&gt;array_pRxBufferUNIO : ARRAY[1..255] OF DUT_Norpolbuffer;&lt;/span&gt;
&lt;span class="err"&gt;udiRxBufferSize : UDINT :=1024; // receive buffer size&lt;/span&gt;
&lt;span class="err"&gt;tTimeout : TIME; &lt;/span&gt;
&lt;span class="err"&gt;//Inout&lt;/span&gt;
&lt;span class="err"&gt;xTrigger : BOOL; // perform a request&lt;/span&gt;
&lt;span class="err"&gt;//Output&lt;/span&gt;
&lt;span class="err"&gt;xBusy : BOOL; // job in progress&lt;/span&gt;
&lt;span class="err"&gt;xError : BOOL; // job finished with error&lt;/span&gt;
&lt;span class="err"&gt;oStatus : FbResult; // WagoSysErrorBase // detailed status information&lt;/span&gt;
&lt;span class="err"&gt;udiRxNBytes : UDINT; // Number of Bytes, that have been received by the Get-command&lt;/span&gt;
&lt;span class="err"&gt;//Oscat BUFFER_TO_STRING&lt;/span&gt;
&lt;span class="err"&gt;uiStart : UINT := 1 ;&lt;/span&gt;
&lt;span class="err"&gt;uiStop : UINT := 500;&lt;/span&gt;
&lt;span class="err"&gt;tekst1 : STRING(2000);&lt;/span&gt;
&lt;span class="err"&gt;Fb_JSON_ParseAndModify_0 : Fb_JSON_ParseAndModify;&lt;/span&gt;
&lt;span class="err"&gt;xTriggerJSON : BOOL;&lt;/span&gt;
&lt;span class="err"&gt;oStatusJSON : WagoAppJSON.WagoSysErrorBase.FbResult;&lt;/span&gt;
&lt;span class="err"&gt;xErrorJSON : BOOL;&lt;/span&gt;
&lt;span class="err"&gt;xDoneJSON : BOOL;&lt;/span&gt;
&lt;span class="err"&gt;diTokenJSON : DINT;&lt;/span&gt;
&lt;span class="err"&gt;END_VAR&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Program se Attachments&lt;/p&gt;
&lt;p&gt;First signs from the website: &lt;a href="https://www.nordpoolgroup.com/api//marketdata/page/10" rel="nofollow"&gt;https://www.nordpoolgroup.com/api//marketdata/page/10&lt;/a&gt;&lt;br/&gt;
{"data": {"Rows": [{"Columns":&lt;/p&gt;
&lt;p&gt;As I understand it, I get out DWORD. And it gets converted to BYTE, CHAR but not STRING.&lt;br/&gt;
Now I tried and take this array into JSON_function blocks it just complains that it is not STRING.&lt;br/&gt;
Do anybody have any tips?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>