<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Modbus Worte in Real umwandeln</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/f6455d036f/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/f6455d036f/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Deutsch/thread/f6455d036f/</id><updated>2020-02-28T00:08:45.323000Z</updated><subtitle>Recent posts to Modbus Worte in Real umwandeln</subtitle><entry><title>Modbus Worte in Real umwandeln</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/f6455d036f/?limit=25#1c0d" rel="alternate"/><published>2020-02-28T00:08:45.323000Z</published><updated>2020-02-28T00:08:45.323000Z</updated><author><name>BOBmoraine</name><uri>https://forge.codesys.com/u/bobmoraine/</uri></author><id>https://forge.codesys.com35aca47f0e75d7c6ce269c9e17b8d07e9f8b3767</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Ich bin inzwischen selbst drauf gekommen und habe es wie folgt mit Hilfe der OSCAT-Bibliothek gelöst:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;VAR_GLOBAL&lt;/span&gt;
   &lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="n"&gt;Modbus&lt;/span&gt; &lt;span class="n"&gt;Vars&lt;/span&gt;
   &lt;span class="n"&gt;Reals_0_from_1200&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ARRAY&lt;/span&gt; &lt;span class="n"&gt;[0..4]&lt;/span&gt; &lt;span class="n"&gt;OF&lt;/span&gt; &lt;span class="n"&gt;REAL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;END_VAR&lt;/span&gt;
&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="n"&gt;MB_Real_0_hi&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="n"&gt;HI&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Word&lt;/span&gt; &lt;span class="n"&gt;des&lt;/span&gt; &lt;span class="n"&gt;REAL&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Bereichs&lt;/span&gt; &lt;span class="n"&gt;von&lt;/span&gt; &lt;span class="n"&gt;S7&lt;/span&gt;&lt;span class="m"&gt;-1200&lt;/span&gt;
&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="n"&gt;MB_Real_0_low&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="n"&gt;LOW&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Word&lt;/span&gt; &lt;span class="n"&gt;des&lt;/span&gt; &lt;span class="n"&gt;REAL&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Bereichs&lt;/span&gt; &lt;span class="n"&gt;von&lt;/span&gt; &lt;span class="n"&gt;S7&lt;/span&gt;&lt;span class="m"&gt;-1200&lt;/span&gt;
&lt;span class="n"&gt;Reals_0_from_1200[0]&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nf"&gt;OSCAT_BASIC.DW_TO_REAL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;SHL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;WORD_TO_DWORD&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;MB_Real_0_hi&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="m"&gt;16&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;OR&lt;/span&gt; &lt;span class="nf"&gt;WORD_TO_DWORD&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;MB_Real_0_low&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;</summary></entry><entry><title>Modbus Worte in Real umwandeln</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/f6455d036f/?limit=25#74ee" rel="alternate"/><published>2020-02-28T00:08:40.576000Z</published><updated>2020-02-28T00:08:40.576000Z</updated><author><name>BOBmoraine</name><uri>https://forge.codesys.com/u/bobmoraine/</uri></author><id>https://forge.codesys.coma2cb133ca364d8c9acf455c745205fe02d8539ee</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Moin,&lt;br/&gt;
ich habe einen Modbus Server welcher einen Datenbaustein als Holding Register benutzt.&lt;br/&gt;
In dem DB befinden sich unter anderem auch Real-Werte.&lt;br/&gt;
Wie bekomme ich die Worte aus dem Modbus Slave-Kanel nun wieder zu Real-Werten?&lt;/p&gt;
&lt;p&gt;Irgendwie müsste ich die zwei Worte ja nun wieder "zusammensetzen" um daraus einen Real-Wert zu bekommen.&lt;br/&gt;
Ich habe leider keine Ahnung wie das geht.&lt;br/&gt;
Und einen Real-Wert anlegen und auf ein Wort Mappen in der Hoffnung das der Mapper sich die benötigte Größe selbst wählt ging leider auch nicht.&lt;/p&gt;
&lt;p&gt;Hat das jemand schonmal gemacht und kann mir dabei helfen?&lt;/p&gt;
&lt;p&gt;Einen guten Rutsch ins neue Jahr.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>