<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Arrays Within CoDeSys - How To!!</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/4c66a8c828/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/4c66a8c828/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/4c66a8c828/</id><updated>2020-02-27T21:42:05.511000Z</updated><subtitle>Recent posts to Arrays Within CoDeSys - How To!!</subtitle><entry><title>Arrays Within CoDeSys - How To!!</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/4c66a8c828/?limit=25#277f" rel="alternate"/><published>2020-02-27T21:42:05.511000Z</published><updated>2020-02-27T21:42:05.511000Z</updated><author><name>Captain-Edam</name><uri>https://forge.codesys.com/u/captain-edam/</uri></author><id>https://forge.codesys.comf42eda99dea8a35c1b45c54f4df032e507b3cb58</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks JAPIB, exactly what I was looking for my array is working well now. Merci bien et salut, Matt.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Arrays Within CoDeSys - How To!!</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/4c66a8c828/?limit=25#c118" rel="alternate"/><published>2020-02-27T21:42:04.029000Z</published><updated>2020-02-27T21:42:04.029000Z</updated><author><name>JAPIB</name><uri>https://forge.codesys.com/u/japib/</uri></author><id>https://forge.codesys.com10019e3eadf4ed610c86f2714f02d121746ca225</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;For example you can create :&lt;/p&gt;
&lt;p&gt;Tablo : ARRAY&lt;span&gt;[1..32,1..10]&lt;/span&gt; OF INT;&lt;/p&gt;
&lt;p&gt;You create an ARRAY with 33 columns and 11 rows.&lt;/p&gt;
&lt;p&gt;You can initialise all the cells of the array, when you create it, for example :&lt;/p&gt;
&lt;p&gt;Tablo : ARRAY&lt;span&gt;[1..32,1..10]&lt;/span&gt; OF INT:=1,2,3,4,5,6,..&lt;/p&gt;
&lt;p&gt;As this will fill the columns one by one, it to say that 1 will be placed in the first row of the first column, 2 in the second row of the first column, and so on.&lt;/p&gt;
&lt;p&gt;You can have access to a cell indicating the column number and line number, for example if you want to have acces to the 4th row of the 3rd column, you have to indicate Tablo&lt;span&gt;[3, 4]&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;With this you can read or write a cell.&lt;/p&gt;
&lt;p&gt;You can use 2 variables to acces a cell, like this :&lt;/p&gt;
&lt;p&gt;VAR&lt;/p&gt;
&lt;p&gt;Num_row:INT;&lt;/p&gt;
&lt;p&gt;Num_Column:INT;&lt;/p&gt;
&lt;p&gt;END_VAR&lt;/p&gt;
&lt;p&gt;Program:&lt;/p&gt;
&lt;p&gt;Num_row:=4;&lt;/p&gt;
&lt;p&gt;Num_Column:=3;&lt;/p&gt;
&lt;p&gt;Tablo&lt;span&gt;[Num_Column, Num_row]&lt;/span&gt;:=10; (&lt;em&gt;The cell of the 4th row of the 3rd column is filled with the value 10&lt;/em&gt;)&lt;/p&gt;
&lt;p&gt;Hope this helps you.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Arrays Within CoDeSys - How To!!</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/4c66a8c828/?limit=25#4806" rel="alternate"/><published>2020-02-27T21:42:02.539000Z</published><updated>2020-02-27T21:42:02.539000Z</updated><author><name>Captain-Edam</name><uri>https://forge.codesys.com/u/captain-edam/</uri></author><id>https://forge.codesys.com91e9955cf7578b2acab7f37d9dfd76e3cc37451b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello There,&lt;/p&gt;
&lt;p&gt;A question on ARRAYS. I have never successfully used them and I would like some help. I think I need an array to store some data that I need to pre-calculate. I can create it (ARRAY &lt;span&gt;[1..32, 1..10]&lt;/span&gt; OF Position; ) but how do I populate the individual cells of the array? Do I need a pointer? Does anyone know the syntax? Similarly, if I want to access the data to pump it out to a variable it's all very confusing. &lt;/p&gt;
&lt;p&gt;Thanks for any help, Matt. &lt;/p&gt;&lt;/div&gt;</summary></entry></feed>