<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Newbie at work. toggle output?</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/e78352da60/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/e78352da60/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/e78352da60/</id><updated>2020-02-27T20:31:57.500000Z</updated><subtitle>Recent posts to Newbie at work. toggle output?</subtitle><entry><title>Newbie at work. toggle output?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/e78352da60/?limit=25#8baa" rel="alternate"/><published>2020-02-27T20:31:57.500000Z</published><updated>2020-02-27T20:31:57.500000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com1282e785ce0bcf2f1734ee3882f3cf17a77c71e2</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;geef het ook maar aan de rest van de klas.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Newbie at work. toggle output?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/e78352da60/?limit=25#f4ed" rel="alternate"/><published>2020-02-27T20:31:56.138000Z</published><updated>2020-02-27T20:31:56.138000Z</updated><author><name>Yorick</name><uri>https://forge.codesys.com/u/yorick/</uri></author><id>https://forge.codesys.comf777ecf05f478f843e455aef40d0b2b7a2de46a3</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks! you helped me a lot! &lt;br/&gt;
And thanks for the oscat site.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Newbie at work. toggle output?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/e78352da60/?limit=25#45d0" rel="alternate"/><published>2020-02-27T20:31:52.295000Z</published><updated>2020-02-27T20:31:52.295000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.comcb890e5b09beac2a6104f88f006424ca8802e6d4</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;here you go with a good solution.&lt;br/&gt;
taken from oscat.&lt;br/&gt;
look for toggle in  w &lt;a class="" href="http://www.oscat.de" rel="nofollow"&gt;www.oscat.de&lt;/a&gt; w &lt;br/&gt;
that is best place to learn.&lt;/p&gt;
&lt;p&gt;take the file as you can read and also take the txt file.&lt;br/&gt;
it is all in structured text so you can read it clearly and take parts out of it.&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="https://forum.codesys.com//download/file.php?id=198" rel="nofollow"&gt;toggle.pro &lt;span&gt;&lt;span&gt;[16.32 KiB]&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Newbie at work. toggle output?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/e78352da60/?limit=25#dba5" rel="alternate"/><published>2020-02-27T20:31:50.927000Z</published><updated>2020-02-27T20:31:50.927000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com55a43f6053ef347e8e63e0f23d44933d68245b82</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;and this is solution:&lt;/p&gt;
&lt;p&gt;(&lt;em&gt; @NESTEDCOMMENTS := 'Yes' &lt;/em&gt;)&lt;br/&gt;
(&lt;em&gt; @PATH := '\/Logic\/FF edge triggered' &lt;/em&gt;)&lt;br/&gt;
(&lt;em&gt; @SYMFILEFLAGS := '2048' &lt;/em&gt;)&lt;br/&gt;
FUNCTION_BLOCK TOGGLE&lt;br/&gt;
VAR_INPUT&lt;br/&gt;
    CLK : BOOL;&lt;br/&gt;
    rst : BOOL;&lt;br/&gt;
END_VAR&lt;br/&gt;
VAR_OUTPUT&lt;br/&gt;
    Q : BOOL;&lt;br/&gt;
END_VAR&lt;br/&gt;
VAR&lt;br/&gt;
    edge : BOOL;&lt;br/&gt;
