<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to How to convert UDINT to array of bytes ? </title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3a2edc107d/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3a2edc107d/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/3a2edc107d/</id><updated>2023-03-10T08:00:44.253000Z</updated><subtitle>Recent posts to How to convert UDINT to array of bytes ? </subtitle><entry><title>How to convert UDINT to array of bytes ? </title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3a2edc107d/?limit=25#b999/73c3" rel="alternate"/><published>2023-03-10T08:00:44.253000Z</published><updated>2023-03-10T08:00:44.253000Z</updated><author><name>vformanek</name><uri>https://forge.codesys.com/u/vformanek/</uri></author><id>https://forge.codesys.comc8b33c39d674e45dbcb9e4a03584d3cba249b872</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;nevermind, I did something wrong in the conversion, my bad. Thanks! &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How to convert UDINT to array of bytes ? </title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3a2edc107d/?limit=25#b999" rel="alternate"/><published>2023-03-10T07:50:24.235000Z</published><updated>2023-03-10T07:50:24.235000Z</updated><author><name>timvh</name><uri>https://forge.codesys.com/u/timvh/</uri></author><id>https://forge.codesys.com2b8dca63899427e5c204dc53aed73aaf76726628</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;2172731138 = hex 81 81 3F 02&lt;br/&gt;
hex 02 = dec 2&lt;br/&gt;
hex 3F = dec 63&lt;br/&gt;
hex 81 = dec 129&lt;/p&gt;
&lt;p&gt;So this seems okay to me.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How to convert UDINT to array of bytes ? </title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3a2edc107d/?limit=25#0955/4405" rel="alternate"/><published>2023-03-10T07:37:22.582000Z</published><updated>2023-03-10T07:37:22.582000Z</updated><author><name>vformanek</name><uri>https://forge.codesys.com/u/vformanek/</uri></author><id>https://forge.codesys.combe115d05a4335431457ff45c51e27ec864fa7c5b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I have tried this approach, but it seems to be inconsistent. Here is the code i have come with: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="err"&gt;TYPE uDINTBytes :&lt;/span&gt;
&lt;span class="err"&gt;  UNION&lt;/span&gt;
&lt;span class="err"&gt;    rValue: UDINT; &lt;/span&gt;
&lt;span class="err"&gt;    abValue: ARRAY [0..3] OF BYTE;&lt;/span&gt;
&lt;span class="err"&gt;  END_UNION&lt;/span&gt;
&lt;span class="err"&gt;END_TYPE&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;But here is the output whitch is wrong. &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How to convert UDINT to array of bytes ? </title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3a2edc107d/?limit=25#0955" rel="alternate"/><published>2023-03-08T07:38:39.477000Z</published><updated>2023-03-08T07:38:39.477000Z</updated><author><name>timvh</name><uri>https://forge.codesys.com/u/timvh/</uri></author><id>https://forge.codesys.comfa6a14b6875cd589942f5c0f3f90e30ff80db13e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;You could also create a DUT of the Type Union.&lt;br/&gt;
In the Union add an array of 4 bytes and a UDINT.&lt;/p&gt;
&lt;p&gt;Then create a variable of this type.&lt;br/&gt;
Write to the UDINT of this union variable and read the array of bytes.&lt;/p&gt;
&lt;p&gt;See &lt;a href="https://content.helpme-codesys.com/en/CODESYS%20Development%20System/_cds_datatype_union.html" rel="nofollow"&gt;https://content.helpme-codesys.com/en/CODESYS%20Development%20System/_cds_datatype_union.html&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How to convert UDINT to array of bytes ? </title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3a2edc107d/?limit=25#2a0a" rel="alternate"/><published>2023-03-06T12:46:34.804000Z</published><updated>2023-03-06T12:46:34.804000Z</updated><author><name>sedoerr</name><uri>https://forge.codesys.com/u/sedoerr/</uri></author><id>https://forge.codesys.comf0ff13f88e647f065907b197b5fed12f2e60a00f</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;img src="./attachment/attachment.png" width="50%"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How to convert UDINT to array of bytes ? </title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3a2edc107d/?limit=25#0bf0" rel="alternate"/><published>2023-03-06T12:07:54.589000Z</published><updated>2023-03-06T12:07:54.589000Z</updated><author><name>vformanek</name><uri>https://forge.codesys.com/u/vformanek/</uri></author><id>https://forge.codesys.com5fee0893a041631a6fc9f02ccece55acf7fa35fb</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;could you provide a screenshot solution of the block call ? i seem to get exceptions about access violation when running the program &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How to convert UDINT to array of bytes ? </title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3a2edc107d/?limit=25#83e8" rel="alternate"/><published>2023-03-06T10:22:55.151000Z</published><updated>2023-03-06T10:22:55.151000Z</updated><author><name>sedoerr</name><uri>https://forge.codesys.com/u/sedoerr/</uri></author><id>https://forge.codesys.com92842193392bca1ea9e3797ca082eaec3966f742</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;use UDINT_TO_DWORD and then use Library "SysMem.SysMemCopy" to copy your DWORD onto your Array of Bytes.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How to convert UDINT to array of bytes ? </title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3a2edc107d/?limit=25#f430" rel="alternate"/><published>2023-03-06T10:02:17.853000Z</published><updated>2023-03-06T10:02:17.853000Z</updated><author><name>vformanek</name><uri>https://forge.codesys.com/u/vformanek/</uri></author><id>https://forge.codesys.com3f97dff05a4d5a8ead58d8ac5732b497f8d65111</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I have a UDINT value whitch represents PNIO_Status and i would like to convert it to 4 bytes so i can decode it by this website: &lt;a href="https://content.helpme-codesys.com/en/CODESYS%20PROFINET/_pnio_diagnosis_pnio_state.html" rel="nofollow"&gt;https://content.helpme-codesys.com/en/CODESYS%20PROFINET/_pnio_diagnosis_pnio_state.html&lt;/a&gt;&lt;br/&gt;
How can i convert the UDINT value to 4 BYTES so it would corespond to the page I have provided earlier ? &lt;/p&gt;&lt;/div&gt;</summary></entry></feed>