<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Strange behavior when calculating size of STRUCT</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/e21c8db7ef/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/e21c8db7ef/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/e21c8db7ef/</id><updated>2020-09-17T22:18:56.879000Z</updated><subtitle>Recent posts to Strange behavior when calculating size of STRUCT</subtitle><entry><title>Strange behavior when calculating size of STRUCT</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/e21c8db7ef/?limit=25#0b4f/bfe1" rel="alternate"/><published>2020-09-17T22:18:56.879000Z</published><updated>2020-09-17T22:18:56.879000Z</updated><author><name>nothinrandom</name><uri>https://forge.codesys.com/u/nothinrandom/</uri></author><id>https://forge.codesys.comb86928566e500752ae0c7c595322dad8047c1d99</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Could you share example of the struct?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Strange behavior when calculating size of STRUCT</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/e21c8db7ef/?limit=25#af15" rel="alternate"/><published>2020-09-14T18:43:11.627000Z</published><updated>2020-09-14T18:43:11.627000Z</updated><author><name>i-campbell</name><uri>https://forge.codesys.com/u/i-campbell/</uri></author><id>https://forge.codesys.comf18f0f72161eb0a423584413c208decf10bcff05</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Download CODESYS memory tools from the store and take a look at the memory.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Strange behavior when calculating size of STRUCT</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/e21c8db7ef/?limit=25#0b4f" rel="alternate"/><published>2020-09-14T17:29:50.153000Z</published><updated>2020-09-14T17:29:50.153000Z</updated><author><name>maoravni</name><uri>https://forge.codesys.com/u/maoravni/</uri></author><id>https://forge.codesys.comcb14e1fa53de6a0aaa91282ec3416b07159c4a11</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I encounter strange STRUCT sizing in CodeSys.&lt;/p&gt;
&lt;p&gt;I have a STRUCT with various members, with various sizes. There's no real logic to the order in which the members are located, and I can't change the order. The member are all basic types, and range from BOOL to LREAL and UDINT. The STRUCT is pack_mode 1 due to the fact that it's dumped to disk every few seconds.&lt;/p&gt;
&lt;p&gt;When I perform a SIZEOF or VAR_INFO of the struct I get the same number - 324 bytes.&lt;/p&gt;
&lt;p&gt;When I count the individual sizes of each of the members I get 332 bytes.&lt;/p&gt;
&lt;p&gt;This is strange to me, as I would expect SIZEOF to be the same as the individual members in pack_mode 1, and larger when using other pack_modes.&lt;/p&gt;
&lt;p&gt;Any ideas?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>