<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to How to Swap two Bytes in a word ?</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/9b9ec32c30/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/9b9ec32c30/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/9b9ec32c30/</id><updated>2023-06-21T03:28:13.251000Z</updated><subtitle>Recent posts to How to Swap two Bytes in a word ?</subtitle><entry><title>How to Swap two Bytes in a word ?</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/9b9ec32c30/?limit=25#d79c" rel="alternate"/><published>2023-06-21T03:28:13.251000Z</published><updated>2023-06-21T03:28:13.251000Z</updated><author><name>DreamWorks</name><uri>https://forge.codesys.com/u/dreamworks/</uri></author><id>https://forge.codesys.comca1c2ed337da81dafae7d120d741862734ec791a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;VAR&lt;br/&gt;
    Test1:WORD;&lt;br/&gt;
    Test2:Word;&lt;br/&gt;
END_VAR&lt;/p&gt;
&lt;p&gt;Test2:=MEM.ReverseBYTEsInWORD(Test1);&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How to Swap two Bytes in a word ?</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/9b9ec32c30/?limit=25#44d1" rel="alternate"/><published>2023-06-21T03:28:10.204000Z</published><updated>2023-06-21T03:28:10.204000Z</updated><author><name>DreamWorks</name><uri>https://forge.codesys.com/u/dreamworks/</uri></author><id>https://forge.codesys.coma6b30b3053c97a8c1c98140bf4296adc06c11de2</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;VAR&lt;br/&gt;
    Test1:WORD;&lt;br/&gt;
    Test2:Word;&lt;br/&gt;
END_VAR&lt;/p&gt;
&lt;p&gt;Test2:=MEM.ReverseBYTEsInWORD(Test1);&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How to Swap two Bytes in a word ?</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/9b9ec32c30/?limit=25#4c69" rel="alternate"/><published>2023-06-21T03:28:03.298000Z</published><updated>2023-06-21T03:28:03.298000Z</updated><author><name>DreamWorks</name><uri>https://forge.codesys.com/u/dreamworks/</uri></author><id>https://forge.codesys.com422e810c0eb551ff2976c5a44d1c7a1d5e579d3f</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;VAR&lt;br/&gt;
    Test1:WORD;&lt;br/&gt;
    Test2:Word;&lt;br/&gt;
END_VAR&lt;/p&gt;
&lt;p&gt;Test2:=MEM.ReverseBYTEsInWORD(Test1);&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How to Swap two Bytes in a word ?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/9b9ec32c30/?limit=25#9cb6" rel="alternate"/><published>2020-02-27T19:32:09.736000Z</published><updated>2020-02-27T19:32:09.736000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.com0274e1fb9e822fda00947eea5ab302d82f27809e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;em&gt;Originally created by:&lt;/em&gt; Mikhail Shvetsov&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;shooter hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
yes i do know but i like to advertise with oscat.&lt;br/&gt;
just because i like it.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Otherwise it seems like CoDeSys can nothing without  Oscat )&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How to Swap two Bytes in a word ?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/9b9ec32c30/?limit=25#d116" rel="alternate"/><published>2020-02-27T19:32:06.240000Z</published><updated>2020-02-27T19:32:06.240000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com0752f09b73427359b815ec2692e70ccfd7f629da</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;yes i do know but i like to advertise with oscat.&lt;br/&gt;
just because i like it.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How to Swap two Bytes in a word ?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/9b9ec32c30/?limit=25#c6c0" rel="alternate"/><published>2020-02-27T19:32:04.981000Z</published><updated>2020-02-27T19:32:04.981000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.comd570ee5af4f87cdb61aa5894b1dfa75f009a52be</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;em&gt;Originally created by:&lt;/em&gt; Mikhail Shvetsov&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;shooter hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
got it from oscat.de&lt;br/&gt;
swap_byte :=ROL(inword,8);&lt;br/&gt;
it is rolling over 8 bits just what you want.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;it'snot necessary to use oscat for this function. it's usual function from CoDeSys &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How to Swap two Bytes in a word ?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/9b9ec32c30/?limit=25#18c1" rel="alternate"/><published>2020-02-27T19:32:03.748000Z</published><updated>2020-02-27T19:32:03.748000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com933031915e618e7d38e3e980e6d179e3f6b45133</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;got it from oscat.de&lt;/p&gt;
&lt;p&gt;swap_byte :=ROL(inword,8);&lt;br/&gt;
it is rolling over 8 bits just what you want.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How to Swap two Bytes in a word ?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/9b9ec32c30/?limit=25#203a" rel="alternate"/><published>2020-02-27T19:32:00.262000Z</published><updated>2020-02-27T19:32:00.262000Z</updated><author><name>thetripathi</name><uri>https://forge.codesys.com/u/thetripathi/</uri></author><id>https://forge.codesys.com8d0aa8258a69e06cb5ce6126b0067cd76875ae75</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello All,&lt;br/&gt;
I have just joined this forum and I would to say hello to all the members. I hope I will get lot of information here.&lt;br/&gt;
I am using ABB AC500 PLC and Vekio Citec 7.1 for my application. The software platform is obviously CodeSys 2.3. Whenever I am transferring a word to the HMI,it is swapped i.e. Hi word comes as Lo word and vice versa. I guess I need to write a code into CodeSys to swap the word before sending it to the HMI. Can anyone help me out as to how to write the swapping code in codesys ?&lt;/p&gt;
&lt;p&gt;Thanks in advance&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>