<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Union - Array and String❓</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/80388c689c/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/80388c689c/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/80388c689c/</id><updated>2021-02-05T08:47:19.086000Z</updated><subtitle>Recent posts to Union - Array and String❓</subtitle><entry><title>Union - Array and String❓</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/80388c689c/?limit=250#cefb" rel="alternate"/><published>2021-02-05T08:47:19.086000Z</published><updated>2021-02-05T08:47:19.086000Z</updated><author><name>dFx</name><uri>https://forge.codesys.com/u/dfx/</uri></author><id>https://forge.codesys.combdee04a9db19d54bc7697bfc03432780e0fe49a7</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Feels like some nerdish code writing style. &lt;br/&gt;
String is no more than a byte array. With this in mind, to get the same length than the word array, you need to double the word array length.&lt;br/&gt;
You could define string(250) and it would also work.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Union - Array and String❓</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/80388c689c/?limit=25#5e2a" rel="alternate"/><published>2021-02-05T07:03:37.755000Z</published><updated>2021-02-05T07:03:37.755000Z</updated><author><name>andras-mozes</name><uri>https://forge.codesys.com/u/andras-mozes/</uri></author><id>https://forge.codesys.comf991372ea21204ec65caa549bd5ed824667ab5d0</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 have data in format of ARRAY&lt;span&gt;[0..124]&lt;/span&gt; OF WORD.&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;DUTtest&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;aData&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;124&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;strData&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;125&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="mi"&gt;2&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;It works - without using any &lt;code&gt;for loop&lt;/code&gt; -, but I would like to understand the details that is what &lt;code&gt;STRING(125*2)&lt;/code&gt; does?&lt;/p&gt;
&lt;p&gt;Thanks in advance.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>