<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to TON ST Simulation</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/a5642422a5/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/a5642422a5/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/a5642422a5/</id><updated>2020-02-27T13:57:37.926000Z</updated><subtitle>Recent posts to TON ST Simulation</subtitle><entry><title>TON ST Simulation</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/a5642422a5/?limit=25#4263" rel="alternate"/><published>2020-02-27T13:57:37.926000Z</published><updated>2020-02-27T13:57:37.926000Z</updated><author><name>BrotherMaestro</name><uri>https://forge.codesys.com/u/brothermaestro/</uri></author><id>https://forge.codesys.com6486748dd64c76876b17f75bb0eecd4cd3459d20</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Ah, That makes sense now.&lt;br/&gt;
Did some testing with your suggestion. &lt;/p&gt;
&lt;p&gt;I now understand that the internal variables are only updated during a call of TON_1(). &lt;br/&gt;
However, after the first call, the actual timer continues on without the need of TON_1 being called. &lt;/p&gt;
&lt;p&gt;So correct me if I am wrong, &lt;br/&gt;
but I understand that you only need to call TON_1() twice for a single use of the TON? &lt;br/&gt;
Once to start the timer. &lt;br/&gt;
Once to update the variables AFTER PT has expired. &lt;br/&gt;
However in practice this isn't possible, which is why we check each loop of the program (or use an internal for/while loop) to continuously update the internal variables.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>TON ST Simulation</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/a5642422a5/?limit=25#7a2d" rel="alternate"/><published>2020-02-27T13:57:37.116000Z</published><updated>2020-02-27T13:57:37.116000Z</updated><author><name>plcmax</name><uri>https://forge.codesys.com/u/plcmax/</uri></author><id>https://forge.codesys.come46d4e935ef36d3a195cde57c757d9c94685b903</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;br/&gt;
you never call the instance of the timer(you just set the Inputs of the instance)&lt;br/&gt;
TON_2();&lt;/p&gt;
&lt;p&gt;Regards&lt;br/&gt;
plcmax&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>TON ST Simulation</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/a5642422a5/?limit=25#a801" rel="alternate"/><published>2020-02-27T13:57:36.846000Z</published><updated>2020-02-27T13:57:36.846000Z</updated><author><name>BrotherMaestro</name><uri>https://forge.codesys.com/u/brothermaestro/</uri></author><id>https://forge.codesys.com9080558c1324bf78e9220eceb8b11024adca223c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello Team, &lt;/p&gt;
&lt;p&gt;Ran into quite a baffling situation. &lt;br/&gt;
I am able to easily setup and run a TON timer when using the CFC style of graphic code...&lt;br/&gt;
However, I find in certain setups the ST version doesn't function &lt;/p&gt;
&lt;p&gt;Is this a limitation of the software? Or a Bug? Or is there something I am missing? &lt;br/&gt;
(I am running the code in Simulation, as I have no machine to deploy to at this time.&lt;br/&gt;
Both run under the Main task in a PRG POU) &lt;/p&gt;
&lt;p&gt;ST Attempt 1 (Simple works correctly)&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nt"&gt;VAR&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="nt"&gt;TON_1&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;TON&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="nt"&gt;TimeOut&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;BOOL&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="nt"&gt;ValueIN&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;BOOl&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;TON_1&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;ValueIN&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;TimeOut&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;TON_1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Q&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; 
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;ST Attempt 2 (Complex, doesn't work) &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;VAR&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="n"&gt;TON_2&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;TON&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="n"&gt;ValueIN&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;BOOL&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;TRUE&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="k"&gt;OUT&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;BOOL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="n"&gt;Delay&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;TIME&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="o"&gt;#&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="n"&gt;S&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="n"&gt;END_VAR&lt;/span&gt;
&lt;span class="n"&gt;TON_2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PT&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Delay&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;TON_2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ValueIN&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;OUT&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;TON_2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Q&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;TON_2.ET doesn't count up at all, despite TON_2.IN Being TRUE. &lt;br/&gt;
I decided to place the TON_2.PT in an init IF statement so it only runs once, and still nothing happened with the timer.&lt;/p&gt;
&lt;p&gt;I am curious why this is the case?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>