<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									PLC Programming Challenge - twinControls Forum				            </title>
            <link>https://twincontrols.com/community/twincat-plc-programming-challenge/</link>
            <description>twinControls  Discussion Board</description>
            <language>en-US</language>
            <lastBuildDate>Wed, 22 Apr 2026 23:37:18 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>Mapping the InfoData - State Flag to the PLC code</title>
                        <link>https://twincontrols.com/community/twincat-plc-programming-challenge/mapping-the-infodata-state-flag-to-the-plc-code/</link>
                        <pubDate>Tue, 10 Jun 2025 14:43:24 +0000</pubDate>
                        <description><![CDATA[Very new to twincat and could do with some help.
I want to map a Physical IO Terminal State (e.g. EL1809) InfoData -&gt; State which shows up as a UINT datatype. However when I try to creat...]]></description>
                        <content:encoded><![CDATA[<p>Very new to twincat and could do with some help.</p>
<p>I want to map a Physical IO Terminal State (e.g. EL1809) InfoData -&gt; State which shows up as a UINT datatype. However when I try to create a link, this tag is unable to find the tag in the plc. Is there something I'm missing here?</p>]]></content:encoded>
						                            <category domain="https://twincontrols.com/community/twincat-plc-programming-challenge/">PLC Programming Challenge</category>                        <dc:creator>Tomek91</dc:creator>
                        <guid isPermaLink="true">https://twincontrols.com/community/twincat-plc-programming-challenge/mapping-the-infodata-state-flag-to-the-plc-code/</guid>
                    </item>
				                    <item>
                        <title>Find Array Bounds</title>
                        <link>https://twincontrols.com/community/twincat-plc-programming-challenge/find-array-bounds/</link>
                        <pubDate>Tue, 07 Feb 2023 22:46:56 +0000</pubDate>
                        <description><![CDATA[Create a generic function to find the bounds of one-dimensional array.  
Inputs:iArray (Any type of array, integer array, char array, bool array etc..)
Outputs:isArray(Bool)nLowerBound(Int...]]></description>
                        <content:encoded><![CDATA[<p>Create a generic function to find the bounds of one-dimensional array.  </p>
<p><strong>Inputs:</strong><br />iArray (Any type of array, integer array, char array, bool array etc..)<br /><br /></p>
<p><strong>Outputs:</strong><br />isArray(Bool)<br />nLowerBound(Int)<br />nUpperBound(Int)<br />nNumberOfElements(Int)</p>
<p> </p>
<p>If the input is an array, isArrayshould be True and other outputs should be lower bound, upper bound and the elements count in the array. <br />If the input is not an array, nLowerBound and nUpperBound should be -1 and isArray should be False,  nNumberOfElements should be 0.  <br /><br /></p>
<p><strong>Examples:</strong> </p>
743
<p> </p>
744
<p> </p>
742
<p> </p>
<p>Happy coding!<span> </span><img class="emoji" role="img" src="https://s.w.org/images/core/emoji/14.0.0/svg/1f4bb.svg" alt="💻" /></p>]]></content:encoded>
						                            <category domain="https://twincontrols.com/community/twincat-plc-programming-challenge/">PLC Programming Challenge</category>                        <dc:creator>twinControls</dc:creator>
                        <guid isPermaLink="true">https://twincontrols.com/community/twincat-plc-programming-challenge/find-array-bounds/</guid>
                    </item>
				                    <item>
                        <title>Array Comparison</title>
                        <link>https://twincontrols.com/community/twincat-plc-programming-challenge/array-comparison/</link>
                        <pubDate>Tue, 31 Jan 2023 17:45:26 +0000</pubDate>
                        <description><![CDATA[Create a generic function to compare two arrays.
Inputs: Enable (Bool)Array1 (Any type of array, integer array, char array etc..)Array2 (Any type of array, integer array, char array etc..)O...]]></description>
                        <content:encoded><![CDATA[<p>Create a generic function to compare two arrays.</p>
<p><br /><strong>Inputs:</strong> <br />Enable (Bool)<br />Array1 (Any type of array, integer array, char array etc..)<br />Array2 (Any type of array, integer array, char array etc..)<br /><br /><strong>Outputs:</strong><br />ArrayDataMatch (Bool)<br />ArraySizeMismatch (Bool)<br />ArrayTypeMismatch (Bool)<br /><br />If the arrays' data match, ArrayDataMatch should be True. <br />If the arrays' size don't match, ArraySizeMismatch should be True. <br />If the arrays are different types, ArrayTypeMismatch should be True. <br /><br />Happy coding! 💻</p>]]></content:encoded>
						                            <category domain="https://twincontrols.com/community/twincat-plc-programming-challenge/">PLC Programming Challenge</category>                        <dc:creator>twinControls</dc:creator>
                        <guid isPermaLink="true">https://twincontrols.com/community/twincat-plc-programming-challenge/array-comparison/</guid>
                    </item>
				                    <item>
                        <title>Measuring the scan cycle of PLC</title>
                        <link>https://twincontrols.com/community/twincat-plc-programming-challenge/measuring-the-scan-cycle-of-plc/</link>
                        <pubDate>Tue, 06 Dec 2022 17:26:42 +0000</pubDate>
                        <description><![CDATA[Write a PLC program to measure the scan cycle (scans per second) of PLC continuosly. Share your solution along with your PLC scan cycle settings and the measured scan cycle value. 
Happy co...]]></description>
                        <content:encoded><![CDATA[<p>Write a PLC program to measure the scan cycle (scans per second) of PLC continuosly. Share your solution along with your PLC scan cycle settings and the measured scan cycle value. </p>
<p>Happy coding! 😊 </p>]]></content:encoded>
						                            <category domain="https://twincontrols.com/community/twincat-plc-programming-challenge/">PLC Programming Challenge</category>                        <dc:creator>twinControls</dc:creator>
                        <guid isPermaLink="true">https://twincontrols.com/community/twincat-plc-programming-challenge/measuring-the-scan-cycle-of-plc/</guid>
                    </item>
				                    <item>
                        <title>Custom Flash Timer</title>
                        <link>https://twincontrols.com/community/twincat-plc-programming-challenge/custom-flash-timer/</link>
                        <pubDate>Thu, 27 Oct 2022 19:33:56 +0000</pubDate>
                        <description><![CDATA[Create a custom flash timer which would allow users to control the inputs below: 

On time
Off time
Pause time
Total time
Number of Flashing Before Pausing 

A sample function block ...]]></description>
                        <content:encoded><![CDATA[<p>Create a custom flash timer which would allow users to control the inputs below: </p>
<ul>
<li>On time</li>
<li>Off time</li>
<li>Pause time</li>
<li>Total time</li>
<li>Number of Flashing Before Pausing </li>
</ul>
<p>A sample function block and the output can be seen below: </p>
<pre contenteditable="false"> fbCustomFlash(
            bStart:= bStart, 
            tOnDuration:= T#2s, 
            tOffDuration:= T#1s, 
            tPauseDuration:= T#4s, 
            tTotalDuration:= T#20s, 
            nBlinkCountBeforePause:= 3, 
            bOut=&gt; bPWM);</pre>
<p> </p>
582
<p> </p>
<p>Sample output for the values below: </p>
<ul>
<li>On time = 1s</li>
<li>Off time = 500ms</li>
<li>Pause time = 3s</li>
<li>Total time = 35s</li>
<li><span>Number of Flashing Before Pausing = 4</span></li>
</ul>
594
<p> </p>
<p>Happy coding! </p>]]></content:encoded>
						                            <category domain="https://twincontrols.com/community/twincat-plc-programming-challenge/">PLC Programming Challenge</category>                        <dc:creator>twinControls</dc:creator>
                        <guid isPermaLink="true">https://twincontrols.com/community/twincat-plc-programming-challenge/custom-flash-timer/</guid>
                    </item>
				                    <item>
                        <title>Arcade games</title>
                        <link>https://twincontrols.com/community/twincat-plc-programming-challenge/arcade-games/</link>
                        <pubDate>Mon, 17 Oct 2022 23:04:12 +0000</pubDate>
                        <description><![CDATA[Here is a sample project that I ported over to TwinCAT for running the classic snake game.  I used this as a sample to start out learning the ST language from ladder logic.  There is a 2D bo...]]></description>
                        <content:encoded><![CDATA[531
<p>Here is a sample project that I ported over to TwinCAT for running the classic snake game.  I used this as a sample to start out learning the ST language from ladder logic.  There is a 2D boolean array that stores pixels of the screen and another array set that has a shifting index for moving the snake between tiles.  The 'ball' or 'food' is a flashing bit that gets scanned and checked if the head of the 'snake' is in contact with it, then shifts down the tail array.  A random generator gets new x/y coordinates for the next 'ball' location, and is validated that it is not already part of the tail.</p>
<p> </p>
<p>Some items of note:</p>
<ul>
<li>Uses a GVL 2-d array and the block checks bounds.  Dimensions on the array can be changed to whatever size as long as the visualization is updated</li>
<li>Uses latching HMI buttons to set the direction in X or Y (-1 or +1 makes cursor go left or right)</li>
<li>Setup variables initializes and resets all variables on bootup</li>
<li>Option for autoscrolling where the 'snake' will continue in a loop around the border of the screen</li>
<li>Option for enable crashes let me disable the end of game when debugging the initial programming</li>
<li>Option for scan time on a slider permits the game speed to change</li>
<li>High score and current score display</li>
</ul>
<p> </p>
<p>Other arcade games that I wrote at this time were something similar to the PONG/tennis game as well as the stacking block tower.  All of these were running on an HMI for a machine that was being built and I had the opportunity to use a joystick that was required for normal machine operation - much more fun than clicking on the visualization screen!</p>
<p> </p>
533]]></content:encoded>
						                            <category domain="https://twincontrols.com/community/twincat-plc-programming-challenge/">PLC Programming Challenge</category>                        <dc:creator>jamesonline</dc:creator>
                        <guid isPermaLink="true">https://twincontrols.com/community/twincat-plc-programming-challenge/arcade-games/</guid>
                    </item>
				                    <item>
                        <title>Traffic Simulation</title>
                        <link>https://twincontrols.com/community/twincat-plc-programming-challenge/traffic-simulation/</link>
                        <pubDate>Mon, 17 Oct 2022 15:15:59 +0000</pubDate>
                        <description><![CDATA[Create a traffic simulation PLC program that follows object oriented programming guidelines. 

When a car gets close to the traffic light, if the light is red, it will stop.
If the light ...]]></description>
                        <content:encoded><![CDATA[<p>Create a traffic simulation PLC program that follows object oriented programming guidelines. </p>
<ul>
<li>When a car gets close to the traffic light, if the light is red, it will stop.</li>
<li>If the light is yellow, it will slow down and continue as long as the the red light is not on. After passing the traffic light, it will continue at regular speed. </li>
<li>If the light is green, it will continue at regular speed. </li>
<li>Check your distance with other cars to avoid collision.</li>
</ul>
<p> </p>
<p>The sample application can be seen below. We have used 3 cars for this simulation. Since the application has followed the object oriented programming style, it is quite easy to add additional cars into this simulation. </p>
528
<p> </p>]]></content:encoded>
						                            <category domain="https://twincontrols.com/community/twincat-plc-programming-challenge/">PLC Programming Challenge</category>                        <dc:creator>twinControls</dc:creator>
                        <guid isPermaLink="true">https://twincontrols.com/community/twincat-plc-programming-challenge/traffic-simulation/</guid>
                    </item>
				                    <item>
                        <title>Adjustable Flowing LEDs - PLC Programming Challenge</title>
                        <link>https://twincontrols.com/community/twincat-plc-programming-challenge/adjustable-flowing-leds-plc-programming-challenge/</link>
                        <pubDate>Tue, 11 Oct 2022 15:46:59 +0000</pubDate>
                        <description><![CDATA[The goal is to create adjustable flowing LEDs PLC program. You will have 16 LEDs total. Users will provide how many flowing LEDs they want, the minimum and maximum flow time from one end to ...]]></description>
                        <content:encoded><![CDATA[<p>The goal is to create adjustable flowing LEDs PLC program. You will have 16 LEDs total. Users will provide how many flowing LEDs they want, the minimum and maximum flow time from one end to the other and they will be able to control the speed on the fly. </p>
<p>-Max 15 flowing LEDs are allowed. </p>
<p>-Start button is used to start the program when all the settings are provided by the user. </p>
<p>-If a user enter 5s for the slowest time and set the speed bar to 0%, it will take LEDs to flow 5s from one end to the other. </p>
<p>-If a user enter 1s for the fastest time and set the speed bar to 100%, it will take LEDs to flow 1s from one end to the other. </p>
<p>A running program can be seen in the video below. You need to write the PLC logic for this HMI, but you are welcome to develop the HMI program as well. </p>
<p>Share your implementation with the community! Good luck and happy coding! 😊 </p>
496]]></content:encoded>
						                            <category domain="https://twincontrols.com/community/twincat-plc-programming-challenge/">PLC Programming Challenge</category>                        <dc:creator>twinControls</dc:creator>
                        <guid isPermaLink="true">https://twincontrols.com/community/twincat-plc-programming-challenge/adjustable-flowing-leds-plc-programming-challenge/</guid>
                    </item>
				                    <item>
                        <title>System status light with adjustable On and Off timers</title>
                        <link>https://twincontrols.com/community/twincat-plc-programming-challenge/system-status-light-with-adjustable-on-and-off-timers/</link>
                        <pubDate>Mon, 10 Oct 2022 13:16:03 +0000</pubDate>
                        <description><![CDATA[Write a reusable PLC logic to control a system status light with adjustable On and Off time durations using any language. 
Sample:]]></description>
                        <content:encoded><![CDATA[<p>Write a reusable PLC logic to control a system status light with adjustable On and Off time durations using any language. </p>
<p>Sample:</p>
515
<p> </p>]]></content:encoded>
						                            <category domain="https://twincontrols.com/community/twincat-plc-programming-challenge/">PLC Programming Challenge</category>                        <dc:creator>twinControls</dc:creator>
                        <guid isPermaLink="true">https://twincontrols.com/community/twincat-plc-programming-challenge/system-status-light-with-adjustable-on-and-off-timers/</guid>
                    </item>
				                    <item>
                        <title>Challenge Project Operations: Addition, Subtraction, Division, program OOP with Interfaces, Polymorphism, Etc...</title>
                        <link>https://twincontrols.com/community/twincat-plc-programming-challenge/challenge-project-operations-addition-subtraction-division-program-oop-with-interfaces-polymorphism-etc/</link>
                        <pubDate>Fri, 07 Oct 2022 09:34:03 +0000</pubDate>
                        <description><![CDATA[Hello, 
My challenge would be to carry out a project that performs addition, subtraction and division operations under OOP object-oriented programming, in which interfaces, polymorphism, et...]]></description>
                        <content:encoded><![CDATA[<p>Hello, </p>
<p>My challenge would be to carry out a project that performs addition, subtraction and division operations under OOP object-oriented programming, in which interfaces, polymorphism, etc... must be used,<br />The philosophy or the approach should not be changed to make it an interesting challenge and with a little difficulty in assuming concepts, it is also intended that it remain as a fluid programming that is the one that is most similar to the way we speak and the most natural...<br />I attach some photos so that we all follow the same structure and definition... I hope you have fun coding and looking for the solution to the exposed challenge...</p>
455
<p> </p>]]></content:encoded>
						                            <category domain="https://twincontrols.com/community/twincat-plc-programming-challenge/">PLC Programming Challenge</category>                        <dc:creator>runtimevictor</dc:creator>
                        <guid isPermaLink="true">https://twincontrols.com/community/twincat-plc-programming-challenge/challenge-project-operations-addition-subtraction-division-program-oop-with-interfaces-polymorphism-etc/</guid>
                    </item>
							        </channel>
        </rss>
		