<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to How to read time from signals</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/e575aefdef/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/e575aefdef/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/e575aefdef/</id><updated>2020-02-27T14:01:30.269000Z</updated><subtitle>Recent posts to How to read time from signals</subtitle><entry><title>How to read time from signals</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/e575aefdef/?limit=25#c8de" rel="alternate"/><published>2020-02-27T14:01:30.269000Z</published><updated>2020-02-27T14:01:30.269000Z</updated><author><name>i-campbell</name><uri>https://forge.codesys.com/u/i-campbell/</uri></author><id>https://forge.codesys.comc0200bbe8f892ea392ebf4b8d7d10ed8da9f5ba6</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;DTUtil library has a get time function.&lt;br/&gt;
You might need to setup the timezone if you don't want to use UTC. (Although, you should always use UTC for control!)&lt;/p&gt;
&lt;p&gt;Then you just need some data compare logic. Perhaps you will have some minimum change value?&lt;br/&gt;
So, here is a typical data change detector..&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&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;PID_0&lt;/span&gt;.&lt;span class="nv"&gt;OP&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;lastOP&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nv"&gt;deadband&lt;/span&gt;&lt;span class="ss"&gt;))&lt;/span&gt; &lt;span class="nv"&gt;OR&lt;/span&gt; 
       &lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;PID_0&lt;/span&gt;.&lt;span class="nv"&gt;OP&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;lastOP&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nv"&gt;deadband&lt;/span&gt;&lt;span class="ss"&gt;))&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;
     &lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="nv"&gt;store&lt;/span&gt; &lt;span class="nv"&gt;the&lt;/span&gt; &lt;span class="nv"&gt;array&lt;/span&gt;...
     &lt;span class="nv"&gt;lastOP&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;PID_0&lt;/span&gt;.&lt;span class="nv"&gt;OP&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;END_IF&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Let us know how you go with your code.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How to read time from signals</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/e575aefdef/?limit=25#73d2" rel="alternate"/><published>2020-02-27T14:01:30.022000Z</published><updated>2020-02-27T14:01:30.022000Z</updated><author><name>IzitoI</name><uri>https://forge.codesys.com/u/izitoi/</uri></author><id>https://forge.codesys.com4f07b7ca43f0b7767ac19af95019cab551e82c16</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi everyone,&lt;/p&gt;
&lt;p&gt;I'm quite new to CodeSys. I'm dealing with an OPC DA project. The scenario is as follows:&lt;/p&gt;
&lt;p&gt;I have a PID block. I want to store in an array the timestamp of each output value, whenever it changes. In this case the OP.&lt;/p&gt;
&lt;p&gt;How can I achieve that?&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>