<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to USINT Variable nicht mit '0' initialisieren</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/712c77a855/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/712c77a855/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Deutsch/thread/712c77a855/</id><updated>2020-02-28T00:53:15.203000Z</updated><subtitle>Recent posts to USINT Variable nicht mit '0' initialisieren</subtitle><entry><title>USINT Variable nicht mit '0' initialisieren</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/712c77a855/?limit=25#edce" rel="alternate"/><published>2020-02-28T00:53:15.203000Z</published><updated>2020-02-28T00:53:15.203000Z</updated><author><name>kdebu</name><uri>https://forge.codesys.com/u/kdebu/</uri></author><id>https://forge.codesys.coma338a62c4c6e7329093ad868afcb7e35f8b38c1c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Moin,&lt;/p&gt;
&lt;p&gt;das mit dem Init-State wäre vielleicht eine Möglichkeit... Allerdings lässt sich das wohl mit dem Raspberry Pi nicht so einfach umsetzen...&lt;/p&gt;
&lt;p&gt;Ich habe das Problem nun anders lösen können:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nv"&gt;i&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;Read&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;ADR&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;in&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;, &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;&lt;span class="c1"&gt;; // i ist Rückgabeparameter der Methode&lt;/span&gt;
&lt;span class="nv"&gt;out&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;in&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;
   &lt;span class="nv"&gt;Write&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;ADR&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;out&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;, &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;END_IF&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Somit wird der Ausgang erst nach erfolgreicher Leseoperation beschrieben.&lt;/p&gt;
&lt;p&gt;Gruß&lt;br/&gt;
kdebu&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>USINT Variable nicht mit '0' initialisieren</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/712c77a855/?limit=25#7923" rel="alternate"/><published>2020-02-28T00:53:10.251000Z</published><updated>2020-02-28T00:53:10.251000Z</updated><author><name>glimnix</name><uri>https://forge.codesys.com/u/glimnix/</uri></author><id>https://forge.codesys.com51a191389e18bb170d7a48a6599b658f6005ec4c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Wäre nicht ein simpler Init-State für deine DOs eine Lösung, den du nach dem Einschalten durchlaufen lässt? In diesem setzt du den Wert, den du haben willst und verlässt ihn erst wenn der Wert übernommen wurde. Im nächsten dann beginnst du erst mit der Ausgabe auf deine DOs.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>USINT Variable nicht mit '0' initialisieren</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/712c77a855/?limit=25#8e45" rel="alternate"/><published>2020-02-28T00:53:08.471000Z</published><updated>2020-02-28T00:53:08.471000Z</updated><author><name>kdebu</name><uri>https://forge.codesys.com/u/kdebu/</uri></author><id>https://forge.codesys.com9dcc614f7f91e4f658f2a834ac86bc062c2fff63</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hallo,&lt;/p&gt;
&lt;p&gt;gibt es eine Möglichkeit, eine Variable vom Datentyp  nicht mit einer '0' zu initialisieren?&lt;br/&gt;
Das Problem besteht darin, dass beim Starten der SPS kurzzeitig eine '0' auf den Ausgang geschrieben wird. Dies hat zurfolge, dass die sich am Ausgang befindenden Relais kurzzeitig anziehen.&lt;/p&gt;
&lt;p&gt;Eine Einschaltverzögerung kommt leider nicht in Frage.&lt;/p&gt;
&lt;p&gt;Auch eine Initialisierung mit&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;USINT&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="n"&gt;FF&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;scheint nicht zu funktionieren.&lt;/p&gt;
&lt;p&gt;Gibt es noch eine andere Möglichkeit?&lt;/p&gt;
&lt;p&gt;Gruß&lt;br/&gt;
kdebu&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>