<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to LogRecord Sample ST</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/5a684f690e/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/5a684f690e/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/5a684f690e/</id><updated>2020-02-27T14:11:55.216000Z</updated><subtitle>Recent posts to LogRecord Sample ST</subtitle><entry><title>LogRecord Sample ST</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/5a684f690e/?limit=25#6269" rel="alternate"/><published>2020-02-27T14:11:55.216000Z</published><updated>2020-02-27T14:11:55.216000Z</updated><author><name>timvh</name><uri>https://forge.codesys.com/u/timvh/</uri></author><id>https://forge.codesys.com4f50fd79767902e74f139bbfafbc8a5d7de8f5c3</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Several things might go wrong:&lt;br/&gt;
1) It seems you are not calling Test. Maybe you want to call the FB like:&lt;br/&gt;
Test();&lt;br/&gt;
Otherwise nothing is executed.&lt;br/&gt;
2) In PC programming it might work that you stay in the WHILE loop, but this is pretty dangerous in PLC programming, because your I/O will not be updated. Besides that, most FB's are acyclic, which means it might take several scans before the Test() FB is Done, or an Error will happen.&lt;br/&gt;
Therefore you might want to consider using another way of calling this, and not staying in the while loop.&lt;br/&gt;
3) xDone, xBusy, xError will never be TRUE at the same time. Normally you keep xExecute TRUE untill xDone OR xError is TRUE. Then you can set xExecute to FALSE.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>LogRecord Sample ST</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/5a684f690e/?limit=25#7b76" rel="alternate"/><published>2020-02-27T14:11:54.831000Z</published><updated>2020-02-27T14:11:54.831000Z</updated><author><name>Snoopy354</name><uri>https://forge.codesys.com/u/snoopy354/</uri></author><id>https://forge.codesys.com44398cf10c95f6c56fc7b0df0a24da4d6714fa45</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;can somebody help me with a sample for the LogRecord function in Codesys.&lt;br/&gt;
1. i have created a DataLogManager and a Dataprotcol (Test).&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nv"&gt;Test&lt;/span&gt;.&lt;span class="nv"&gt;xExecute&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;FALSE&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;Test&lt;/span&gt;.&lt;span class="nv"&gt;wsRecord&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;wconcat&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Test&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;, &lt;span class="nv"&gt;UINT_TO_WSTRING&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;Global_State&lt;/span&gt;&lt;span class="ss"&gt;))&lt;/span&gt;&lt;span class="c1"&gt;; &lt;/span&gt;
&lt;span class="nv"&gt;Test&lt;/span&gt;.&lt;span class="nv"&gt;xExecute&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;TRUE&lt;/span&gt;&lt;span class="c1"&gt;;  &lt;/span&gt;
&lt;span class="k"&gt;WHILE&lt;/span&gt; &lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;Test&lt;/span&gt;.&lt;span class="nv"&gt;xBusy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;TRUE&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt; &lt;span class="k"&gt;DO&lt;/span&gt;
    &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;Test&lt;/span&gt;.&lt;span class="nv"&gt;xDone&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;TRUE&lt;/span&gt; &lt;span class="nv"&gt;AND&lt;/span&gt; &lt;span class="nv"&gt;Test&lt;/span&gt;.&lt;span class="nv"&gt;xError&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;TRUE&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;
        &lt;span class="nv"&gt;Test&lt;/span&gt;.&lt;span class="nv"&gt;xExecute&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;FALSE&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
    &lt;span class="nv"&gt;END_IF&lt;/span&gt;
&lt;span class="nv"&gt;END_WHILE&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;if i set Test.xExecute := TRUE xDone and xError are not going to TRUE?&lt;/p&gt;
&lt;p&gt;so what make i worng?&lt;/p&gt;
&lt;p&gt;Thanks&lt;br/&gt;
Bruno&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>