<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to R_Trig using or better</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/5be7f2fa62/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/5be7f2fa62/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/5be7f2fa62/</id><updated>2020-02-27T13:53:35.964000Z</updated><subtitle>Recent posts to R_Trig using or better</subtitle><entry><title>R_Trig using or better</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/5be7f2fa62/?limit=25#2c79" rel="alternate"/><published>2020-02-27T13:53:35.964000Z</published><updated>2020-02-27T13:53:35.964000Z</updated><author><name>MaraP</name><uri>https://forge.codesys.com/u/marap/</uri></author><id>https://forge.codesys.com3c4bc1e0310c939cd44f65efde6a3646dc8b00b3</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Johan10 hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
Hello everybody, I try to make an HMI on Codesys in language ST, whitch controls engines. And for example I have a button  « Left » witch is linked to a variable « ButtonLeft »whitch allows to turn left. When I rest above, the button stays in 1 and the engine continues to turn even when I release the button. That's why I shall like putting it on a rising edge. I saw the function R_Trig but I do not know how to use it. Anybody has an example or can help me? I have made something like this. That is correct? Does my variable « ButtonLeft » will return to 0 when I’ll stop push the button. Thank’s a lot.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;You don't need any code to fix your problem i think. I believe your button configuration is just done wrongly. Im quite sure that under input configuration you had put your variable to field "Toggle". &lt;strong&gt;Instead of this you should put it to fied "TAP".&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;See picture below...&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: Bild" rel="nofollow" src="http://i68.tinypic.com/jffct0.jpg"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>R_Trig using or better</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/5be7f2fa62/?limit=25#8067" rel="alternate"/><published>2020-02-27T13:53:35.376000Z</published><updated>2020-02-27T13:53:35.376000Z</updated><author><name>Comingback4u</name><uri>https://forge.codesys.com/u/comingback4u/</uri></author><id>https://forge.codesys.com598fb63b39be3c9fa6b3712268d328584768a67b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Best I can do I guess is give you an example project. If you run this example and simulation you will see how when you press the left button it will turn pin2/3 on.&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: RTrigExampleVisu.PNG" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=3649"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="https://forum.codesys.com//download/file.php?id=3650" rel="nofollow"&gt;RTrigExample.project &lt;span&gt;&lt;span&gt;[120.1 KiB]&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>R_Trig using or better</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/5be7f2fa62/?limit=25#53c6" rel="alternate"/><published>2020-02-27T13:53:35.142000Z</published><updated>2020-02-27T13:53:35.142000Z</updated><author><name>Johan10</name><uri>https://forge.codesys.com/u/johan10/</uri></author><id>https://forge.codesys.com414202d3a01f94d8d6478a883de3cc4a2a139545</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Comingback4u hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
I guess I have no idea what you are asking then. R_TRIG is in the standard library and by your example you already know how to use it. Just remember that the output Q is only TRUE for one cycle. After that one cycle it gets reset back to false so your pins will stay on even without the button being pressed.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nv"&gt;VAR&lt;/span&gt;
    &lt;span class="nv"&gt;fb_LeftButtonRTrig&lt;/span&gt;: &lt;span class="nv"&gt;R_TRIG&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
    &lt;span class="nv"&gt;xLeftButton&lt;/span&gt;: &lt;span class="nv"&gt;BOOL&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;END_VAR&lt;/span&gt;
&lt;span class="nv"&gt;fb_LeftButtonRTrig&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;CLK&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;xLeftButton&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;fb_LeftButtonRTrig&lt;/span&gt;.&lt;span class="nv"&gt;Q&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;  &lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="nv"&gt;Set&lt;/span&gt; &lt;span class="nv"&gt;pins&lt;/span&gt; &lt;span class="nv"&gt;to&lt;/span&gt; &lt;span class="nv"&gt;true&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nv"&gt;left&lt;/span&gt; &lt;span class="nv"&gt;button&lt;/span&gt; &lt;span class="nv"&gt;is&lt;/span&gt; &lt;span class="nv"&gt;pressed&lt;/span&gt;
    &lt;span class="nv"&gt;pin1&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
    &lt;span class="nv"&gt;pin2&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;pin3&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;Ok. Yes I just wanted to Enter my « If » only when I pressed my button. So In my code, R_Trig doesn’t appaer in color. That’s normal? There is a library to add? Because the program is not running. Thank’s a lot for your precious help&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>R_Trig using or better</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/5be7f2fa62/?limit=25#a339" rel="alternate"/><published>2020-02-27T13:53:34.927000Z</published><updated>2020-02-27T13:53:34.927000Z</updated><author><name>Comingback4u</name><uri>https://forge.codesys.com/u/comingback4u/</uri></author><id>https://forge.codesys.coma3ae21a8b4065b4fb55652268333ac4f2339cb78</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I guess I have no idea what you are asking then. R_TRIG is in the standard library and by your example you already know how to use it. Just remember that the output Q is only TRUE for one cycle. After that one cycle it gets reset back to false so your pins will stay on even without the button being pressed.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nv"&gt;VAR&lt;/span&gt;
    &lt;span class="nv"&gt;fb_LeftButtonRTrig&lt;/span&gt;: &lt;span class="nv"&gt;R_TRIG&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
    &lt;span class="nv"&gt;xLeftButton&lt;/span&gt;: &lt;span class="nv"&gt;BOOL&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;END_VAR&lt;/span&gt;
