<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to UNION to I/O Mapping</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/298ac1a7c9/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/298ac1a7c9/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/298ac1a7c9/</id><updated>2020-12-09T18:52:16.022000Z</updated><subtitle>Recent posts to UNION to I/O Mapping</subtitle><entry><title>UNION to I/O Mapping</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/298ac1a7c9/?limit=25#b034" rel="alternate"/><published>2020-12-09T18:52:16.022000Z</published><updated>2020-12-09T18:52:16.022000Z</updated><author><name>andras-mozes</name><uri>https://forge.codesys.com/u/andras-mozes/</uri></author><id>https://forge.codesys.com4c73f6f807243a8fc1e563b5b809d3e3fffd7b33</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hm maybe I didn't get... 🤔 &lt;/p&gt;
&lt;p&gt;I use &lt;code&gt;Union&lt;/code&gt; in order to have the &lt;code&gt;STRING&lt;/code&gt; representation of &lt;code&gt;ARRAY[0..4] OF WORD&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;So somehow I need to map the &lt;code&gt;PLC Output&lt;/code&gt;'s 5..120 indexes to &lt;code&gt;UNION CognexReader&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>UNION to I/O Mapping</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/298ac1a7c9/?limit=25#5678" rel="alternate"/><published>2020-12-09T17:00:54.127000Z</published><updated>2020-12-09T17:00:54.127000Z</updated><author><name>Morberis</name><uri>https://forge.codesys.com/u/morberis/</uri></author><id>https://forge.codesys.comd057eed1d37a6f4f8eb24169393989f126685ebd</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;What about linking the whole array to another array starting at index 5?&lt;/p&gt;
&lt;p&gt;Or can you put Application.PLC_PRG.Result.ResultData&lt;span&gt;[5..120]&lt;/span&gt; if you only want to use index's 5-120?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>UNION to I/O Mapping</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/298ac1a7c9/?limit=25#a75e" rel="alternate"/><published>2020-12-09T13:38:53.340000Z</published><updated>2020-12-09T13:38:53.340000Z</updated><author><name>andras-mozes</name><uri>https://forge.codesys.com/u/andras-mozes/</uri></author><id>https://forge.codesys.comf15ac23a57eb237befd8e1c2ca297dc74b119c31</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;strong&gt;Hello&lt;/strong&gt;,&lt;/p&gt;
&lt;p&gt;I would like to ask for your help, again. 😄&lt;/p&gt;
&lt;p&gt;I created the following &lt;code&gt;Union&lt;/code&gt;:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="k"&gt;TYPE&lt;/span&gt; &lt;span class="n"&gt;CognexReader&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="k"&gt;UNION&lt;/span&gt;
    &lt;span class="n"&gt;ResultData&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;4&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;WORD&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;ResultString&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;STRING&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;END_UNION&lt;/span&gt;
&lt;span class="n"&gt;END_TYPE&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;I instantiated it.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;PROGRAM&lt;/span&gt; &lt;span class="n"&gt;PLC_PRG&lt;/span&gt;
&lt;span class="n"&gt;VAR&lt;/span&gt;
    &lt;span class="k"&gt;Result&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;CognexReader&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;END_VAR&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;It works fine but currently I have to map each I/O to the element of the array.&lt;br/&gt;
I am wondering if there is a better approach b/c currently I have some 120 WORD to link to the union.&lt;/p&gt;
&lt;p&gt;I cannot link the whole ARRAY as the result data starts from index 5.&lt;/p&gt;
&lt;p&gt;Thanks for your help in advance.&lt;/p&gt;
&lt;p&gt;I really appreciate.&lt;/p&gt;
&lt;p&gt;Best Regards!&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>