<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Display Unicode as WSTRING</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/58cdb54bc2/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Visualization/thread/58cdb54bc2/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Visualization/thread/58cdb54bc2/</id><updated>2020-06-30T09:22:41.303000Z</updated><subtitle>Recent posts to Display Unicode as WSTRING</subtitle><entry><title>Display Unicode as WSTRING</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/58cdb54bc2/?limit=25#8647" rel="alternate"/><published>2020-06-30T09:22:41.303000Z</published><updated>2020-06-30T09:22:41.303000Z</updated><author><name>rasmus-houtved</name><uri>https://forge.codesys.com/u/rasmus-houtved/</uri></author><id>https://forge.codesys.comf33afd80a5357b81e0eab1d82698cf60a021c2de</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks &lt;/p&gt;
&lt;p&gt;It works as I would like it to work.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Display Unicode as WSTRING</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/58cdb54bc2/?limit=25#0d98" rel="alternate"/><published>2020-06-30T08:59:24.942000Z</published><updated>2020-06-30T08:59:24.942000Z</updated><author><name>i-campbell</name><uri>https://forge.codesys.com/u/i-campbell/</uri></author><id>https://forge.codesys.com131bab48e2ceda63df6b83699f1295285679121b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Add the CAA Memory library.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nf"&gt;VAR&lt;/span&gt;
    &lt;span class="nc"&gt;Wstr&lt;/span&gt; &lt;span class="err"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;WSTRING&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nf"&gt;usintarray&lt;/span&gt; &lt;span class="err"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;ARRAY&lt;/span&gt; [&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;.&lt;span class="m"&gt;3&lt;/span&gt;] &lt;span class="nf"&gt;OF&lt;/span&gt; &lt;span class="nf"&gt;USINT&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; [&lt;span class="m"&gt;16&lt;/span&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="nf"&gt;00&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt; &lt;span class="m"&gt;16&lt;/span&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="nf"&gt;47&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt; &lt;span class="m"&gt;16&lt;/span&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="nf"&gt;0&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt; &lt;span class="m"&gt;16&lt;/span&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="nf"&gt;49&lt;/span&gt;]&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;END_VAR&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;Wstr&lt;/span&gt;[&lt;span class="m"&gt;0&lt;/span&gt;] &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nc"&gt;MEM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;PackBytesToWord&lt;/span&gt;(&lt;span class="nv"&gt;byHighByte&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nv"&gt;usintarray&lt;/span&gt;[&lt;span class="m"&gt;0&lt;/span&gt;]&lt;span class="nf"&gt;,&lt;/span&gt; &lt;span class="err"&gt;byLowByte&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nv"&gt;usintarray&lt;/span&gt;[&lt;span class="m"&gt;1&lt;/span&gt;])&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;Wstr&lt;/span&gt;[&lt;span class="m"&gt;1&lt;/span&gt;] &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nc"&gt;MEM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;PackBytesToWord&lt;/span&gt;(&lt;span class="nv"&gt;byHighByte&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nv"&gt;usintarray&lt;/span&gt;[&lt;span class="m"&gt;2&lt;/span&gt;]&lt;span class="nf"&gt;,&lt;/span&gt; &lt;span class="err"&gt;byLowByte&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nv"&gt;usintarray&lt;/span&gt;[&lt;span class="m"&gt;3&lt;/span&gt;])&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;Wstr&lt;/span&gt;[&lt;span class="m"&gt;2&lt;/span&gt;] &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="m"&gt;16&lt;/span&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="nf"&gt;0000&lt;/span&gt;; &lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="nc"&gt;Terminating&lt;/span&gt; &lt;span class="nf"&gt;character&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;</summary></entry><entry><title>Display Unicode as WSTRING</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/58cdb54bc2/?limit=25#7f3b" rel="alternate"/><published>2020-06-30T08:36:10.550000Z</published><updated>2020-06-30T08:36:10.550000Z</updated><author><name>rasmus-houtved</name><uri>https://forge.codesys.com/u/rasmus-houtved/</uri></author><id>https://forge.codesys.com20b2f0835a226b44a5a89afac540f2d805289b1c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;They will be in a USINT Array&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Display Unicode as WSTRING</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/58cdb54bc2/?limit=25#5784" rel="alternate"/><published>2020-06-30T08:30:48.513000Z</published><updated>2020-06-30T08:30:48.513000Z</updated><author><name>i-campbell</name><uri>https://forge.codesys.com/u/i-campbell/</uri></author><id>https://forge.codesys.com9a5eaa27a4d501cb14e7d600546665e7a8a9061f</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Can you access these (00 48 00 49) as a byte array or word array already?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Display Unicode as WSTRING</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/58cdb54bc2/?limit=25#a570" rel="alternate"/><published>2020-06-30T08:24:53.912000Z</published><updated>2020-06-30T08:24:53.912000Z</updated><author><name>rasmus-houtved</name><uri>https://forge.codesys.com/u/rasmus-houtved/</uri></author><id>https://forge.codesys.come061a1f14d06bbc3b238e3126a220e2dab2e4395</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;a class="user-mention" href="/u/i-campbell/"&gt;@i-campbell&lt;/a&gt;&lt;br/&gt;