END_VAR&lt;/p&gt;
&lt;p&gt;(*&lt;br/&gt;
version 1.1 30. oct. 2008&lt;br/&gt;
programmer  hugo&lt;br/&gt;
tested by   oscat&lt;/p&gt;
&lt;p&gt;toggle flip flop the output changes state with every rising edge of clk.&lt;/p&gt;
&lt;p&gt;*)&lt;/p&gt;
&lt;p&gt;(&lt;em&gt; @END_DECLARATION := '0' &lt;/em&gt;)&lt;/p&gt;
&lt;p&gt;below the code needed.&lt;br/&gt;
put it in a function block.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;IF rst THEN   q := 0;ELSIF clk AND NOT edge THEN  Q := NOT Q;END_IF;edge := clk;&lt;/strong&gt;&lt;br/&gt;
(* revision history&lt;/p&gt;
&lt;p&gt;hm  13.9.2007       rev 1.0&lt;br/&gt;
    original version&lt;/p&gt;
&lt;p&gt;hm  30. oct. 2008   rev 1.1&lt;br/&gt;
    deleted unnecessary init&lt;/p&gt;
&lt;p&gt;*)&lt;/p&gt;
&lt;p&gt;END_FUNCTION_BLOCK&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Newbie at work. toggle output?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/e78352da60/?limit=25#f38b" rel="alternate"/><published>2020-02-27T20:31:49.555000Z</published><updated>2020-02-27T20:31:49.555000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com110887bcff37104ba81caa94d2f5668979e67059</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;another hint:&lt;br/&gt;
the contacts setting are asked not in the beginning, but on every start of a line.&lt;br/&gt;
i like this type of very simple assignments.&lt;/p&gt;
&lt;p&gt;and yes good thing you are asking, it will give you a point extra on your portfolio.&lt;/p&gt;
&lt;p&gt;make this in one line, not more.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Newbie at work. toggle output?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/e78352da60/?limit=25#c41d" rel="alternate"/><published>2020-02-27T20:31:45.767000Z</published><updated>2020-02-27T20:31:45.767000Z</updated><author><name>Yorick</name><uri>https://forge.codesys.com/u/yorick/</uri></author><id>https://forge.codesys.comd6b29494c19a6bb4739de210a2344b3052320aca</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;This is what I found and tried.&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: toggle.JPG" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=197"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Newbie at work. toggle output?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/e78352da60/?limit=25#7e7a" rel="alternate"/><published>2020-02-27T20:31:44.401000Z</published><updated>2020-02-27T20:31:44.401000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com1424fe96744cd8d21edda6b8a9c481ef00aa8829</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;make a pulse of your in signal, now it does switch many times.&lt;br/&gt;
and yes i will keep the secret as you will have to learn not me.&lt;br/&gt;
hihi.&lt;/p&gt;
&lt;p&gt;if you come back with your prog we will give solution&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Newbie at work. toggle output?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/e78352da60/?limit=25#9bf5" rel="alternate"/><published>2020-02-27T20:31:40.531000Z</published><updated>2020-02-27T20:31:40.531000Z</updated><author><name>ndzied1</name><uri>https://forge.codesys.com/u/ndzied1/</uri></author><id>https://forge.codesys.com96fb38710aeefe78e55af0709758fbe8feb9663d</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Why don't you post what you tried so we know what language you are using and what you have tried.&lt;/p&gt;
&lt;p&gt;This should definitely work in simulation mode.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Newbie at work. toggle output?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/e78352da60/?limit=25#e36e" rel="alternate"/><published>2020-02-27T20:31:39.163000Z</published><updated>2020-02-27T20:31:39.163000Z</updated><author><name>Yorick</name><uri>https://forge.codesys.com/u/yorick/</uri></author><id>https://forge.codesys.come071a43a0ab040ab6ce2b86ebedd114fca44e60c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Newbie at work here,&lt;/p&gt;
&lt;p&gt;I tried to program the following with one single input and one output.&lt;br/&gt;
One push button (puls) &lt;/p&gt;
&lt;p&gt;Press one time = output high&lt;br/&gt;
Press another time = outoput low&lt;br/&gt;
Press another time = output high&lt;br/&gt;
etc.&lt;/p&gt;
&lt;p&gt;I thought it would be easy. But when I turn on the simulation mode in CoDeSys&lt;br/&gt;
my ladder program won't work. Strange becaus i'm not the only one with this problem&lt;br/&gt;
on the internet. I tried some of the sugestions on the net. no succes.&lt;/p&gt;
&lt;p&gt;Maybe it has something to do with the simulationmode?&lt;/p&gt;
&lt;p&gt;I hope someone has the sollution for this.&lt;/p&gt;
&lt;p&gt;kind regards Yorick&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>