<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to HTTPClient Onkyo receiver control</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/f62077f51e/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/f62077f51e/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/f62077f51e/</id><updated>2020-05-15T06:43:07.740000Z</updated><subtitle>Recent posts to HTTPClient Onkyo receiver control</subtitle><entry><title>HTTPClient Onkyo receiver control</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/f62077f51e/?limit=25#e566" rel="alternate"/><published>2020-05-15T06:43:07.740000Z</published><updated>2020-05-15T06:43:07.740000Z</updated><author><name>quirzo</name><uri>https://forge.codesys.com/u/quirzo/</uri></author><id>https://forge.codesys.come7c9f73bcaa927daa0a9f066ae1ec2c24d1b2c4e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Could you please post your current code&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>HTTPClient Onkyo receiver control</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/f62077f51e/?limit=25#a14e" rel="alternate"/><published>2020-05-14T13:32:23.375000Z</published><updated>2020-05-14T13:32:23.375000Z</updated><author><name>bartm</name><uri>https://forge.codesys.com/u/bartm/</uri></author><id>https://forge.codesys.comf760a29a2d8318db6467303a2f3df6fe275ec02b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I'm quite lost in this mather, wireshark does not show the above at all with the data sent from codesys.&lt;br/&gt;
When I do it with the powershell script, I have exactly the same result as above.&lt;/p&gt;
&lt;p&gt;should I use the buffer_to_String function from oscat to extract a string from the array of bytes?&lt;br/&gt;
And sent this with httpclient?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>HTTPClient Onkyo receiver control</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/f62077f51e/?limit=25#81b3" rel="alternate"/><published>2020-05-14T11:20:04.592000Z</published><updated>2020-05-14T11:20:04.592000Z</updated><author><name>quirzo</name><uri>https://forge.codesys.com/u/quirzo/</uri></author><id>https://forge.codesys.com7cc78452f6afd90e189614538a91ac0c48196e1f</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Yes, use that byte array to send data. The data was different because if your string has ASCII characters (or WSTRING has unicode).&lt;/p&gt;
&lt;p&gt;If you have STRING of &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="mi"&gt;73&lt;/span&gt; &lt;span class="mi"&gt;83&lt;/span&gt; &lt;span class="mi"&gt;67&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="mi"&gt;33&lt;/span&gt; &lt;span class="mi"&gt;49&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt; &lt;span class="mi"&gt;87&lt;/span&gt; &lt;span class="mi"&gt;82&lt;/span&gt; &lt;span class="mi"&gt;48&lt;/span&gt; &lt;span class="mi"&gt;49&lt;/span&gt; &lt;span class="mi"&gt;13&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;you will see in wireshark something like &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="mi"&gt;55&lt;/span&gt; &lt;span class="mi"&gt;51&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt; &lt;span class="mi"&gt;56&lt;/span&gt; &lt;span class="mi"&gt;51&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt; &lt;span class="mi"&gt;54&lt;/span&gt; &lt;span class="mi"&gt;55&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt; &lt;span class="mi"&gt;56&lt;/span&gt; &lt;span class="mi"&gt;48&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt; &lt;span class="mi"&gt;48&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt; &lt;span class="mi"&gt;48&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt; &lt;span class="mi"&gt;48&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt; &lt;span class="mi"&gt;49&lt;/span&gt; &lt;span class="mi"&gt;54&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt; &lt;span class="mi"&gt;48&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt; &lt;span class="mi"&gt;48&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt; &lt;span class="mi"&gt;48&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt; &lt;span class="mi"&gt;56&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt; &lt;span class="mi"&gt;49&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt; &lt;span class="mi"&gt;48&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt; &lt;span class="mi"&gt;48&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt; &lt;span class="mi"&gt;48&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt; &lt;span class="mi"&gt;51&lt;/span&gt; &lt;span class="mi"&gt;51&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt; &lt;span class="mi"&gt;52&lt;/span&gt; &lt;span class="mi"&gt;57&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt; &lt;span class="mi"&gt;56&lt;/span&gt; &lt;span class="mi"&gt;48&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt; &lt;span class="mi"&gt;56&lt;/span&gt; &lt;span class="mi"&gt;55&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt; &lt;span class="mi"&gt;56&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt; &lt;span class="mi"&gt;52&lt;/span&gt; &lt;span class="mi"&gt;56&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt; &lt;span class="mi"&gt;52&lt;/span&gt; &lt;span class="mi"&gt;57&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt; &lt;span class="mi"&gt;49&lt;/span&gt; &lt;span class="mi"&gt;51&lt;/span&gt; 
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Where 7 = 55, 3 = 51 and so on.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>HTTPClient Onkyo receiver control</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/f62077f51e/?limit=25#4a60" rel="alternate"/><published>2020-05-14T11:01:02.651000Z</published><updated>2020-05-14T11:01:02.651000Z</updated><author><name>bartm</name><uri>https://forge.codesys.com/u/bartm/</uri></author><id>https://forge.codesys.com8466201378fb567535683e67942eb5c1850db311</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;so the Data array should be sent by the httpclient? I have no errors, but when I check the traffic with wireshark or tcpdump it is not like the traffic generated from the powershell script.&lt;br/&gt;
I've tried also the oscat buffer_to_string function and sent the resulting string, but I think the "0"s are causing trouble, not sure however because this is unknown territory for me.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>HTTPClient Onkyo receiver control</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/f62077f51e/?limit=25#6c54" rel="alternate"/><published>2020-05-14T08:08:12.530000Z</published><updated>2020-05-14T08:08:12.530000Z</updated><author><name>quirzo</name><uri>https://forge.codesys.com/u/quirzo/</uri></author><id>https://forge.codesys.com4d0cb38ee4d596948718f2d6e00d0a0cc67714ac</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Oh sorry. I just realized that you have bytes you want to send in that WSTRING, not characters? If so, then that code can't work as the 73 = character seven and three, not byte value 73.&lt;/p&gt;
&lt;p&gt;Then you need to create an array of bytes and place the data in there:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;    &lt;span class="k"&gt;Data&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;ARRAY&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;..&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;OF&lt;/span&gt; &lt;span class="n"&gt;BYTE&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;73&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;83&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;67&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;68&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="k"&gt;and&lt;/span&gt; &lt;span class="n"&gt;so&lt;/span&gt; &lt;span class="k"&gt;on&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)];&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;</summary></entry><entry><title>HTTPClient Onkyo receiver control</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/f62077f51e/?limit=25#57e9" rel="alternate"/><published>2020-05-13T10:38:20.486000Z</published><updated>2020-05-13T10:38:20.486000Z</updated><author><name>bartm</name><uri>https://forge.codesys.com/u/bartm/</uri></author><id>https://forge.codesys.com5657e4e849baab3526f24b8556d3c8f768b1aeb9</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thank you for the support.&lt;br/&gt;
Still no success, I need to sent one "0", $0 isn't accepted and $00 doest not work.&lt;br/&gt;
When I check the traffic with wireshark on the IP address, it is totally different compared to the powershell script.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>HTTPClient Onkyo receiver control</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/f62077f51e/?limit=25#129c" rel="alternate"/><published>2020-05-13T05:27:39.792000Z</published><updated>2020-05-13T05:27:39.792000Z</updated><author><name>quirzo</name><uri>https://forge.codesys.com/u/quirzo/</uri></author><id>https://forge.codesys.comfe041466980bb8b60933f2e85279ec17f5aed5ad</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Use STRING instead of WSTRING so you get directly values as bytes. WSTRING is in unicode so it uses 2 bytes for each character and STRING uses one byte for each character.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>HTTPClient Onkyo receiver control</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/f62077f51e/?limit=25#0c80" rel="alternate"/><published>2020-05-12T09:15:45.530000Z</published><updated>2020-05-12T09:15:45.530000Z</updated><author><name>bartm</name><uri>https://forge.codesys.com/u/bartm/</uri></author><id>https://forge.codesys.com93f33d42a34f416276545d583eaf1238e9978d91</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I'm struggling to sent a string in byte format to an Onkyo receiver.&lt;br/&gt;
The idea was to use the httpclient fb and sent the wstring sTest: WSTRING(200):="73 83 67 80 0 0 0 16 0 0 0 8 1 0 0 0 33 49 80 87 82 48 49 13"; to it&lt;br/&gt;
Somewhere in the process I need to do a hex to byte because it should be sent as bytes. Here I'm stuck.&lt;/p&gt;
&lt;p&gt;I can control it by a powershell script (attachment), but I cannot convert this script to codesys.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>