<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Dynamic Array's</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/6c4a84326e/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/6c4a84326e/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/6c4a84326e/</id><updated>2020-02-27T20:48:24.233000Z</updated><subtitle>Recent posts to Dynamic Array's</subtitle><entry><title>Dynamic Array's</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/6c4a84326e/?limit=25#45a0" rel="alternate"/><published>2020-02-27T20:48:24.233000Z</published><updated>2020-02-27T20:48:24.233000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.comc3fd289f84e683a581884c68a30891375506d64f</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;no sorry you can not change the size of arrays, as it would mean the memory has to shift a lot.&lt;br/&gt;
you will have to design the max size, and maybe use just a little portion of it.&lt;br/&gt;
In V3 it is possible on some machines.&lt;/p&gt;
&lt;p&gt;and obvious you can use different numbers when defing the function block instance, as long as it is a constant.&lt;br/&gt;
the memory is allocated using this constant, and can not be changed.&lt;br/&gt;
I never see a reason to change a size in a running program.&lt;/p&gt;
&lt;p&gt;please have a look at  w &lt;a class="" href="http://www.oscat.de" rel="nofollow"&gt;www.oscat.de&lt;/a&gt; w  (its english) for a big set of functions.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Dynamic Array's</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/6c4a84326e/?limit=25#9c44" rel="alternate"/><published>2020-02-27T20:48:22.816000Z</published><updated>2020-02-27T20:48:22.816000Z</updated><author><name>Alvxx1</name><uri>https://forge.codesys.com/u/alvxx1/</uri></author><id>https://forge.codesys.com2c4971356467f13185e5e1d5cdef9f95f360075f</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;shooter hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
YES&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Thanks, but that doesn't help me very much, if you could expand on that just a little?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Dynamic Array's</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/6c4a84326e/?limit=25#78ec" rel="alternate"/><published>2020-02-27T20:48:21.409000Z</published><updated>2020-02-27T20:48:21.409000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com8b78dc290381c0f050398bda469772443dd3f2ab</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;YES&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Dynamic Array's</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/6c4a84326e/?limit=25#5e67" rel="alternate"/><published>2020-02-27T20:48:17.461000Z</published><updated>2020-02-27T20:48:17.461000Z</updated><author><name>Alvxx1</name><uri>https://forge.codesys.com/u/alvxx1/</uri></author><id>https://forge.codesys.com5ef7ad2a20ca40dbc9308281d3ba39edb256b9f1</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Ok, I've managed to get a little bit futher. I've used the following to declare a Variable Input Constant:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nt"&gt;VAR_INPUT&lt;/span&gt; &lt;span class="nt"&gt;CONSTANT&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="nt"&gt;Data_Length&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nd"&gt;INT&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;100&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;This in conjuction with:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;FIFO_ARRAY&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ARRAY&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="n"&gt;Data_Length&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="n"&gt;OF&lt;/span&gt; &lt;span class="n"&gt;REAL&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Compiles correctly! Now this is great, because I can change the Data_Length constant and change the size of the Array.&lt;/p&gt;
&lt;p&gt;I assumed the because it was an "Input Variable" that I would be able to programmatically edit this value by passing a parameter to "{FunctionBlock}.Data_Length", but because a constant is exactly just that, no matter what I put for this parameter, it stays at 100.&lt;/p&gt;
&lt;p&gt;Is this as far as I can go, or is there still some hope at being able to pass this value to individual instances of a Function Block to vary that function block's array length.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Dynamic Array's</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/6c4a84326e/?limit=25#4722" rel="alternate"/><published>2020-02-27T20:48:16.035000Z</published><updated>2020-02-27T20:48:16.035000Z</updated><author><name>Alvxx1</name><uri>https://forge.codesys.com/u/alvxx1/</uri></author><id>https://forge.codesys.com4ffce05b1545dbbef08203c1b29c698cbbc26609</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Firstly, sorry if this has been asked before but I can't find an answer that suits my needs.&lt;/p&gt;
&lt;p&gt;Im looking to define an Array, where the length of the Array is a variable. Something like this:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&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;Dyn_Array&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;ARRAY&lt;/span&gt;&lt;span class="cp"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="bp"&gt;..&lt;/span&gt;&lt;span class="nx nx-Member"&gt;X&lt;/span&gt;&lt;span class="cp"&gt;]&lt;/span&gt; &lt;span class="nt"&gt;OF&lt;/span&gt; &lt;span class="nt"&gt;REAL&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;However, the above returns an error of:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Zitat:&lt;/strong&gt;&lt;br/&gt;
Error 3750: PLC_PRG (10): Upper Bound 'X' not defined&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This also happens even if 'X' is defined and given a value in the declaration section.&lt;/p&gt;
&lt;p&gt;Is this possible, or am I missing something? I've got a custom First In First Out FB that i'd like to be able to specify the length of the Array in the block instead of having to import it from the library and edit it each time.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>