<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to String array corruption</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/17beb17151/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/17beb17151/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/17beb17151/</id><updated>2020-02-27T22:42:00.055000Z</updated><subtitle>Recent posts to String array corruption</subtitle><entry><title>String array corruption</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/17beb17151/?limit=25#7f06" rel="alternate"/><published>2020-02-27T22:42:00.055000Z</published><updated>2020-02-27T22:42:00.055000Z</updated><author><name>MechatronicMan</name><uri>https://forge.codesys.com/u/mechatronicman/</uri></author><id>https://forge.codesys.com1103e08b7e70eadc4c6651eb5e06186c4a8e3659</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;It works OK for me too with a new programme. I have experimented a lot to try and diagnose the cause. Even deleted all of the logic, just leaving the globals vars and still the list shows "Invalid 16#nn". I don't think this is a specific problem with string arrays now - there is something deeper which causes a fault and then the fault stays even though the original cause is removed.&lt;/p&gt;
&lt;p&gt;The work around I have chosen for the time being is to use discrete strings and a CASE statement to sort out which one to use.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>String array corruption</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/17beb17151/?limit=25#eb33" rel="alternate"/><published>2020-02-27T22:41:58.485000Z</published><updated>2020-02-27T22:41:58.485000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com35fec18306cc0011fbadbc07fcc51c4c675f8a3c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;with me it works as it is supposed, so please send your prog or a little more info.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>String array corruption</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/17beb17151/?limit=25#770a" rel="alternate"/><published>2020-02-27T22:41:54.083000Z</published><updated>2020-02-27T22:41:54.083000Z</updated><author><name>MechatronicMan</name><uri>https://forge.codesys.com/u/mechatronicman/</uri></author><id>https://forge.codesys.comd399055afa87ba1627a3dcf95992bb30e783ffff</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;br/&gt;
I have defined some string arrays, for example,&lt;/p&gt;
&lt;p&gt;saProgPhase:ARRAY&lt;span&gt;[0..5]&lt;/span&gt; OF STRING(14) := '0ABCDEFG', '1ABCDEFG', '2ABCDEFG', '3ABCDEFG', '4ABCDEFG', '5ABCDEFG';&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;saSubAssy&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="mi"&gt;9&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;STRING&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;18&lt;/span&gt;&lt;span class="o"&gt;):=&lt;/span&gt;&lt;span class="s1"&gt;'6ABCDEFG '&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;'7ABCDEFG'&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;'8ABCDEFG'&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;'9ABCDEFG'&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;'10ABCDEFG','11ABCDEFG','12ABCDEFG','13ABCDEFG','14ABCDEFG','15ABCDEFG';&lt;/p&gt;
&lt;p&gt;When accessing these arrays, for example,&lt;/p&gt;
&lt;p&gt;zzz:=saProgPhase&lt;span&gt;[iProgPhaseCode]&lt;/span&gt;;&lt;br/&gt;
zz1:=saSubAssy&lt;span&gt;[iSubAssyCode]&lt;/span&gt;;&lt;/p&gt;
&lt;p&gt;the contents of strings zzz and zz1 are a mixture of parts of the two arrays, as if a pointer has got corrupt somewhere.&lt;/p&gt;
&lt;p&gt;Both iProgPhaseCode and iSubAssyCode are integers within the array range. There are (0) errors and (0) warnings.&lt;br/&gt;
I am using Windows 7 with CoDeSys from Festo.&lt;/p&gt;
&lt;p&gt;Any ideas as to the cause of the corruption?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>