<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Rotating object and closing door (change value to 0)</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/6c91a88523/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/6c91a88523/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/6c91a88523/</id><updated>2020-02-27T21:05:38.925000Z</updated><subtitle>Recent posts to Rotating object and closing door (change value to 0)</subtitle><entry><title>Rotating object and closing door (change value to 0)</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/6c91a88523/?limit=25#9ca3" rel="alternate"/><published>2020-02-27T21:05:38.925000Z</published><updated>2020-02-27T21:05:38.925000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com351c2f12b9867f59ad03a384a72bfb8d59af80a2</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;after 18 seconds the door will close fast, as you count then rapid up.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Rotating object and closing door (change value to 0)</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/6c91a88523/?limit=25#2494" rel="alternate"/><published>2020-02-27T21:05:34.902000Z</published><updated>2020-02-27T21:05:34.902000Z</updated><author><name>HPster</name><uri>https://forge.codesys.com/u/hpster/</uri></author><id>https://forge.codesys.comc6587ec9c85d8a472a90c89b79e4fea5d76c6160</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks guys for your inputs. I will work on my program and see how it goes.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Rotating object and closing door (change value to 0)</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/6c91a88523/?limit=25#0938" rel="alternate"/><published>2020-02-27T21:05:33.444000Z</published><updated>2020-02-27T21:05:33.444000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.comdfa6a0d00e4613dae088dc50ef9b319313c969ad</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;on some objects you can change the angle like a polygone and others, a line and rectangle is not having the angle.&lt;br/&gt;
a way to do this by making a subvis from single line.&lt;br/&gt;
for the change use a counter for each door apart, and a global pulsemaker.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Rotating object and closing door (change value to 0)</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/6c91a88523/?limit=25#2684" rel="alternate"/><published>2020-02-27T21:05:31.960000Z</published><updated>2020-02-27T21:05:31.960000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.com14b4b12114bbbe2acdc9d706ca42a807486cf0e2</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;em&gt;Originally created by:&lt;/em&gt; scott_cunningham&lt;/p&gt;
&lt;p&gt;Not sure what you mean by , but looking at your code, I think you are using the timer functions incorrectly.  Maybe this information helps you:&lt;/p&gt;
&lt;p&gt;The way TON() works, is when setting IN = TRUE, the timer starts and Q will go  TRUE after PT is reached.  Q stays TRUE until you disable (IN = FALSE) one time for TON().&lt;/p&gt;
&lt;p&gt;For example, if you want a  every 10 seconds, you would need to do:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nv"&gt;TON1&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;IN&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;PT&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;T&lt;/span&gt;&lt;span class="sc"&gt;#10&lt;/span&gt;&lt;span class="nv"&gt;S&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="nv"&gt;TON1&lt;/span&gt;.&lt;span class="nv"&gt;Q&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;
   &lt;span class="nv"&gt;TON1&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;IN&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;FALSE&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
   &lt;span class="nv"&gt;count&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;count&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;END_IF&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;I often do:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nv"&gt;TON1&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;IN&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;NOT&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;TON1&lt;/span&gt;.&lt;span class="nv"&gt;Q&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;, &lt;span class="nv"&gt;PT&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;T&lt;/span&gt;&lt;span class="sc"&gt;#10&lt;/span&gt;&lt;span class="nv"&gt;S&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="nv"&gt;TON1&lt;/span&gt;.&lt;span class="nv"&gt;Q&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;
   &lt;span class="nv"&gt;count&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;count&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;END_IF&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; Even if you have an exact PLC scan, this timer is not exactly 10 seconds - it is a little longer - you loose at least one scan inside the TON() function as it is starting (this means, if you want a tick exactly every 10 seconds, you need to check the realtime clock and work that way).&lt;/p&gt;
&lt;p&gt;Hopefully, this helps you work forward.&lt;/p&gt;
&lt;p&gt;Also, remember you can set a break and step through your code in a debug way to see what is happening.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Rotating object and closing door (change value to 0)</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/6c91a88523/?limit=25#60b1" rel="alternate"/><published>2020-02-27T21:05:27.989000Z</published><updated>2020-02-27T21:05:27.989000Z</updated><author><name>HPster</name><uri>https://forge.codesys.com/u/hpster/</uri></author><id>https://forge.codesys.comc68415acfefd4671e71c5db4abc8961875de51c8</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi, any expert can help me?&lt;/p&gt;
&lt;p&gt;I'm totally new to Codesys and need help for my problems.&lt;/p&gt;
&lt;p&gt;Thanks in advance.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Rotating object and closing door (change value to 0)</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/6c91a88523/?limit=25#8d77" rel="alternate"/><published>2020-02-27T21:05:26.529000Z</published><updated>2020-02-27T21:05:26.529000Z</updated><author><name>HPster</name><uri>https://forge.codesys.com/u/hpster/</uri></author><id>https://forge.codesys.combb883b1190322f6f5361456fdac4ede3f3783015</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Expert,&lt;/p&gt;
&lt;p&gt;I got some problem on my code.&lt;/p&gt;
&lt;p&gt;First will be on rotating object, what code to use to rotate object in the program.&lt;/p&gt;
&lt;p&gt;Second will be after opening door on my program (value to 30) and try to close back the door (change value to 0).&lt;br/&gt;
Below is my code for open and close door.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nv"&gt;TON1&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;IN&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;train1&lt;/span&gt;, &lt;span class="nv"&gt;PT&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;T&lt;/span&gt;&lt;span class="sc"&gt;#18&lt;/span&gt;&lt;span class="nv"&gt;s&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;OUT1&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;TON1&lt;/span&gt;.&lt;span class="nv"&gt;Q&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
   &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="nv"&gt;OUT1&lt;/span&gt; &lt;span class="nv"&gt;AND&lt;/span&gt; &lt;span class="nv"&gt;door1&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;=&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;
      &lt;span class="nv"&gt;door1&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;door1&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
   &lt;span class="nv"&gt;END_IF&lt;/span&gt;
   &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="nv"&gt;door1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;=&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;
      &lt;span class="nv"&gt;train2&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&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;TON2&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;IN&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;train2&lt;/span&gt;, &lt;span class="nv"&gt;PT&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;T&lt;/span&gt;&lt;span class="sc"&gt;#5&lt;/span&gt;&lt;span class="nv"&gt;s&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
 &lt;span class="nv"&gt;OUT2&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;TON2&lt;/span&gt;.&lt;span class="nv"&gt;Q&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
      &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="nv"&gt;OUT2&lt;/span&gt; &lt;span class="nv"&gt;AND&lt;/span&gt; &lt;span class="nv"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;
      &lt;span class="nv"&gt;counter&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;counter&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
      &lt;span class="nv"&gt;END_IF&lt;/span&gt;
      &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="nv"&gt;OUT2&lt;/span&gt; &lt;span class="nv"&gt;AND&lt;/span&gt; &lt;span class="nv"&gt;door1&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;
         &lt;span class="nv"&gt;door1&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;door1&lt;/span&gt;&lt;span class="o"&gt;+-&lt;/span&gt;&lt;span class="nv"&gt;counter&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
      &lt;span class="nv"&gt;END_IF&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Thanks in advance for helping.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>