<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to User Defined function Block</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/57f440f701/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/57f440f701/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/57f440f701/</id><updated>2020-02-27T13:48:00.930000Z</updated><subtitle>Recent posts to User Defined function Block</subtitle><entry><title>User Defined function Block</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/57f440f701/?limit=25#07e2" rel="alternate"/><published>2020-02-27T13:48:00.930000Z</published><updated>2020-02-27T13:48:00.930000Z</updated><author><name>ais</name><uri>https://forge.codesys.com/u/ais/</uri></author><id>https://forge.codesys.com280a77671c674338f37902a8e045d773b2e1eac4</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks. I have it sorted.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>User Defined function Block</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/57f440f701/?limit=25#9c36" rel="alternate"/><published>2020-02-27T13:48:00.842000Z</published><updated>2020-02-27T13:48:00.842000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.comff8940444c6606d050610bda4a21ec675ea4b1c6</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;em&gt;Originally created by:&lt;/em&gt; scott_cunningham&lt;/p&gt;
&lt;p&gt;Create a new POU, select FUNCTION BLOCK. Now define your variable you want to see (relay coil) as a VAR OUTPUT. Local variables are not visible outside the function block.  The start and stop variables should be VAR INPUTS so you can sent them into the function block. In your main code, create an instance (variable) of type your function block. &lt;/p&gt;
&lt;p&gt;In the end, your function block should look like:&lt;/p&gt;
&lt;p&gt;FUNCTION_BLOCK Demo&lt;/p&gt;
&lt;p&gt;VAR INPUT&lt;br/&gt;
   Start : BOOL;&lt;br/&gt;
   Stop : BOOL;&lt;br/&gt;
END VAR&lt;/p&gt;
&lt;p&gt;VAR OUTPUT&lt;br/&gt;
   Coil: BOOL;&lt;br/&gt;
END VAR&lt;/p&gt;
&lt;p&gt;If you are comfortable in one of the other programming languages, I would suggest using it. LD can be difficult for people who use C, BASIC, JAVA or other PC languages. ST works best for people with that comfort level (I am one of those people...)&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>User Defined function Block</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/57f440f701/?limit=25#f081" rel="alternate"/><published>2020-02-27T13:48:00.756000Z</published><updated>2020-02-27T13:48:00.756000Z</updated><author><name>ais</name><uri>https://forge.codesys.com/u/ais/</uri></author><id>https://forge.codesys.come1bdcc97a8cb44d40f128d79c33b03ea848d88f7</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi all&lt;br/&gt;
Not sure if this is just me or if others face the same issues.&lt;br/&gt;
I understand PLCs but am new to actually programming them.&lt;br/&gt;
From the sparse resources I was able to find for V3.5 SP8.2 I was finally able to create a user defined Ladder FUNCTION after about 8 hours; whereas this should really have taken me 15 minutes with a decent "howto".&lt;br/&gt;
My main guidance was by watching Wago 2.3 demos using ST.&lt;/p&gt;
&lt;p&gt;Now I am trying to make a user defined FUNCTION BLOCK using LD.&lt;br/&gt;
I have run into some problems and do not want to spend the next 8 hours being frustrated, so thought I would ask for some help.&lt;/p&gt;
&lt;p&gt;For my test example I want to make a simple Stop/Start latching relay circuit.&lt;br/&gt;
I tried pasting the screen shot as an image, but its not working... so I have:&lt;br/&gt;
A n/o Start PB in series with a n/c Stop PB in series with a Relay coil; and a n/o Relay contact in parallel with the Start PB.&lt;/p&gt;
&lt;p&gt;So how do I make a function block out of this sothat I can use the status of the Relay as a BOOL "switch"?&lt;/p&gt;
&lt;p&gt;Please note the point of this is to simply learn how to create a user defined function block.&lt;br/&gt;
Any help or links would be appreciated.&lt;/p&gt;
&lt;p&gt;Edit: Oh and one more thing...&lt;br/&gt;
Any tips on searching this forum?&lt;br/&gt;
It often reports it is ignoring the search terms which is not really useful.&lt;/p&gt;
&lt;p&gt;2nd: Edit&lt;br/&gt;
FWIW I now have a ST UDFB working - not LD yet.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>