&lt;span class="nv"&gt;fb_LeftButtonRTrig&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;CLK&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;xLeftButton&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;fb_LeftButtonRTrig&lt;/span&gt;.&lt;span class="nv"&gt;Q&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;  &lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="nv"&gt;Set&lt;/span&gt; &lt;span class="nv"&gt;pins&lt;/span&gt; &lt;span class="nv"&gt;to&lt;/span&gt; &lt;span class="nv"&gt;true&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nv"&gt;left&lt;/span&gt; &lt;span class="nv"&gt;button&lt;/span&gt; &lt;span class="nv"&gt;is&lt;/span&gt; &lt;span class="nv"&gt;pressed&lt;/span&gt;
    &lt;span class="nv"&gt;pin1&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
    &lt;span class="nv"&gt;pin2&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;pin3&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;/div&gt;</summary></entry><entry><title>R_Trig using or better</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/5be7f2fa62/?limit=25#dba5" rel="alternate"/><published>2020-02-27T13:53:34.667000Z</published><updated>2020-02-27T13:53:34.667000Z</updated><author><name>Johan10</name><uri>https://forge.codesys.com/u/johan10/</uri></author><id>https://forge.codesys.com8125a64206969f01b1021ccd3c008dafb9642652</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Comingback4u hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
It looks like you just need to add an else statement so it would look like:&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="nv"&gt;ButtonLeft&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;
    &lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="nv"&gt;Put&lt;/span&gt; &lt;span class="nv"&gt;logic&lt;/span&gt; &lt;span class="nv"&gt;in&lt;/span&gt; &lt;span class="nv"&gt;here&lt;/span&gt; &lt;span class="nv"&gt;to&lt;/span&gt; &lt;span class="nv"&gt;turn&lt;/span&gt; &lt;span class="nv"&gt;on&lt;/span&gt; &lt;span class="nv"&gt;the&lt;/span&gt; &lt;span class="nv"&gt;output&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nv"&gt;ButtonLeft&lt;/span&gt; &lt;span class="nv"&gt;is&lt;/span&gt; &lt;span class="nv"&gt;active&lt;/span&gt;
    &lt;span class="nv"&gt;pin1&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
    &lt;span class="nv"&gt;pin2&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;pin3&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="k"&gt;ELSE&lt;/span&gt;
    &lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="nv"&gt;Put&lt;/span&gt; &lt;span class="nv"&gt;logic&lt;/span&gt; &lt;span class="nv"&gt;in&lt;/span&gt; &lt;span class="nv"&gt;here&lt;/span&gt; &lt;span class="nv"&gt;to&lt;/span&gt; &lt;span class="nv"&gt;turn&lt;/span&gt; &lt;span class="nv"&gt;off&lt;/span&gt; &lt;span class="nv"&gt;the&lt;/span&gt; &lt;span class="nv"&gt;output&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nv"&gt;ButtonLeft&lt;/span&gt; &lt;span class="nv"&gt;is&lt;/span&gt; &lt;span class="nv"&gt;not&lt;/span&gt; &lt;span class="nv"&gt;active&lt;/span&gt;
    &lt;span class="nv"&gt;pin1&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
    &lt;span class="nv"&gt;pin2&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
    &lt;span class="nv"&gt;pin3&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&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;No I really need a rising Edge because, &lt;br/&gt;
