<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Use of counters in SFC</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/4e2d9845d1/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/4e2d9845d1/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/4e2d9845d1/</id><updated>2020-02-27T14:04:51.869000Z</updated><subtitle>Recent posts to Use of counters in SFC</subtitle><entry><title>Use of counters in SFC</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/4e2d9845d1/?limit=25#d635" rel="alternate"/><published>2020-02-27T14:04:51.869000Z</published><updated>2020-02-27T14:04:51.869000Z</updated><author><name>wollvieh</name><uri>https://forge.codesys.com/u/wollvieh/</uri></author><id>https://forge.codesys.comc897d3ea8154aa1da498d3c7b436261c88186895</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;look at the small sample i made, maybe it is helpfull...&lt;/p&gt;
&lt;p&gt;Although usefull : search in CODESYS Documentation for SFC Flags...&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: sfc.JPG" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=2175"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: sfcflags.JPG" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=2176"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="https://forum.codesys.com//download/file.php?id=2174" rel="nofollow"&gt;sfc.project &lt;span&gt;&lt;span&gt;[103.84 KiB]&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Use of counters in SFC</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/4e2d9845d1/?limit=25#de8e" rel="alternate"/><published>2020-02-27T14:04:51.578000Z</published><updated>2020-02-27T14:04:51.578000Z</updated><author><name>Trompdelft</name><uri>https://forge.codesys.com/u/trompdelft/</uri></author><id>https://forge.codesys.come7a48561295acae38bd7fd87354fa0cb70f993df</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thank you very much for your reply !&lt;/p&gt;
&lt;p&gt;What I want to do:&lt;/p&gt;
&lt;p&gt;Develop Codesys lessons (simulation with hardware) with PLC's for second year students at applied sciences level, mechanical engineering.&lt;/p&gt;
&lt;p&gt;A simple assignment with three pneumatic cylinders who move in a machine-simulating sequence, with some delay (timer) and some repetition (counter). That's all. (cylinders move in and out, and sensors detect start and end positioning)&lt;/p&gt;
&lt;p&gt;I am relatively new (just work for about a year with Codesys) and work with SFC, which I understand now more or less.&lt;/p&gt;
&lt;p&gt;Can you specify the sentence "do something" ? could that be a SFC transition, for instance cilinder B is 'in' and sensor b0 is active.&lt;/p&gt;
&lt;p&gt;And how to reset the counter ?&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: CDS.JPG" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=2173"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Use of counters in SFC</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/4e2d9845d1/?limit=25#8838" rel="alternate"/><published>2020-02-27T14:04:50.713000Z</published><updated>2020-02-27T14:04:50.713000Z</updated><author><name>wollvieh</name><uri>https://forge.codesys.com/u/wollvieh/</uri></author><id>https://forge.codesys.com107a781753a55c53ebe7cffb7be66cadef3c0dba</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;hey,&lt;br/&gt;
what is the problem ?&lt;br/&gt;
can you tell , what you really want do to ?&lt;/p&gt;
&lt;p&gt;Example :&lt;/p&gt;
&lt;p&gt;var&lt;br/&gt;
  counter : DINT;&lt;br/&gt;
endvar&lt;/p&gt;
&lt;p&gt;IF (xxx = true)&lt;br/&gt;
THEN&lt;br/&gt;
  counter := counter + 1;&lt;br/&gt;
END_IF&lt;/p&gt;
&lt;p&gt;IF (counter &amp;gt; 3)&lt;br/&gt;
THEN&lt;br/&gt;
   ;(&lt;em&gt; do something &lt;/em&gt;)&lt;br/&gt;
ELSE&lt;br/&gt;
   ;(&lt;em&gt; do another thing &lt;/em&gt;)&lt;br/&gt;
END_IF&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Use of counters in SFC</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/4e2d9845d1/?limit=25#d84b" rel="alternate"/><published>2020-02-27T14:04:50.411000Z</published><updated>2020-02-27T14:04:50.411000Z</updated><author><name>Trompdelft</name><uri>https://forge.codesys.com/u/trompdelft/</uri></author><id>https://forge.codesys.com9109b1cf7a8a9cb495d18a45c5caa3917ee22a45</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I am looking for simple examples for using counters in SFC. Is there anyone who can help me&lt;br/&gt;
I just tried to introduce counters with structured text but it doesn't work. I can use function blocks but there should be a more simple way. It is very hard to find examples.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>