<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to newbie question, how to reuse a pulse timer?</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/d28a2ed979/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/d28a2ed979/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/d28a2ed979/</id><updated>2020-02-27T20:49:56.465000Z</updated><subtitle>Recent posts to newbie question, how to reuse a pulse timer?</subtitle><entry><title>newbie question, how to reuse a pulse timer?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/d28a2ed979/?limit=25#d24e" rel="alternate"/><published>2020-02-27T20:49:56.465000Z</published><updated>2020-02-27T20:49:56.465000Z</updated><author><name>spfeif</name><uri>https://forge.codesys.com/u/spfeif/</uri></author><id>https://forge.codesys.com179ab0d3eb022b6a7c3db1039158a3d34c29d84d</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Sorry I hope you don't mind if I explain the difference between the two calls for people who might be wondering.&lt;/p&gt;
&lt;p&gt;TP1.IN:=FALSE; this sets the variable but never jumps to the instance of the timer TP1 in memory to reload the algorithm.&lt;/p&gt;
&lt;p&gt;TP1(IN:=FALSE); this sets the variable and jumps to the instance of the timer TP1 in memory and calls/runs the algorithm.&lt;/p&gt;
&lt;p&gt;EXAMPLE:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nt"&gt;PROGRAM&lt;/span&gt; &lt;span class="nt"&gt;PLC_PRG&lt;/span&gt;
&lt;span class="nt"&gt;var&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="nt"&gt;Timer&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nd"&gt;TON&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;Timer&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;TRUE&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;PT&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;T&lt;/span&gt;&lt;span class="p"&gt;#&lt;/span&gt;&lt;span class="nn"&gt;5s&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="nt"&gt;Timer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;PT&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;T&lt;/span&gt;&lt;span class="p"&gt;#&lt;/span&gt;&lt;span class="nn"&gt;10s&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;end_Program&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The outcome of the timer will be Timer.Q := TRUE after 5 sec not 10 sec.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>newbie question, how to reuse a pulse timer?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/d28a2ed979/?limit=25#b1b8" rel="alternate"/><published>2020-02-27T20:49:52.214000Z</published><updated>2020-02-27T20:49:52.214000Z</updated><author><name>pnn</name><uri>https://forge.codesys.com/u/pnn/</uri></author><id>https://forge.codesys.comdd2e95c0111446bb77163b18e7b64bc2a342a6bc</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;please ignore, I've found what's wrong.&lt;br/&gt;
Instead of TP1.IN:=FALSE; I should have used TP1(IN :=FALSE);&lt;br/&gt;
Not so obvious at first sight &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>newbie question, how to reuse a pulse timer?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/d28a2ed979/?limit=25#2ec6" rel="alternate"/><published>2020-02-27T20:49:50.263000Z</published><updated>2020-02-27T20:49:50.263000Z</updated><author><name>pnn</name><uri>https://forge.codesys.com/u/pnn/</uri></author><id>https://forge.codesys.com85b4c985a97b8d81f9b97341f4ffe56dc4703a39</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;using Codesys 2.3&lt;br/&gt;
I can't get how to reuse a pulse timer.&lt;br/&gt;
Attached is a simple project with one SFC program, which tries to use a TP timer declared as TP1 global.&lt;/p&gt;
&lt;p&gt;It works only once after a PLC reset.&lt;/p&gt;
&lt;p&gt;If I set TP1.IN from an action(TransA -&amp;gt; Step1A), the first time it works.&lt;br/&gt;
TP is started, .ET increases etc.&lt;br/&gt;
The next time I set .IN, nothing happens as .ET is already equal to .PT&lt;br/&gt;
I can't reset .ET to 0, it doesn't reset automatically, so how am I supposed to reuse the timer?&lt;/p&gt;
&lt;p&gt;If I set TP1.IN from an ENTRY action(TransB -&amp;gt; Step1B), TP1.Q becomes true forever and TP1.ET stays at 0.&lt;/p&gt;
&lt;p&gt;It should be obvious already that I'm a complete newbie.&lt;br/&gt;
How all this works and how to reuse a timer? &lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="https://forum.codesys.com//download/file.php?id=201" rel="nofollow"&gt;tp2.pro &lt;span&gt;&lt;span&gt;[28.9 KiB]&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>