Pin1:=0;&lt;br/&gt;
Pin2:=0;&lt;br/&gt;
Pin3:=0;&lt;br/&gt;
Is a combination to  reverse. &lt;br/&gt;
Do you know how to use a rising edge please? There is a library to add?&lt;br/&gt;
Without the else statement your outputs will never turn off.&lt;br/&gt;
A cleaner approach without using an IF/ELSE statement would be:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nt"&gt;pin1&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;0&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;pin2&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;ButtonLeft&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nt"&gt;1&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;pin3&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;ButtonLeft&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nt"&gt;1&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;This would turn on pin2/3 if ButtonLeft is active if all data types are type BOOL.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>R_Trig using or better</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/5be7f2fa62/?limit=25#aaff" rel="alternate"/><published>2020-02-27T13:53:34.433000Z</published><updated>2020-02-27T13:53:34.433000Z</updated><author><name>Comingback4u</name><uri>https://forge.codesys.com/u/comingback4u/</uri></author><id>https://forge.codesys.com0779b48e0382a09f69462c6350e1754e8381ce1b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;It looks like you just need to add an else statement so it would look like:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="nv"&gt;ButtonLeft&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;
    &lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="nv"&gt;Put&lt;/span&gt; &lt;span class="nv"&gt;logic&lt;/span&gt; &lt;span class="nv"&gt;in&lt;/span&gt; &lt;span class="nv"&gt;here&lt;/span&gt; &lt;span class="nv"&gt;to&lt;/span&gt; &lt;span class="nv"&gt;turn&lt;/span&gt; &lt;span class="nv"&gt;on&lt;/span&gt; &lt;span class="nv"&gt;the&lt;/span&gt; &lt;span class="nv"&gt;output&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nv"&gt;ButtonLeft&lt;/span&gt; &lt;span class="nv"&gt;is&lt;/span&gt; &lt;span class="nv"&gt;active&lt;/span&gt;
    &lt;span class="nv"&gt;pin1&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
    &lt;span class="nv"&gt;pin2&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;pin3&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="k"&gt;ELSE&lt;/span&gt;
    &lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="nv"&gt;Put&lt;/span&gt; &lt;span class="nv"&gt;logic&lt;/span&gt; &lt;span class="nv"&gt;in&lt;/span&gt; &lt;span class="nv"&gt;here&lt;/span&gt; &lt;span class="nv"&gt;to&lt;/span&gt; &lt;span class="nv"&gt;turn&lt;/span&gt; &lt;span class="nv"&gt;off&lt;/span&gt; &lt;span class="nv"&gt;the&lt;/span&gt; &lt;span class="nv"&gt;output&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nv"&gt;ButtonLeft&lt;/span&gt; &lt;span class="nv"&gt;is&lt;/span&gt; &lt;span class="nv"&gt;not&lt;/span&gt; &lt;span class="nv"&gt;active&lt;/span&gt;
    &lt;span class="nv"&gt;pin1&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
    &lt;span class="nv"&gt;pin2&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
    &lt;span class="nv"&gt;pin3&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&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;Without the else statement your outputs will never turn off.&lt;/p&gt;
&lt;p&gt;A cleaner approach without using an IF/ELSE statement would be:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nt"&gt;pin1&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;0&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;pin2&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;ButtonLeft&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nt"&gt;1&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;pin3&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;ButtonLeft&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nt"&gt;1&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;This would turn on pin2/3 if ButtonLeft is active if all data types are type BOOL.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>R_Trig using or better</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/5be7f2fa62/?limit=25#57f4" rel="alternate"/><published>2020-02-27T13:53:33.820000Z</published><updated>2020-02-27T13:53:33.820000Z</updated><author><name>Johan10</name><uri>https://forge.codesys.com/u/johan10/</uri></author><id>https://forge.codesys.com3368c51eeb7c3546335196cc5800a424c71b5a30</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Comingback4u hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
It sounds like you want it to only turn left as long as you have the button held down. R_TRIG is not necessary in the situation. All you need to do is tie the input (Button) to the turn left output. If your input (Button) is staying true when you release it then it is not setup correctly. How do you have the &amp;lt;g&amp;gt; button connected to the variable &amp;lt;buttonleft&amp;gt;?&amp;lt;/buttonleft&amp;gt;&amp;lt;/g&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Before, it is what I made, I put &lt;br/&gt;
If (ButtonLeft == 1) Then &lt;br/&gt;
pin1: = 0; &lt;br/&gt;
pin2: = 1; &lt;br/&gt;
pin3: = 1; &lt;br/&gt;
End_If &lt;br/&gt;
but the problem is that, when I pressed on the button and when it passed in 1. It stays in 1, of the blow the engine continues to turn on its left.&lt;/p&gt;
&lt;p&gt;Excuse-me it was a mistake, the variable ButtonLeft is linked to my Button « Left »&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>R_Trig using or better</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/5be7f2fa62/?limit=25#bfcd" rel="alternate"/><published>2020-02-27T13:53:33.630000Z</published><updated>2020-02-27T13:53:33.630000Z</updated><author><name>Comingback4u</name><uri>https://forge.codesys.com/u/comingback4u/</uri></author><id>https://forge.codesys.com33eecf3ca245dabd93925fc41adedf469d0d5065</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;It sounds like you want it to only turn left as long as you have the button held down. R_TRIG is not necessary in the situation. All you need to do is tie the input (Button) to the turn left output. If your input (Button) is staying true when you release it then it is not setup correctly. How do you have the &amp;lt;g&amp;gt; button connected to the variable &amp;lt;buttonleft&amp;gt;?&amp;lt;/buttonleft&amp;gt;&amp;lt;/g&amp;gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>R_Trig using or better</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/5be7f2fa62/?limit=25#42fc" rel="alternate"/><published>2020-02-27T13:53:33.379000Z</published><updated>2020-02-27T13:53:33.379000Z</updated><author><name>Johan10</name><uri>https://forge.codesys.com/u/johan10/</uri></author><id>https://forge.codesys.comed1cbb7ceeca06863b917dd78ebb9371995c61b4</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello everybody, I try to make an HMI on Codesys in language ST, whitch controls engines. And for example I have a button  « Left » witch is linked to a variable « ButtonLeft »whitch allows to turn left. When I rest above, the button stays in 1 and the engine continues to turn even when I release the button. That's why I shall like putting it on a rising edge. I saw the function R_Trig but I do not know how to use it. Anybody has an example or can help me? I have made something like this. That is correct? Does my variable « ButtonLeft » will return to 0 when I’ll stop push the button. Thank’s a lot.&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: 1111DD5B" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=3645"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>