<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to SFC Action problems</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/8add358d25/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/8add358d25/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/8add358d25/</id><updated>2024-05-27T14:58:50.954000Z</updated><subtitle>Recent posts to SFC Action problems</subtitle><entry><title>SFC Action problems</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/8add358d25/?limit=25#f777" rel="alternate"/><published>2024-05-27T14:58:50.954000Z</published><updated>2024-05-27T14:58:50.954000Z</updated><author><name>hwopereis</name><uri>https://forge.codesys.com/u/hwopereis/</uri></author><id>https://forge.codesys.com98bd1354e174396a70caf8adf33589e4705d3168</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Only logged in to agree with the above. So counter intuitive. Why does an associated action force the variable when the step it is associated to is not active? Makes no sense at all, is terrible to debug and costs a lot of time.  Such as shame.  &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>SFC Action problems</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/8add358d25/?limit=25#eb96" rel="alternate"/><published>2023-08-10T14:50:41.414000Z</published><updated>2023-08-10T14:50:41.414000Z</updated><author><name>merar</name><uri>https://forge.codesys.com/u/merar/</uri></author><id>https://forge.codesys.comb9f0cd8a23b26439ef86d322d57019a27181b6fe</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello there,&lt;/p&gt;
&lt;p&gt;I'm crazy with Codesys SFC&lt;/p&gt;
&lt;p&gt;I program SFC from many years but Codesys SFC works bad&lt;/p&gt;
&lt;p&gt;For example, when I attach an 'N-action' at the right side of a state, the output becomes ON when the state is active. That's OK, BUT... when the state is not active,  the output becomes OFF at every scan cycle, so I cannot activate it from any other part of the program&lt;/p&gt;
&lt;p&gt;The fact is that this is not SFC. It look like, but the way it works seems to be a LADDER, always checking 100% of the states no matter if they are active or not&lt;/p&gt;
&lt;p&gt;The only way to get the variable is by using Entry and Exit programs for SET and RESET the output by LD programs. At the end, much more programming time and confusion to follow the program&lt;/p&gt;
&lt;p&gt;I think this software doesn't comply  IEC 61131-3 and is not useful for programming machines (perhaps it is for semaphore lights...)&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>SFC Action problems</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/8add358d25/?limit=25#fee5" rel="alternate"/><published>2023-08-10T14:50:38.645000Z</published><updated>2023-08-10T14:50:38.645000Z</updated><author><name>merar</name><uri>https://forge.codesys.com/u/merar/</uri></author><id>https://forge.codesys.com0d2166134e88107d5230462431c42f13ccd410e6</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello there,&lt;/p&gt;
&lt;p&gt;I'm crazy with Codesys SFC&lt;/p&gt;
&lt;p&gt;I program SFC from many years but Codesys SFC works bad&lt;/p&gt;
&lt;p&gt;For example, when I attach an 'N-action' at the right side of a state, the output becomes ON when the state is active. That's OK, BUT... when the state is not active,  the output becomes OFF at every scan cycle, so I cannot activate it from any other part of the program&lt;/p&gt;
&lt;p&gt;The fact is that this is not SFC. It look like, but the way it works seems to be a LADDER, always checking 100% of the states no matter if they are active or not&lt;/p&gt;
&lt;p&gt;The only way to get the variable is by using Entry and Exit programs for SET and RESET the output by LD programs. At the end, much more programming time and confusion to follow the program&lt;/p&gt;
&lt;p&gt;I think this software doesn't comply  IEC 61131-3 and is not useful for programming machines (perhaps it is for semaphore lights...)&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>SFC Action problems</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/8add358d25/?limit=25#3661" rel="alternate"/><published>2020-02-27T22:18:07.618000Z</published><updated>2020-02-27T22:18:07.618000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com7849b6b36a68495c506058d890af797dff1db2a8</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;yes a timer inside a step stays high( well it is not scanned anymore so the state is unknown)&lt;br/&gt;
when going back in the step it still sees a true value inside.&lt;br/&gt;
another way is to use TP.&lt;br/&gt;
When timer is done be sure to switch it off before leaving the step.&lt;br/&gt;
if timer.q then timer.in:=false; end_if&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>SFC Action problems</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/8add358d25/?limit=25#d6ec" rel="alternate"/><published>2020-02-27T22:18:03.312000Z</published><updated>2020-02-27T22:18:03.312000Z</updated><author><name>saimir</name><uri>https://forge.codesys.com/u/saimir/</uri></author><id>https://forge.codesys.comf937133832253ab5ff2c78afd77baf2e0f432902</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi &lt;br/&gt;
I programming in SFC and LD and am trying to introduce a time delay between two consecutive steps, but timer output remains high after leaving the step and when it goes through the next time there is no time delay&lt;br/&gt;
Does anyone has any example&lt;br/&gt;
Regards&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>SFC Action problems</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/8add358d25/?limit=25#d659" rel="alternate"/><published>2020-02-27T22:18:01.766000Z</published><updated>2020-02-27T22:18:01.766000Z</updated><author><name>saimir</name><uri>https://forge.codesys.com/u/saimir/</uri></author><id>https://forge.codesys.com634dabac111fdcbc78414a96736a04efbae2c004</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;crthomas1234 hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
I agree with Shooter.  Use the EXIT step in SFC to unset any variables that should be cleared.&lt;br/&gt;
An advantage you can use if you are clearing the same variables every time is that you can create a single action that clears the variables and then have each EXIT step always call the same action so you can re-use the code and not have to create a bunch of steps that all do the same thing and clutter your project.&lt;br/&gt;
For me, I usually create an action that I call with the S0 attribute in the INIT step.  The S0 attribute tells the program to run the program continuously once it has been activated.  I will then use this action for things such as calling function blocks and timers.&lt;br/&gt;
Because the issue you can get into with SFC is that a timer, for example, needs a final call to reset the timer back to 0 and clear the outputs.  If you are to use the output pin from a timer to transition a state in SFC, your function blocks will get frozen with the output bit set on and it becomes really troublesome to manage them this way.  So by putting them in a latched action, you can use your SFC states to read and write to the input pins of the Function Block without the risk of getting the Function Block stuck in an undesired state.&lt;/p&gt;
&lt;/blockquote&gt;&lt;/div&gt;</summary></entry><entry><title>SFC Action problems</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/8add358d25/?limit=25#8b65" rel="alternate"/><published>2020-02-27T22:17:57.451000Z</published><updated>2020-02-27T22:17:57.451000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.com7fca29b1708718555f4105d5102ac298495b17fd</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;em&gt;Originally created by:&lt;/em&gt; crthomas1234&lt;/p&gt;
&lt;p&gt;I agree with Shooter.  Use the EXIT step in SFC to unset any variables that should be cleared.&lt;/p&gt;
&lt;p&gt;An advantage you can use if you are clearing the same variables every time is that you can create a single action that clears the variables and then have each EXIT step always call the same action so you can re-use the code and not have to create a bunch of steps that all do the same thing and clutter your project.&lt;/p&gt;
&lt;p&gt;For me, I usually create an action that I call with the S0 attribute in the INIT step.  The S0 attribute tells the program to run the program continuously once it has been activated.  I will then use this action for things such as calling function blocks and timers.  &lt;/p&gt;
&lt;p&gt;Because the issue you can get into with SFC is that a timer, for example, needs a final call to reset the timer back to 0 and clear the outputs.  If you are to use the output pin from a timer to transition a state in SFC, your function blocks will get frozen with the output bit set on and it becomes really troublesome to manage them this way.  So by putting them in a latched action, you can use your SFC states to read and write to the input pins of the Function Block without the risk of getting the Function Block stuck in an undesired state.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>SFC Action problems</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/8add358d25/?limit=25#cb7c" rel="alternate"/><published>2020-02-27T22:17:55.901000Z</published><updated>2020-02-27T22:17:55.901000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com62398ddbcfcbd02486b829b73af52fd9c4f49e2b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;IN SFC there are ENTRY steps and EXIT steps, and normal steps.&lt;br/&gt;
Entry actions is done when entering the step, but only once.&lt;br/&gt;
same for EXIT.&lt;br/&gt;
all Normal actions are done as long as the Step is active.&lt;/p&gt;
&lt;p&gt;In IEC see the letter in front like N T etc.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>SFC Action problems</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/8add358d25/?limit=25#6c8b" rel="alternate"/><published>2020-02-27T22:17:51.601000Z</published><updated>2020-02-27T22:17:51.601000Z</updated><author><name>t.lundahl</name><uri>https://forge.codesys.com/u/t-lundahl/</uri></author><id>https://forge.codesys.com1de3493ad052b68ed9a911d74691b91dea88eeb2</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi! It's long time ago I dealed with this.&lt;/p&gt;
&lt;p&gt;Look at the move Roland provided. I think it explain that you should use entry and exit option in the step. I think you double klick on the step at each corner. Or you right click and choose add exit or entry action.&lt;/p&gt;
&lt;p&gt;Regarding to the missing action you need to add an action by right click on Pou and 'Add Action' and use the same name in the IEC flag beside the step.&lt;/p&gt;
&lt;p&gt;Hope this will help you a little.&lt;/p&gt;
&lt;p&gt;/Torbjörn&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>SFC Action problems</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/8add358d25/?limit=25#d1dd" rel="alternate"/><published>2020-02-27T22:17:50.045000Z</published><updated>2020-02-27T22:17:50.045000Z</updated><author><name>Niall</name><uri>https://forge.codesys.com/u/niall/</uri></author><id>https://forge.codesys.comd6c1edf650e700880150302c2d169ea731f0dfc7</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi I am new to the forum. I am also having the problem that the actions(or in fact the outputs that are within the step) remain active even when the SFC step has moved to the next step. The action steps themselves move on but their outputs stay energized. How can I solve this. &lt;/p&gt;
&lt;p&gt;Also I have tried to use the IEC action steps and I cannot seem to get it going. I get error 4358, action not declared. Am I missing something simple?&lt;/p&gt;
&lt;p&gt;Many thanks in anticipation&lt;br/&gt;
Niall&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>