<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Going between ladder logic and FB. Question?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b06e53765d/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b06e53765d/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/b06e53765d/</id><updated>2020-02-27T13:47:37.635000Z</updated><subtitle>Recent posts to Going between ladder logic and FB. Question?</subtitle><entry><title>Going between ladder logic and FB. Question?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b06e53765d/?limit=25#9d84" rel="alternate"/><published>2020-02-27T13:47:37.635000Z</published><updated>2020-02-27T13:47:37.635000Z</updated><author><name>coltc</name><uri>https://forge.codesys.com/u/coltc/</uri></author><id>https://forge.codesys.combaf40b8528ae9b1caef127ee857adf2171d461c4</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;The POU is definitely running. Everything else in it was working. I think I'm going to have to dig into it a bunch when I get back to the site.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Going between ladder logic and FB. Question?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b06e53765d/?limit=25#ae30" rel="alternate"/><published>2020-02-27T13:47:37.515000Z</published><updated>2020-02-27T13:47:37.515000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.coma83f327e8b83988a72eb8cdbbc9be782a9d4e894</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;Your usage of the SEL block is correct.  Are you calling the POU so it will run?&lt;/p&gt;
&lt;p&gt;Example PLC_PRG:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;POU1&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;POU2&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;POU3&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;POU4&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;POU5&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;If you don't  the POU, it doesn't execute any code.  Maybe this is why?&lt;/p&gt;
&lt;p&gt;You could also try if a local variable inside of the POU with the SEL block can change the SEL state...&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Going between ladder logic and FB. Question?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b06e53765d/?limit=25#f879" rel="alternate"/><published>2020-02-27T13:47:37.467000Z</published><updated>2020-02-27T13:47:37.467000Z</updated><author><name>coltc</name><uri>https://forge.codesys.com/u/coltc/</uri></author><id>https://forge.codesys.com4b765b8f6f23e390f2852d099977863bd156f42c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Now that you mention it, I don't believe I've ever seen that SEL block work when the variable went high and i dont remember it working when forcing the bit. It is the only SEL block used in the program. &lt;/p&gt;
&lt;p&gt;This is just going off of memory. It will be a fee weeks until I get back to the site.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Going between ladder logic and FB. Question?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b06e53765d/?limit=25#81c0" rel="alternate"/><published>2020-02-27T13:47:37.415000Z</published><updated>2020-02-27T13:47:37.415000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.com4365290badd6e50b5b2f15a2b8d5f116822ef1dd</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;Can you get any SEL block to work?  Does the other rungs work in the same POU?  If SEL600HP is a global BOOL, then it should work.  When viewing in the online mode, do you see your variable switch from FALSE to TRUE on that rung?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Going between ladder logic and FB. Question?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b06e53765d/?limit=25#5955" rel="alternate"/><published>2020-02-27T13:47:37.382000Z</published><updated>2020-02-27T13:47:37.382000Z</updated><author><name>coltc</name><uri>https://forge.codesys.com/u/coltc/</uri></author><id>https://forge.codesys.com8d8f9387f3b3f6149e10f8f1fd323db4e42b3420</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I got a little busy at another site but:&lt;/p&gt;
&lt;p&gt;It is defined as a VAR_GLOBAL. It is also used as a digital output from the coil. It seems to me it should work as it is now but I couldn't get the SEL block to change between the two values listed.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Going between ladder logic and FB. Question?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b06e53765d/?limit=25#9ec7" rel="alternate"/><published>2020-02-27T13:47:37.334000Z</published><updated>2020-02-27T13:47:37.334000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.coma7cb50fe7f45e1ea4ec4fc1af239b2b91d23afac</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;How did you define your coil (variable)?  If it was defined as a VAR in POU1, then it is not available in POU2 by design. It could be your Programming environment defined a local var in POU2 with the same name when you typed it in. If you need it in several POUs, then define it as a VAR_OUTPUT IN POU1 or as a global. &lt;/p&gt;
&lt;p&gt;POUs define blocks of code and scope of variables. By design, internal VARs or POU1 are not available in other POUs. VAR_INPUT, VAR_OUTPUT and VAR_IN_OUTs are used to pass data back and forth in a controlled manner. You can also use global variables which are available in all POUs, but use sparingly as it becomes harder to troubleshoot and guarantee what POU is modifying the global, etc.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Going between ladder logic and FB. Question?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b06e53765d/?limit=25#ded8" rel="alternate"/><published>2020-02-27T13:47:37.294000Z</published><updated>2020-02-27T13:47:37.294000Z</updated><author><name>coltc</name><uri>https://forge.codesys.com/u/coltc/</uri></author><id>https://forge.codesys.com5cbb6a6bc223e3550322eba360198f6bca74a8a0</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Before I ask my question let me say that I am not very experienced with CODESYS. I was given a program and asked to start a system but I needed to make a few changes. Here's my issue. &lt;/p&gt;
&lt;p&gt;My program has five different POUs(?) I guess they are called. The first is done in function block programming and the rest are ladder logic. &lt;/p&gt;
&lt;p&gt;I added some simple ladder logic and it works. &lt;/p&gt;
&lt;p&gt;Using the logic I added, I would like to use the coil in the ladder logic (like you would use a contact form the coil) to operate a SEL block within the function block logic. This is what I can not get to work. &lt;/p&gt;
&lt;p&gt;Any ideas?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: Untitled.jpg" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=1426"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>