<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Unpacking a decimal</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/8682b79b26/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/8682b79b26/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/8682b79b26/</id><updated>2020-02-27T22:49:46.433000Z</updated><subtitle>Recent posts to Unpacking a decimal</subtitle><entry><title>Unpacking a decimal</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/8682b79b26/?limit=25#a6b0" rel="alternate"/><published>2020-02-27T22:49:46.433000Z</published><updated>2020-02-27T22:49:46.433000Z</updated><author><name>Jonascox</name><uri>https://forge.codesys.com/u/jonascox/</uri></author><id>https://forge.codesys.com8a4cc2240aa7f6b44829f36a4b8eb72d3fe90098</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;somlioy hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
Hello&lt;br/&gt;
Got a word containing a decimal number which refers to some modbus registers on another plc.&lt;br/&gt;
I'm aware I can use unpack for the first 8 byte, but what about those comming after?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Assign the word to a memory location such as %MW0. &lt;br/&gt;
MYWORD at %MW0:WORD;&lt;/p&gt;
&lt;p&gt;Then assign variable names to each bit within %MW0. &lt;br/&gt;
MYWORD_BIT_00 at %MX0.0:Bool;&lt;br/&gt;
MYWORD_BIT_01 at %MX0.1:Bool;&lt;br/&gt;
etc.&lt;/p&gt;
&lt;p&gt;Then each bit of your word is accessible and visible.&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: Bild" rel="nofollow" src="https://lh3.googleusercontent.com/6pG5c_r3GZi_1LlsGWE4vRNWf9fmxu-AFO8xD-F7A_C2ZLhLPtxbN_tkR5u1PE5_L3qIG7DK-hfLjkTKIkqBeHx3jHJS9pWEj5tlZ8h3cphZAV4Sr_jaZ1gI9kyTX7Iqd-S5rY-Ca2ikoTuomJF6yKtbzZNat5TL47YJGUiZZZ86HOPKYgmcJvFwR0CA9L4pmWTjyOhQnjSI37yplt6R83gjcpG193Zv4uI_EinGRO9LnalN1RYAf0AIgQBZXpE7lKekBRukXnjx_rzpADmx2FrQe_SHLEbeO1oBxSGRVn8fgP7S66bBAT1n7ttLKq3aEpvkbeC5UWNv2PNyHJOiUGcTs1DNEPJPNt2OV74XE5qYGh4YwUplLhkFi5DZNQBSAMxg0ugrBYbX8vz1hYHOWy9Cho7UN1s0I97rvNnGQRH2lw_LkFzLonmn_5p1YMLSSi7fsdMCagalw7fOPY7PyDKiqV8zSM6FR3v26BGT4mhHaM3kisI3RQdLcHyW66e-G4JKO_CTUu_EH_vqc4hwSPpHA_ftBGAJFBA_tiU1XrHK=w408-h686-no"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Unpacking a decimal</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/8682b79b26/?limit=25#b622" rel="alternate"/><published>2020-02-27T22:49:44.809000Z</published><updated>2020-02-27T22:49:44.809000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.comea5e1d9ec351796ce237558044ac984bc95405ef</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;probably you mean bits instead of bytes.&lt;br/&gt;
you can use a word breaker (makes 2 bytes out of it, or you can use the wordvariable.0 etc.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Unpacking a decimal</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/8682b79b26/?limit=25#923a" rel="alternate"/><published>2020-02-27T22:49:40.327000Z</published><updated>2020-02-27T22:49:40.327000Z</updated><author><name>jethridge</name><uri>https://forge.codesys.com/u/jethridge/</uri></author><id>https://forge.codesys.com0551a41bc0213fe5131d1eebdc2f3d8d924d86fd</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I recently needed to do something similar to what you are doing now. I checked the Oscat libraries, but ended up writing my own FB. However, I was shifting an array, not a register. You will most likely need to write your own function block using either BSR/BSL or the rotate command (ROL and another one, I think).&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Unpacking a decimal</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/8682b79b26/?limit=25#7a83" rel="alternate"/><published>2020-02-27T22:49:38.572000Z</published><updated>2020-02-27T22:49:38.572000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com24f17bc5cb6d914bb51c1fe4b85c8b03d3d651dd</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;check oscat.de for a nice bundle of functions.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Unpacking a decimal</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/8682b79b26/?limit=25#9317" rel="alternate"/><published>2020-02-27T22:49:36.983000Z</published><updated>2020-02-27T22:49:36.983000Z</updated><author><name>somlioy</name><uri>https://forge.codesys.com/u/somlioy/</uri></author><id>https://forge.codesys.com8e170c27cfe914b7e8cd5ddeebdde35f362c1647</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;Got a word containing a decimal number which refers to some modbus registers on another plc.&lt;br/&gt;
I'm aware I can use unpack for the first 8 byte, but what about those comming after?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>