<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to How long can a WSTRING be in CodeSys V3?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/71cafec577/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/71cafec577/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/71cafec577/</id><updated>2025-03-02T20:07:07.246000Z</updated><subtitle>Recent posts to How long can a WSTRING be in CodeSys V3?</subtitle><entry><title>How long can a WSTRING be in CodeSys V3?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/71cafec577/?limit=25#c8fc/fc3b" rel="alternate"/><published>2025-03-02T20:07:07.246000Z</published><updated>2025-03-02T20:07:07.246000Z</updated><author><name>helcioburd</name><uri>https://forge.codesys.com/u/helcioburd/</uri></author><id>https://forge.codesys.come5693fe741d5fc784decd0eada315cca7c49e1be</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thank you, very useful information. I did a library for serial communication and could not understand the reason only 256 chars could be read (after sending more than 256). Following your suggestion,  I can now send any number of chars and everything will be received.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How long can a WSTRING be in CodeSys V3?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/71cafec577/?limit=25#331b" rel="alternate"/><published>2020-06-10T18:02:14.583000Z</published><updated>2020-06-10T18:02:14.583000Z</updated><author><name>jtebokkel</name><uri>https://forge.codesys.com/u/jtebokkel/</uri></author><id>https://forge.codesys.comc8a24185a7ec22dd75996f58ff4ed79961dc4771</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;from &lt;a class="user-mention" href="/u/aliazzz/"&gt;@aliazzz&lt;/a&gt; in a PM&lt;/p&gt;
&lt;hr/&gt;
&lt;p&gt;The Add Object Parameter List was removed in CODESYS Engineering;&lt;br/&gt;
*Add object &amp;gt; global parameter list (3.5.15.0)&lt;/p&gt;
&lt;hr/&gt;
&lt;p&gt;I'm guessing here that the idea is for future libraries to use Function Block Factories?&lt;br/&gt;
&lt;a href="https://help.codesys.com/webapp/idx-CAA_FBFactory-lib;product=CAA_FBFactory;version=3.5.13.0" rel="nofollow"&gt;https://help.codesys.com/webapp/idx-CAA_FBFactory-lib;product=CAA_FBFactory;version=3.5.13.0&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How long can a WSTRING be in CodeSys V3?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/71cafec577/?limit=25#c8fc" rel="alternate"/><published>2020-02-27T14:16:33.049000Z</published><updated>2020-02-27T14:16:33.049000Z</updated><author><name>Comingback4u</name><uri>https://forge.codesys.com/u/comingback4u/</uri></author><id>https://forge.codesys.come98027ffc8b98599fee6c8797465a3187200dc86</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;You need to use the function calls in Stu and not the Standard library. For example:&lt;/p&gt;
&lt;p&gt;Stu.Standard.LEN should really be Stu.StrLenW&lt;br/&gt;
Stu.Standard.CONCAT should really be Stu.StrConcatW&lt;/p&gt;
&lt;p&gt;If you look at the data type of Stu.Standard.LEN/CONCAT it is looking for a string input which has the 255 character max. This means anything you pass it automatically gets truncated if it is larger than 255. The Stu.StrLenW input is looking at a pointer which it will iterate through until it finds the terminating zero character. This gives it a way to not be size restricted.&lt;/p&gt;
&lt;p&gt;So for your code try&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;StringLength&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Stu&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;StrLenW&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ADR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;TomString&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;StringLength needs to be DINT. This is like how Edwin did it but he used WSTRING instead of STRING so different function calls are needed.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How long can a WSTRING be in CodeSys V3?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/71cafec577/?limit=25#aee1" rel="alternate"/><published>2020-02-27T14:16:32.523000Z</published><updated>2020-02-27T14:16:32.523000Z</updated><author><name>Volvo742</name><uri>https://forge.codesys.com/u/volvo742/</uri></author><id>https://forge.codesys.com7bf026e5224604033acc80ee7b70c8879fa3d0e6</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I included the library StringUtils, but still, the maximum string length is 80 chars.&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: Capture.PNG" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=3596"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: Capture.PNG" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=3595"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How long can a WSTRING be in CodeSys V3?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/71cafec577/?limit=25#7171" rel="alternate"/><published>2020-02-27T14:16:31.184000Z</published><updated>2020-02-27T14:16:31.184000Z</updated><author><name>Volvo742</name><uri>https://forge.codesys.com/u/volvo742/</uri></author><id>https://forge.codesys.com416759e859ce8ee4f25cd6e2e893505829a887f0</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Edwin Schwellinger hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
Hi,&lt;br/&gt;
would recomended to use StringUtils.library!&lt;br/&gt;
BR&lt;br/&gt;
Edwin&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Thanks! So there is no limit for StringUtils library?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How long can a WSTRING be in CodeSys V3?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/71cafec577/?limit=25#2811" rel="alternate"/><published>2020-02-27T14:16:30.797000Z</published><updated>2020-02-27T14:16:30.797000Z</updated><author><name>eschwellinger</name><uri>https://forge.codesys.com/u/eschwellinger/</uri></author><id>https://forge.codesys.comddcbefbd553e478e048f1018a28e4574e48beb57</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;br/&gt;
would recomended to use StringUtils.library!&lt;/p&gt;
&lt;p&gt;BR&lt;br/&gt;
Edwin&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: length.jpg" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=3597"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: StringUtils.jpg" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=3594"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="https://forum.codesys.com//download/file.php?id=3593" rel="nofollow"&gt;StringUtilsExample.project &lt;span&gt;&lt;span&gt;[476.59 KiB]&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How long can a WSTRING be in CodeSys V3?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/71cafec577/?limit=25#3185" rel="alternate"/><published>2020-02-27T14:16:30.416000Z</published><updated>2020-02-27T14:16:30.416000Z</updated><author><name>e.kislov</name><uri>https://forge.codesys.com/u/e-kislov/</uri></author><id>https://forge.codesys.com678fc303d728c7a7d4842f99b08ddec549092746</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;As I say before - pointers, SysMem...&lt;br/&gt;
So you need to use memory manipulation.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How long can a WSTRING be in CodeSys V3?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/71cafec577/?limit=25#f0e8" rel="alternate"/><published>2020-02-27T14:16:29.125000Z</published><updated>2020-02-27T14:16:29.125000Z</updated><author><name>Volvo742</name><uri>https://forge.codesys.com/u/volvo742/</uri></author><id>https://forge.codesys.comd6d25edb30155ff8d475eefa8d1517ee778a002c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;e.kislov hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
"String functions" are all functions which used for any strings. No matter STRING type (ASCII-based charset) or WSTRING (Unicode/UCS2) - only 255 chars supprorted in Standard/Standard64 library.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Ok. So there is no idea to have a longer string?&lt;/p&gt;
&lt;p&gt;Who set the 255 limit? That's very bad.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How long can a WSTRING be in CodeSys V3?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/71cafec577/?limit=25#6729" rel="alternate"/><published>2020-02-27T14:16:28.664000Z</published><updated>2020-02-27T14:16:28.664000Z</updated><author><name>e.kislov</name><uri>https://forge.codesys.com/u/e-kislov/</uri></author><id>https://forge.codesys.com4bf16a52173b9d78d0da0ea1aae341a2d3bbabbd</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;"String functions" are all functions which used for any strings. No matter STRING type (ASCII-based charset) or WSTRING (Unicode/UCS2) - only 255 chars supported in Standard/Standard64 library.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How long can a WSTRING be in CodeSys V3?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/71cafec577/?limit=25#f3f3" rel="alternate"/><published>2020-02-27T14:16:28.292000Z</published><updated>2020-02-27T14:16:28.292000Z</updated><author><name>Volvo742</name><uri>https://forge.codesys.com/u/volvo742/</uri></author><id>https://forge.codesys.com3a53224bc261f6afba30ac64dcc4d3cc06ff3a02</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;e.kislov hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
255 chars&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;But isn't that STRING ? &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Zitat:&lt;/strong&gt;&lt;br/&gt;
As a rule, CODESYS does not limit the string length; however,  If a variable is initialized with a string that is too long for the data type, then CODESYS truncates the string accordingly from the right.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a class="" href="https://help.codesys.com/api-content/2/codesys/3.5.12.0/en/_cds_datatype_string/#f9d0d32793f124b8c0a8640e000143a0-3s-string" rel="nofollow"&gt;https://help.codesys.com/api-content/2/ ... -3s-string&lt;/a&gt; m &lt;/p&gt;&lt;/div&gt;</summary></entry></feed>