Thanks but my Russian is not my strong side :-)&lt;/p&gt;
&lt;p&gt;But I think I need to clarify my problem a bit better.&lt;/p&gt;
&lt;p&gt;A simple example&lt;br/&gt;
I will receive 2 CAN frames with each 2 databytes.&lt;br/&gt;
Can message 1 databyte = 00 48 (H)&lt;br/&gt;
Can message 2 ddatayte = 00 49 (I)&lt;/p&gt;
&lt;p&gt;I will need these two can messages to become the word "Hi" in a wstring.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Display Unicode as WSTRING</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/58cdb54bc2/?limit=25#17c3" rel="alternate"/><published>2020-06-30T06:32:05.529000Z</published><updated>2020-06-30T06:32:05.529000Z</updated><author><name>i-campbell</name><uri>https://forge.codesys.com/u/i-campbell/</uri></author><id>https://forge.codesys.comca7af1a9b55f454a8c502ff6a6fd829e4535cc7b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;$ is just an escape character. "$0400" means 'a two byte character, lowbyte is 00, high byte is 04'&lt;br/&gt;
Might be easier to do:&lt;br/&gt;
Wstr&lt;span&gt;[0]&lt;/span&gt; := %IW0;&lt;br/&gt;
Wstr&lt;a class="alink" href="/forge/talk-ru/1/"&gt;[1]&lt;/a&gt; := %IW1;&lt;br/&gt;
etc.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Display Unicode as WSTRING</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/58cdb54bc2/?limit=25#42c8" rel="alternate"/><published>2020-06-29T12:38:41.038000Z</published><updated>2020-06-29T12:38:41.038000Z</updated><author><name>rasmus-houtved</name><uri>https://forge.codesys.com/u/rasmus-houtved/</uri></author><id>https://forge.codesys.com9c0bdb18d10ab19c3a6a70a904ded27d263cc03a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;It is more a question about getting the $ into my Wstring so it can be seen as a Unicode.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Display Unicode as WSTRING</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/58cdb54bc2/?limit=25#ca74" rel="alternate"/><published>2020-06-29T11:50:09.602000Z</published><updated>2020-06-29T11:50:09.602000Z</updated><author><name>i-campbell</name><uri>https://forge.codesys.com/u/i-campbell/</uri></author><id>https://forge.codesys.com4435dc37739c2c2d42ca04a09999fceff49fcc10</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Maybe you need to try byteswapping. &lt;br/&gt;
MemUtils.MemCpy() can copy the bytes from where they are to your WSTRING&lt;br/&gt;
You then need to find a byteswap function somewhere if required. Maybe MemUtils.Swap or MemForceSwap&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Display Unicode as WSTRING</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/58cdb54bc2/?limit=25#3de6" rel="alternate"/><published>2020-06-29T09:25:41.707000Z</published><updated>2020-06-29T09:25:41.707000Z</updated><author><name>rasmus-houtved</name><uri>https://forge.codesys.com/u/rasmus-houtved/</uri></author><id>https://forge.codesys.com137a0c9f6d227391830f2a5bb24e9854b7e36267</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I have an application that needs to support multiple languages therefor I need to be able to display special letters.&lt;br/&gt;
I will receive each letter as an utf-16 as 2 bytes via CAN messages.&lt;br/&gt;
If I do this:&lt;/p&gt;
&lt;p&gt;WStr:="$0400" I get the visualization Ѐ Which is correct.&lt;/p&gt;
&lt;p&gt;My challenge here is that the data I receive via CAN will only be 04 00.&lt;br/&gt;
I can simply not get the application to show the result I need.&lt;/p&gt;
&lt;p&gt;Can anyone help on a good solution or just a solution.&lt;/p&gt;
&lt;p&gt;I am running Codesys 3.5 and the application is running on an IFM terminal.&lt;br/&gt;
I would also like to be able to do this in Codesys 2.3&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>