<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to SFC - Creating action blocks in SFC</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/6edc6437e4/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/6edc6437e4/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/6edc6437e4/</id><updated>2020-02-27T13:47:37.102000Z</updated><subtitle>Recent posts to SFC - Creating action blocks in SFC</subtitle><entry><title>SFC - Creating action blocks in SFC</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/6edc6437e4/?limit=25#ff9f" rel="alternate"/><published>2020-02-27T13:47:37.102000Z</published><updated>2020-02-27T13:47:37.102000Z</updated><author><name>Strucc</name><uri>https://forge.codesys.com/u/strucc/</uri></author><id>https://forge.codesys.comea1c17c562a80d209dc2f5f79e2a5258e30a22f4</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Dear all,&lt;/p&gt;
&lt;p&gt;Normally I don't use SFC (sequential flow chart) in my projects, but this time, the nature of the problem seems to be expressible this way in the most elegant manner.&lt;/p&gt;
&lt;p&gt;Briefly, it's about controlling a complex hydraulic system, to run sequential programs via manipulating valves and pumps. There are basic sequences like:&lt;br/&gt;
&lt;em&gt; Backwash DF &lt;/em&gt;:&lt;br/&gt;
- Make sure pumps are off&lt;br/&gt;
- Set valves on DF&lt;br/&gt;
- Start pumps&lt;br/&gt;
- Make sure flow and pressure is established&lt;br/&gt;
- Wait 30s or 0.4m3&lt;br/&gt;
- Stop pumps&lt;br/&gt;
- Reset valves to normal position&lt;/p&gt;
&lt;p&gt;There are a dozen of such "action groups", what would be nice to be used in higher level programs, like&lt;br/&gt;
- * Production * (backwash before starting)&lt;br/&gt;
- * Shutdown / standby * (backwash regularly)&lt;br/&gt;
- * CEB / CIP * (backwash as needed)&lt;/p&gt;
&lt;p&gt;Naturally, I can write to whole thing using ST, and a state variable, or SFC, with long sequences, but I was wondering, if it's possible to define "reusable" macros in SFC to do this. I know it's possible to define macros in SFC, but they doesn't seems to be reusable in other parts of the structure. &lt;/p&gt;
&lt;p&gt;What is the standard way to reuse one SFC program, with standard INIT - EXIT from within another?&lt;/p&gt;
&lt;p&gt;Thanks for any recommendations,&lt;/p&gt;
&lt;p&gt;P.Peter&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>