<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to String type object length in CANopen OD?</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/0ffd2da45b/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/0ffd2da45b/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/0ffd2da45b/</id><updated>2020-02-27T21:49:39.372000Z</updated><subtitle>Recent posts to String type object length in CANopen OD?</subtitle><entry><title>String type object length in CANopen OD?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/0ffd2da45b/?limit=25#a894" rel="alternate"/><published>2020-02-27T21:49:39.372000Z</published><updated>2020-02-27T21:49:39.372000Z</updated><author><name>jusbe99</name><uri>https://forge.codesys.com/u/jusbe99/</uri></author><id>https://forge.codesys.come53f511cb35b511c610cf2f53d39ec7a246d0b4e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;ODEntries is an ARRAY OF STRUCT.&lt;/p&gt;
&lt;p&gt;But that was a valid test, thanks!&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>String type object length in CANopen OD?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/0ffd2da45b/?limit=25#650a" rel="alternate"/><published>2020-02-27T21:49:37.877000Z</published><updated>2020-02-27T21:49:37.877000Z</updated><author><name>t.lundahl</name><uri>https://forge.codesys.com/u/t-lundahl/</uri></author><id>https://forge.codesys.come6ba895b0489681831ecf4e6121112e2a5041bbb</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Wasn't The ODEntries[] an array. &lt;/p&gt;
&lt;p&gt;I made an declaration yesterday with STRING&lt;span&gt;[255]&lt;/span&gt; it's became 256 in length.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>String type object length in CANopen OD?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/0ffd2da45b/?limit=25#d5b1" rel="alternate"/><published>2020-02-27T21:49:36.363000Z</published><updated>2020-02-27T21:49:36.363000Z</updated><author><name>jusbe99</name><uri>https://forge.codesys.com/u/jusbe99/</uri></author><id>https://forge.codesys.come0c8bee242d8ff8abf1d3268c7bc8bdb0dc2ecaf</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;It is not an array. It is a STRING type variable, with length 4.&lt;/p&gt;
&lt;p&gt;But wait a moment, does STRING(4) mean same as an ARRAY&lt;span&gt;[0..4]&lt;/span&gt; OF BYTE, when thinking it with memory space needs? &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>String type object length in CANopen OD?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/0ffd2da45b/?limit=25#3faf" rel="alternate"/><published>2020-02-27T21:49:32.161000Z</published><updated>2020-02-27T21:49:32.161000Z</updated><author><name>t.lundahl</name><uri>https://forge.codesys.com/u/t-lundahl/</uri></author><id>https://forge.codesys.coma2315f06328dc8f498fe4219e7c81d40936b0ee0</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;If you declare an array as array&lt;span&gt;[4]&lt;/span&gt; the size will be 5 (0-4).&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>String type object length in CANopen OD?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/0ffd2da45b/?limit=25#36ee" rel="alternate"/><published>2020-02-27T21:49:30.658000Z</published><updated>2020-02-27T21:49:30.658000Z</updated><author><name>jusbe99</name><uri>https://forge.codesys.com/u/jusbe99/</uri></author><id>https://forge.codesys.com87eedef08c0aaada614650a89a990769232c4420</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Yes, it is a NULL character, the fifth one I mean.&lt;/p&gt;
&lt;p&gt;So, it looks like the OD needs to have that extra place too, to have the memory organized. It works if I manually set the ODEntries[].wLen=4. Then I can send it by expedited SDO. Or maybe just limit the object to 3 characters. &lt;/p&gt;
&lt;p&gt;Thanks nOrM!&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>String type object length in CANopen OD?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/0ffd2da45b/?limit=25#649d" rel="alternate"/><published>2020-02-27T21:49:26.474000Z</published><updated>2020-02-27T21:49:26.474000Z</updated><author><name>ndzied1</name><uri>https://forge.codesys.com/u/ndzied1/</uri></author><id>https://forge.codesys.comc99e451d66cc209f453020e89ebff572e9c25442</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I am not anywhere where I can test it but in most programming languages a sting will have a null character (0x00) as a deliminator so that the processor knows where the string ends.&lt;/p&gt;
&lt;p&gt;Can you move the object character by character?  Whatever is reading it would have to know that it doesn't contain a null delimiter but it should be possible.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>String type object length in CANopen OD?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/0ffd2da45b/?limit=25#f8b8" rel="alternate"/><published>2020-02-27T21:49:24.971000Z</published><updated>2020-02-27T21:49:24.971000Z</updated><author><name>jusbe99</name><uri>https://forge.codesys.com/u/jusbe99/</uri></author><id>https://forge.codesys.com369e799aee77690b0a8bca60a9f330c0435966c1</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Does anyone know, why a string variable takes one bytes more in ODEntries[] array, than it is defined in code?&lt;/p&gt;
&lt;p&gt;I have a CANopen OD object, which is four characters long. Like this: variableName:STRING(4):='ABCD'. &lt;/p&gt;
&lt;p&gt;But in ODEntries[] array its length is 5 (ODEntries[].wLen=5). Why is it like this? &lt;/p&gt;
&lt;p&gt;I would like to read this object by expedited SDO, and now it doesn't fit in four bytes. Damn.&lt;/p&gt;
&lt;p&gt;And I'am working with CoDeSys 2.3.9.4&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>