<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to AT statement with Structured Data Types</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/299ce00559/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/299ce00559/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/299ce00559/</id><updated>2020-02-27T22:02:09.773000Z</updated><subtitle>Recent posts to AT statement with Structured Data Types</subtitle><entry><title>AT statement with Structured Data Types</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/299ce00559/?limit=25#641a" rel="alternate"/><published>2020-02-27T22:02:09.773000Z</published><updated>2020-02-27T22:02:09.773000Z</updated><author><name>ndzied1</name><uri>https://forge.codesys.com/u/ndzied1/</uri></author><id>https://forge.codesys.com5d8105fca7f5f747d7944294a02784d3254a7c94</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;As a side note I have used addressed memory to pull bytes out of words and put them back in a different order. You can define an array of words at a marker address and then define an array of bytes at the same address. This effectively overlaps the memory like a union in C.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>AT statement with Structured Data Types</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/299ce00559/?limit=25#cfd3" rel="alternate"/><published>2020-02-27T22:02:05.500000Z</published><updated>2020-02-27T22:02:05.500000Z</updated><author><name>RollingPin</name><uri>https://forge.codesys.com/u/rollingpin/</uri></author><id>https://forge.codesys.com72301fb3edcb2c197dc5599e409503ff1542a037</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Rolf, Thanks a Ton. I tested this. It works with CoDeSys too.   &lt;/p&gt;
&lt;p&gt;I should have guessed. In the same project, I had assigned a DWORD to a %QW address and realized I made a mistake because the DWORD took values from the adjacent address too. So obviously the address is only a starting address that fills up the variable to its entire width. &lt;/p&gt;
&lt;p&gt;I really think the CoDeSys guys should mention this possiblity in the help file under the "Variables declaration" topic.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>AT statement with Structured Data Types</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/299ce00559/?limit=25#2b21" rel="alternate"/><published>2020-02-27T22:02:03.782000Z</published><updated>2020-02-27T22:02:03.782000Z</updated><author><name>Rolf-Geisler</name><uri>https://forge.codesys.com/u/rolf-geisler/</uri></author><id>https://forge.codesys.comfdb5cd7bf5b9f05825ce24c5f70252c8cae5a647</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;br/&gt;
in a Multiprog wt (CoDeSys competitor) written application I used the following syntax:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;VAR_GLOBAL&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="n"&gt;TestData1&lt;/span&gt; &lt;span class="k"&gt;AT&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="n"&gt;QW1500&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;TestData&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;This will allocate 3 WORDs QW1500 and up, in the same order as the TestData structure is declared. &lt;br/&gt;
It looks a bit strange, since the structure is bigger than 3 WORDs, however, it worked fine.&lt;br/&gt;
I guess, CoDeSys will do it in the same manner. Both of the systems are IEC1131 compliant ...&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>AT statement with Structured Data Types</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/299ce00559/?limit=25#ba7a" rel="alternate"/><published>2020-02-27T22:01:59.507000Z</published><updated>2020-02-27T22:01:59.507000Z</updated><author><name>RollingPin</name><uri>https://forge.codesys.com/u/rollingpin/</uri></author><id>https://forge.codesys.com479c4e770a8536f729bc4a3c0ccbe37f3c36ac32</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Does anyone know how to assign components of a structured data type to a definite address using CoDeSys? For example, I would like to have a Data type as follows:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nt"&gt;TYPE&lt;/span&gt; &lt;span class="nt"&gt;TestData&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt;
&lt;span class="nt"&gt;STRUCT&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="nt"&gt;Data1&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;WORD&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="nt"&gt;Data2&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;WORD&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; 
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="nt"&gt;Data3&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;WORD&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; 
&lt;span class="nt"&gt;END_STRUCT&lt;/span&gt;
&lt;span class="nt"&gt;END_TYPE&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;And in the Global variable table, I would like to have something like this:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nt"&gt;VAR_GLOBAL&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="nt"&gt;TestData1&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;TestData&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="nt"&gt;TestData1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Data1&lt;/span&gt; &lt;span class="nt"&gt;AT&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="nt"&gt;QW1500&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="nt"&gt;TestData1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Data2&lt;/span&gt; &lt;span class="nt"&gt;AT&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="nt"&gt;QW1501&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="nt"&gt;TestData1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Data3&lt;/span&gt; &lt;span class="nt"&gt;AT&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="nt"&gt;QW1502&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;END_VAR&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;I know it does not work with the above syntax. But does anybody know the right syntax? This would save me a lot of effort.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>