<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Button</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/f66128c4dd/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/f66128c4dd/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/f66128c4dd/</id><updated>2020-02-27T22:48:48.241000Z</updated><subtitle>Recent posts to Button</subtitle><entry><title>Button</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/f66128c4dd/?limit=25#9ec6" rel="alternate"/><published>2020-02-27T22:48:48.241000Z</published><updated>2020-02-27T22:48:48.241000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com3d84f59222b4e85ecec1b093f71ff2ce88c46a49</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;yes your code is good&lt;/p&gt;
&lt;p&gt;however i am missing a set command as now the signal will be on only one cycle. and this way you will not see it on.&lt;/p&gt;
&lt;p&gt;and i am missing the reset when motor is on a side.&lt;/p&gt;
&lt;p&gt;i am also missing a stop signal when the other direction is pressed.&lt;br/&gt;
and a stop button would be nice too.&lt;/p&gt;
&lt;p&gt;work on it.&lt;br/&gt;
have also a look at the oscat library at  w &lt;a class="" href="http://www.oscat.de" rel="nofollow"&gt;www.oscat.de&lt;/a&gt; w  you will learn a lot from it.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Button</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/f66128c4dd/?limit=25#1138" rel="alternate"/><published>2020-02-27T22:48:46.652000Z</published><updated>2020-02-27T22:48:46.652000Z</updated><author><name>JonnyFlash</name><uri>https://forge.codesys.com/u/jonnyflash/</uri></author><id>https://forge.codesys.com9ac94006809c0363101d4f88e5f45838431c2110</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi together,&lt;/p&gt;
&lt;p&gt;A motor is meant to turn into one direction when a button is pushed. &lt;br/&gt;
The motor is mean to turn into the other direction when another button is pushed.&lt;/p&gt;
&lt;p&gt;Here is my CODE:&lt;/p&gt;
&lt;p&gt;VAR_INPUT&lt;br/&gt;
button_left: BOOL;&lt;br/&gt;
button_right: BOOL;&lt;br/&gt;
END_VAR&lt;/p&gt;
&lt;p&gt;VAR&lt;br/&gt;
turn_left: R_TRIG;&lt;br/&gt;
turn_right: R_TRIG;&lt;br/&gt;
signal: REAL;&lt;br/&gt;
position_left: REAL;&lt;br/&gt;
position_right: REAL;&lt;br/&gt;
END_VAR&lt;/p&gt;
&lt;p&gt;turn_left.Q(CLK:=button_left)&lt;br/&gt;
IF turn_left.Q THEN &lt;br/&gt;
signal:= position_left;&lt;br/&gt;
END_IF;&lt;/p&gt;
&lt;p&gt;turn_right.Q(CLK:=button_right)&lt;br/&gt;
If turn_right.Q THEN&lt;br/&gt;
signal:= position_right;&lt;br/&gt;
END_IF;&lt;/p&gt;
&lt;p&gt;I hope the code is understandable. If not, please write it, I will then further explain it. &lt;br/&gt;
Thanx&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>