<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Static analysis. Variable A greater 1024 bytes</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/56f16e7056/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/56f16e7056/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/56f16e7056/</id><updated>2022-07-21T19:54:48.227000Z</updated><subtitle>Recent posts to Static analysis. Variable A greater 1024 bytes</subtitle><entry><title>Static analysis. Variable A greater 1024 bytes</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/56f16e7056/?limit=25#8678/8eff" rel="alternate"/><published>2022-07-21T19:54:48.227000Z</published><updated>2022-07-21T19:54:48.227000Z</updated><author><name>fajean</name><uri>https://forge.codesys.com/u/fajean/</uri></author><id>https://forge.codesys.com663ae93ae57792f6bb954d57696e66d6949edb6d</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I would like to understand what you mean by "that would cost processor time loading it into memory". Outside of arguments passed by value and assignments (which require the array to be copied, but probably are an atypical way to use an array), do you know of cases where a large array size causes sustained CPU load issues by itself, not related to explicit processing such as iterating over the array?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Static analysis. Variable A greater 1024 bytes</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/56f16e7056/?limit=25#8678" rel="alternate"/><published>2022-07-21T14:26:10.194000Z</published><updated>2022-07-21T14:26:10.194000Z</updated><author><name>i-campbell</name><uri>https://forge.codesys.com/u/i-campbell/</uri></author><id>https://forge.codesys.com7d26af5190482c7bf60d61567adad974568e033a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;there is a justification in the &lt;a class="" href="https://content.helpme-codesys.com/en/CODESYS%20Static%20Analysis/_san_rule_sa0100.html" rel="nofollow"&gt;help&lt;/a&gt; but I couldn't find any such coding guidelines in the first two google results.  I suppose it is good to check your biggest variables, maybe you accidentally made a very large array that would cost processor time loading it into memory. Once checked, you can add the static analysis pragmas to ignore it in future. Or you could change the limit a bit higher.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Static analysis. Variable A greater 1024 bytes</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/56f16e7056/?limit=25#cc4c" rel="alternate"/><published>2022-07-21T12:22:17.756000Z</published><updated>2022-07-21T12:22:17.756000Z</updated><author><name>DavidBo</name><uri>https://forge.codesys.com/u/davidbo/</uri></author><id>https://forge.codesys.com50c526482ec6680c2eb84e50e54b1b8670f810e4</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I am using static analysis which warn me about variable A being greater than 1024 bytes&lt;br/&gt;
Why is that a problem? And what should I do if I have big variables?&lt;/p&gt;
&lt;p&gt;PROGRAM PLC_PRG&lt;br/&gt;
VAR CONSTANT&lt;br/&gt;
    nr_of_motors:INT:=2;&lt;br/&gt;
END_VAR&lt;br/&gt;
VAR&lt;br/&gt;
    GetState : ARRAY&lt;span&gt;[1..nr_of_motors]&lt;/span&gt; OF CIA405.GET_STATE;&lt;br/&gt;
    devState : ARRAY&lt;span&gt;[1..nr_of_motors]&lt;/span&gt; OF CiA405.DEVICE_STATE;&lt;br/&gt;
    enableDev: ARRAY&lt;span&gt;[1..nr_of_motors]&lt;/span&gt; OF BOOL:=&lt;span&gt;[nr_of_motors(FALSE)]&lt;/span&gt;;&lt;br/&gt;
    confirmDev: ARRAY&lt;span&gt;[1..nr_of_motors]&lt;/span&gt; OF BOOL;&lt;br/&gt;
    A: ARRAY &lt;span&gt;[1..nr_of_motors]&lt;/span&gt; OF Motor;&lt;br/&gt;
    initPRG:BOOL:=TRUE;&lt;br/&gt;
    operational:ARRAY &lt;span&gt;[1..nr_of_motors]&lt;/span&gt; OF BOOL;&lt;br/&gt;
    i0:int;&lt;br/&gt;
END_VAR&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>