<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Umrechnung Dezimal in Fliesskomma</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/8d95159605/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/8d95159605/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Deutsch/thread/8d95159605/</id><updated>2020-02-28T12:38:06.807000Z</updated><subtitle>Recent posts to Umrechnung Dezimal in Fliesskomma</subtitle><entry><title>Umrechnung Dezimal in Fliesskomma</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/8d95159605/?limit=25#93b9" rel="alternate"/><published>2020-02-28T12:38:06.807000Z</published><updated>2020-02-28T12:38:06.807000Z</updated><author><name>Michael.Klank</name><uri>https://forge.codesys.com/u/michael-klank/</uri></author><id>https://forge.codesys.com298774cceb141cbf045ac738ce9785b2cc206411</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Aus dem &lt;a class="" href="http://www.oscat.de/community/index.php?action=profile;u=123;sa=showPosts" rel="nofollow"&gt;Oscat&lt;/a&gt; Forum:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nt"&gt;IEEE32&lt;/span&gt; &lt;span class="nt"&gt;in&lt;/span&gt; &lt;span class="nt"&gt;REAL&lt;/span&gt;
&lt;span class="nt"&gt;FUNCTION&lt;/span&gt; &lt;span class="nt"&gt;IEEE32_TO_REAL&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;REAL&lt;/span&gt;
&lt;span class="nt"&gt;VAR_INPUT&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="nt"&gt;IN&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nd"&gt;DWORD&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;END_VAR&lt;/span&gt;
&lt;span class="nt"&gt;VAR&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="nt"&gt;PTREAL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nd"&gt;POINTER&lt;/span&gt; &lt;span class="nt"&gt;TO&lt;/span&gt; &lt;span class="nt"&gt;REAL&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;END_VAR&lt;/span&gt;
&lt;span class="nt"&gt;PTREAL&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;ADR&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;IN&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="nt"&gt;IEEE32_TO_REAL&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;PTREAL&lt;/span&gt;&lt;span class="o"&gt;^;&lt;/span&gt;
&lt;span class="nt"&gt;END_FUNCTION&lt;/span&gt;
&lt;span class="nt"&gt;REAL&lt;/span&gt; &lt;span class="nt"&gt;in&lt;/span&gt; &lt;span class="nt"&gt;IEEE32&lt;/span&gt;
&lt;span class="nt"&gt;FUNCTION&lt;/span&gt; &lt;span class="nt"&gt;REAL_TO_IEEE32&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;DWORD&lt;/span&gt;
&lt;span class="nt"&gt;VAR_INPUT&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="nt"&gt;IN&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nd"&gt;REAL&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;END_VAR&lt;/span&gt;
&lt;span class="nt"&gt;VAR&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="nt"&gt;PTDWORD&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nd"&gt;POINTER&lt;/span&gt; &lt;span class="nt"&gt;TO&lt;/span&gt; &lt;span class="nt"&gt;DWORD&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;END_VAR&lt;/span&gt;
&lt;span class="nt"&gt;PTDWORD&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;ADR&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;IN&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="nt"&gt;REAL_TO_IEEE32&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;PTDWORD&lt;/span&gt;&lt;span class="o"&gt;^;&lt;/span&gt;
&lt;span class="nt"&gt;END_FUNCTION&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Michael&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Umrechnung Dezimal in Fliesskomma</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/8d95159605/?limit=25#5e3f" rel="alternate"/><published>2020-02-28T12:37:59.440000Z</published><updated>2020-02-28T12:37:59.440000Z</updated><author><name>Michael.Klank</name><uri>https://forge.codesys.com/u/michael-klank/</uri></author><id>https://forge.codesys.com71b70a4395b84671ee491f505cb94e59ef2392b2</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Also &lt;a class="" href="http://de.wikipedia.org/wiki/IEEE_754" rel="nofollow"&gt;damit&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Michael&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Umrechnung Dezimal in Fliesskomma</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/8d95159605/?limit=25#7fa1" rel="alternate"/><published>2020-02-28T12:37:56.387000Z</published><updated>2020-02-28T12:37:56.387000Z</updated><author><name>scorpion</name><uri>https://forge.codesys.com/u/scorpion/</uri></author><id>https://forge.codesys.com6aea7338895bab52367807ae9523a0451f2352d1</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hallo zusammen&lt;/p&gt;
&lt;p&gt;Die Wandlung von Real (z.B. 1.02) in das &lt;strong&gt;IEEE 754-Format &lt;/strong&gt;scheint ja auf diese Weise zu funtkionieren.&lt;/p&gt;
&lt;p&gt;Ich brauche aber &lt;strong&gt;die umgekehrte Funktion&lt;/strong&gt;. &lt;/p&gt;
&lt;p&gt;Mein Profibus Slave liefert mir den Istwert aufgeteilt auf die 4 Bytes.&lt;/p&gt;
&lt;p&gt;Diese Bytes möchte ich nun in eine "normale" REAL-Zahl wandeln.&lt;/p&gt;
&lt;p&gt;Kann mir jemand helfen?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Umrechnung Dezimal in Fliesskomma</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/8d95159605/?limit=25#c439" rel="alternate"/><published>2020-02-28T12:37:48.999000Z</published><updated>2020-02-28T12:37:48.999000Z</updated><author><name>Wolfgang Doll</name><uri>https://forge.codesys.com/u/wolfgang-doll/</uri></author><id>https://forge.codesys.com5f00b8c4ed1411547995fdb6cd2147f459bdc159</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Für den Fall, dass es um die Darstellung des binären Musters im Speicher geht würde ich folgendes vorschlagen:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="n"&gt;VAR&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="n"&gt;sValue&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;STRING&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="n"&gt;rValue&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;REAL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="n"&gt;pValue&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;POINTER&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;DWORD&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt; &lt;span class="n"&gt;dwValue&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;DWORD&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="n"&gt;END_VAR&lt;/span&gt;
&lt;span class="n"&gt;sValue&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="ss"&gt;"1.02"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;rValue&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;STRING_TO_REAL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sValue&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;pValue&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&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;rValue&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;dwValue&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pValue&lt;/span&gt;&lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;In dwValue steht die Zahl "1.02" als Bitmuster im IEEE Format.&lt;/p&gt;
&lt;p&gt;In diesem Fall also : 16#3F828F5C&lt;/p&gt;
&lt;p&gt;Gruß&lt;/p&gt;
&lt;p&gt;Wolfgang Doll&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Umrechnung Dezimal in Fliesskomma</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/8d95159605/?limit=25#7576" rel="alternate"/><published>2020-02-28T12:37:46.286000Z</published><updated>2020-02-28T12:37:46.286000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.comdb2a12331b4e623ce85335d04e9a5e4c93eb0bf5</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;em&gt;Originally created by:&lt;/em&gt; Gast&lt;/p&gt;
&lt;p&gt;Die Konverierungsfunktionen STRING_TO_REAL bzw. STRING_TO_LREAL leisten das gewünschte. Das Zielformat ist das Gleitkommaformat der jeweiligen CPU. Das ist bis auf wenige Ausnahmen (8051, manche c16x Plattformen) IEE-konform.&lt;/p&gt;
&lt;p&gt;Gruß&lt;/p&gt;
&lt;p&gt;Dieter Hess&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Umrechnung Dezimal in Fliesskomma</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/8d95159605/?limit=25#1c96" rel="alternate"/><published>2020-02-28T12:37:38.804000Z</published><updated>2020-02-28T12:37:38.804000Z</updated><author><name>Matze</name><uri>https://forge.codesys.com/u/matze/</uri></author><id>https://forge.codesys.com111effa972e0beda68748806e7f60c28505fc970</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Ich hab da mal eine Frage. Gibt es bei Codesys einen Baustein , der mir eine Dezimaldarstellung von Zahlen (z.B. "1.02") in eine von modernen CPUs verwendeten IEEE 754-Fließkommazahldarstellung umwandelt ?&lt;/p&gt;
&lt;p&gt;Danke für die Hilfe.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>