<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to TON timer Problem in function block</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/cafcd1eec8/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/cafcd1eec8/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/cafcd1eec8/</id><updated>2022-03-30T14:15:02.363000Z</updated><subtitle>Recent posts to TON timer Problem in function block</subtitle><entry><title>TON timer Problem in function block</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/cafcd1eec8/?limit=250#d5a6/94c9/6609" rel="alternate"/><published>2022-03-30T14:15:02.363000Z</published><updated>2022-03-30T14:15:02.363000Z</updated><author><name>h-hermsen</name><uri>https://forge.codesys.com/u/hermsen/</uri></author><id>https://forge.codesys.com8d6020d72f9deda4b60d7c0d03bfd427d657fcd5</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Only English please!&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>TON timer Problem in function block</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/cafcd1eec8/?limit=250#d5a6/94c9/0d62" rel="alternate"/><published>2022-03-30T14:14:57.954000Z</published><updated>2022-03-30T14:14:57.954000Z</updated><author><name>h-hermsen</name><uri>https://forge.codesys.com/u/hermsen/</uri></author><id>https://forge.codesys.com9c4b6bdb7a1c38f0193cf8f3aaf2cc6b6894151c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Only English please!&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>TON timer Problem in function block</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/cafcd1eec8/?limit=25#8e15" rel="alternate"/><published>2022-03-30T06:52:42.570000Z</published><updated>2022-03-30T06:52:42.570000Z</updated><author><name>gatto</name><uri>https://forge.codesys.com/u/gatto/</uri></author><id>https://forge.codesys.com0fac61b66cf041cf53eb632baa527ac89a3005ca</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;And of course like dFx suggest you can't use Functions because haven't internal status information. As i wrote i used a FB&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>TON timer Problem in function block</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/cafcd1eec8/?limit=25#3fb2" rel="alternate"/><published>2022-03-30T06:44:47.725000Z</published><updated>2022-03-30T06:44:47.725000Z</updated><author><name>gatto</name><uri>https://forge.codesys.com/u/gatto/</uri></author><id>https://forge.codesys.com953b04171481d58fe3c085cc1c6711df34a117d8</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Ciao, il blocco POU, dove viene richiamato l' FB, deve essere elaborato. &lt;br/&gt;
Io nel main task richiamo un POU di nome Main e poi in Main richiamo tutti gli altri blocchi. Quindi anche il POU_lorenzo deve essere richiamato nel Main.&lt;br/&gt;
Un modo per vedere se un blocco viene richiamato è inserire al suo interno un controllo.&lt;br/&gt;
Per esempio dentro al tuo Fb dichiari la tag control:WORD;&lt;br/&gt;
Nel codice del tuo FB scrivi control := control + 1 ;&lt;br/&gt;
Andando online devi vedere la tag che incrementa ad ogni ciclo.&lt;/p&gt;
&lt;p&gt;Hello, the POU block, where the FB is called, must be processed.&lt;br/&gt;
In the main task I call a POU called Main and then in Main I call all the other blocks. Therefore also the POU_lorenzo must be called in the Main.&lt;br/&gt;
One way to see if a block is called is to insert a control into it.&lt;br/&gt;
For example inside your FB you declare the tag &lt;br/&gt;
control : WORD ;&lt;br/&gt;
In your FB code write this &lt;br/&gt;
control := control + 1 ;&lt;br/&gt;
Going online you have to see the tag that increments each cycle. &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>TON timer Problem in function block</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/cafcd1eec8/?limit=250#4f8b" rel="alternate"/><published>2022-03-30T06:32:59.196000Z</published><updated>2022-03-30T06:32:59.196000Z</updated><author><name>dFx</name><uri>https://forge.codesys.com/u/dfx/</uri></author><id>https://forge.codesys.com96ea1169346996034ad9ce5ed9816437726eb007</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hint&lt;/p&gt;
&lt;p&gt;Functions have no internal status information, which means that functions do not save the values of their variables until the next call. Calls of a function with the same input variable values always supply the same output value. Therefore, functions may not use global variables and addresses!&lt;/p&gt;
&lt;p&gt;source : &lt;a href="https://help.codesys.com/webapp/_cds_obj_function;product=codesys;version=3.5.14.0" rel="nofollow"&gt;https://help.codesys.com/webapp/_cds_obj_function;product=codesys;version=3.5.14.0&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>TON timer Problem in function block</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/cafcd1eec8/?limit=25#d5a6/94c9" rel="alternate"/><published>2022-03-30T06:15:50.670000Z</published><updated>2022-03-30T06:15:50.670000Z</updated><author><name>lorenzop</name><uri>https://forge.codesys.com/u/lorenzop/</uri></author><id>https://forge.codesys.com40580439561d09030dea40954876ae27041c9904</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Ciao, &lt;br/&gt;
ho fatto una POU e una funzione a parte proprio uguali a quelle che mi hai mandato, però continua a non andare, sembra che anche se il TON ha l'IN per partire a contare non conti&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>TON timer Problem in function block</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/cafcd1eec8/?limit=25#d5a6" rel="alternate"/><published>2022-03-29T21:44:16.636000Z</published><updated>2022-03-29T21:44:16.636000Z</updated><author><name>gatto</name><uri>https://forge.codesys.com/u/gatto/</uri></author><id>https://forge.codesys.com53da7e4f0ebc15474fe08d962f220360443c6452</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Ciao,&lt;br/&gt;
for me, it work&lt;br/&gt;
see attached files&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>TON timer Problem in function block</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/cafcd1eec8/?limit=25#db62" rel="alternate"/><published>2022-03-28T13:50:28.675000Z</published><updated>2022-03-28T13:50:28.675000Z</updated><author><name>lorenzop</name><uri>https://forge.codesys.com/u/lorenzop/</uri></author><id>https://forge.codesys.com64f01bfd98791f0074880fecd31ed1ba3f29732a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;br/&gt;
I have a problem with the timer TON into a function block&lt;/p&gt;
&lt;p&gt;I have this into the function block&lt;/p&gt;
&lt;p&gt;TON_Rit_Start(IN:= (AUTOMATICO AND START_AUTO),PT:= UINT_TO_TIME(T_RIT_START));&lt;br/&gt;
IF TON_Rit_Start.Q THEN&lt;br/&gt;
    OUT := TRUE;&lt;br/&gt;
END_IF&lt;/p&gt;
&lt;p&gt;And this is the call into the main program&lt;/p&gt;
&lt;p&gt;Gestione_Motori(AUTOMATICO := TRUE, &lt;br/&gt;
       START_AUTO := GVL.motore.Scarto.wStart,&lt;br/&gt;
       T_RIT_START := 2000,&lt;br/&gt;
       T_RIT_STOP := 2000,&lt;br/&gt;
       START_MAN := FALSE,&lt;br/&gt;
       RESET_ALLARMI := FALSE,&lt;br/&gt;
       ENABLE_PL := FALSE,&lt;br/&gt;
       FEEDBACK := FALSE,&lt;br/&gt;
       TERMICO := FALSE,&lt;br/&gt;
       TIMEHIGH := 2000,&lt;br/&gt;
       TIMELOW := 2000,&lt;br/&gt;
       OUT =&amp;gt; VAR1);&lt;/p&gt;
&lt;p&gt;When GVL.motore.Scarto.wStart is setted to TRUE the function don't start count and i have the OUT value always false&lt;/p&gt;
&lt;p&gt;PLS HELP ME&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>