<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Structuring of program</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/602cc1583a/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/602cc1583a/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/602cc1583a/</id><updated>2020-02-27T14:23:04.979000Z</updated><subtitle>Recent posts to Structuring of program</subtitle><entry><title>Structuring of program</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/602cc1583a/?limit=25#3b52" rel="alternate"/><published>2020-02-27T14:23:04.979000Z</published><updated>2020-02-27T14:23:04.979000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.com1c3fa3f9c4e1f91282fb6b259c729a2c46e5ce0b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;em&gt;Originally created by:&lt;/em&gt; rickj&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Many  people define global tags using the % placeholder for the address and then use the codesys I/O assignment tools to bind the actual I/O points to the tags.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If it were me I would build simulators for each of the lines so I could test everything without any I/O.  In this case I/O points would be connected to the simulator and virtual I/O points would be connected between simulator and control function blocks.  When simulator is disabled I/O is passed to/from the control FB.  When it's enabled then feedbacks are supplied by the simulator rather than I/O  and control outputs are sent to the simulator rather than written to outputs.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;There is an art to making FBs, or at least there is for good ones.  Think hard and long how best to decompose the problem.  Don't use more than 2 or 3 levels of inheritance, unless you really know what you're doing.  &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Consider using program POUs for each line and then use a couple of your custom FBs in the program.  This way local variable scope can be used for tuneup constants and intermediate variables.  The program can then be copy/pasted for the next line and then edited for any differences.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;</summary></entry><entry><title>Structuring of program</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/602cc1583a/?limit=25#6198" rel="alternate"/><published>2020-02-27T14:23:04.568000Z</published><updated>2020-02-27T14:23:04.568000Z</updated><author><name>somlioy</name><uri>https://forge.codesys.com/u/somlioy/</uri></author><id>https://forge.codesys.com8cd08e47359637c6db69169d04d2b44f9142beb2</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Iam to make a simple plant with multiple process lines. Each process line consists of a pump driven by a VFD over modbus and a pressure transmitter. A PID is controlling the motor speed to keep a constant pressure.&lt;/p&gt;
&lt;p&gt;I'm thinking a function block for each process line, such that a process line can easily be intiated with the required content.&lt;br/&gt;
As I mentioned the VFD has modbus TCP communication, and hence has several process words and a status word associated with it.&lt;/p&gt;
&lt;p&gt;The pressure transmitter is a simple 4-20mA sensor. &lt;/p&gt;
&lt;p&gt;Everything is to be controlled from a visu, no external control.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>