<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>CONTROLLINO &#8211; CONTROLLINO</title>
	<atom:link href="https://www.controllino.com/author/controllino_editors/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.controllino.com</link>
	<description>Industrial PLCs &#124; 100% Arduino-compatible</description>
	<lastBuildDate>Wed, 11 Dec 2024 15:33:48 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.controllino.com/wp-content/uploads/2023/05/cropped-C_Logo_Filled_RGB-1-32x32.png</url>
	<title>CONTROLLINO &#8211; CONTROLLINO</title>
	<link>https://www.controllino.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>OpenPLC Editor for CONTROLLINO</title>
		<link>https://www.controllino.com/openplc_get_started/</link>
		
		<dc:creator><![CDATA[CONTROLLINO]]></dc:creator>
		<pubDate>Mon, 09 Dec 2024 16:02:35 +0000</pubDate>
				<category><![CDATA[OpenPLC]]></category>
		<category><![CDATA[Tutorials]]></category>
		<guid isPermaLink="false">https://www.controllino.com/?p=17531</guid>

					<description><![CDATA[Introduction In the world of industrial automation, having an intuitive and powerful programming environment is key. OpenPLC Editor, combined with CONTROLLINO, brings a seamless IEC 61131-3 programming experience, simulation capabilities, and Modbus communication to the table. Here&#8217;s how you can install and get started with OpenPLC Editor, including support for CONTROLLINO boards. Why Choose OpenPLC [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading">Introduction</h3>



<p>In the world of industrial automation, having an intuitive and powerful programming environment is key. OpenPLC Editor, combined with CONTROLLINO, brings a seamless IEC 61131-3 programming experience, simulation capabilities, and Modbus communication to the table. Here&#8217;s how you can install and get started with OpenPLC Editor, including support for CONTROLLINO boards.</p>



<h4 class="wp-block-heading">Why Choose OpenPLC Editor with CONTROLLINO?</h4>



<ul class="wp-block-list">
<li><strong>Rich IEC 61131-3 Programming IDE</strong>: Enjoy programming in Ladder, Structured Text (ST), Instruction List (IL), Function Block Diagram (FBD), and Sequential Function Chart (SFC).<br><em>&#8220;Nice and mature IDE for IEC 61131-3 programming.&#8221;</em></li>



<li><strong>Simulation Capabilities</strong>: Test your program before uploading it to the CONTROLLINO.<br><em>&#8220;You can simulate your program before uploading to CONTROLLINO.&#8221;</em></li>



<li><strong>Modbus RTU, Serial, and TCP/IP</strong>: Full support for RS485 communication on CONTROLLINO MAXI and MEGA.</li>
</ul>



<h3 class="wp-block-heading">Step 1: Download and Install OpenPLC Editor</h3>



<ol class="wp-block-list">
<li><strong>Download</strong>: Visit the <a href="https://www.openplcproject.com/">OpenPLC download page</a> and choose the appropriate version for your operating system.</li>



<li><strong>Install</strong>: Follow the standard installation process after downloading the setup file.</li>
</ol>



<h3 class="wp-block-heading">Step 2: Update OpenPLC Editor for CONTROLLINO Boards Support</h3>



<ul class="wp-block-list">
<li><strong>Open the Editor</strong>: After installation, launch the OpenPLC Editor.</li>



<li><strong>Check for Updates</strong>: Navigate to <code>File -&gt; Check for updates...</code> as shown below: </li>
</ul>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img fetchpriority="high" decoding="async" width="446" height="441" src="https://www.controllino.com/wp-content/uploads/2024/12/check_updates_1.png" alt="" class="wp-image-17532" style="width:426px;height:auto" srcset="https://www.controllino.com/wp-content/uploads/2024/12/check_updates_1.png 446w, https://www.controllino.com/wp-content/uploads/2024/12/check_updates_1-300x297.png 300w, https://www.controllino.com/wp-content/uploads/2024/12/check_updates_1-100x100.png 100w" sizes="(max-width: 446px) 100vw, 446px" /></figure>
</div>


<ul class="wp-block-list">
<li><strong>Apply Updates</strong>: If updates are available, accept them and restart OpenPLC Editor to finalize the installation.</li>



<li><strong>Checking Controllino&#8217;s Boards</strong>: Check that is possible to select our boards in the Arduino upload dialog.</li>
</ul>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" width="450" height="435" src="https://www.controllino.com/wp-content/uploads/2024/12/check_updates_3.png" alt="" class="wp-image-17534" srcset="https://www.controllino.com/wp-content/uploads/2024/12/check_updates_3.png 450w, https://www.controllino.com/wp-content/uploads/2024/12/check_updates_3-300x290.png 300w" sizes="(max-width: 450px) 100vw, 450px" /></figure>
</div>


<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p><em>Tip: CONTROLLINO support might already be included in your version, but it’s always good practice to check for updates.</em></p>
</blockquote>



<h3 class="wp-block-heading">Step 3: Start a New Project with OpenPLC Editor</h3>



<ol class="wp-block-list">
<li><strong>Create or Open a Project</strong>: Click on the <code>Open</code> icon in the toolbar to start a new project or load an existing one.</li>
</ol>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" width="448" height="442" src="https://www.controllino.com/wp-content/uploads/2024/12/open_example_1.png" alt="" class="wp-image-17533" srcset="https://www.controllino.com/wp-content/uploads/2024/12/open_example_1.png 448w, https://www.controllino.com/wp-content/uploads/2024/12/open_example_1-300x296.png 300w, https://www.controllino.com/wp-content/uploads/2024/12/open_example_1-100x100.png 100w" sizes="(max-width: 448px) 100vw, 448px" /></figure>
</div>


<ol class="wp-block-list">
<li><strong>Explore the Example Project</strong>: Use the predefined programs and structures (e.g., <code>inputs</code>, <code>outputs</code>, and <code>control</code>) to understand the flow of your automation logic.</li>



<li><strong>Write Your Code</strong>: Develop your automation project using Ladder Logic or any of the supported programming languages.</li>
</ol>



<h3 class="wp-block-heading">Advantages of CONTROLLINO Boards with OpenPLC</h3>



<ul class="wp-block-list">
<li><strong>Arduino-Compatible Hardware</strong>: CONTROLLINO is based on Arduino, making it familiar and developer-friendly.</li>



<li><strong>Industrial-Grade Quality</strong>: Designed for real-world applications with robust build quality and excellent communication interfaces.</li>



<li><strong>Seamless Integration</strong>: Direct support in OpenPLC Editor ensures a smooth experience from programming to deployment.</li>
</ul>



<p>By following these steps, you can harness the power of OpenPLC Editor and CONTROLLINO to develop, simulate, and deploy industrial automation projects efficiently. Embrace the future of automation with this powerful combination!</p>



<h3 class="wp-block-heading">How to get and open examples<a href="https://github.com/CONTROLLINO-PLC/OpenPLC_examples/blob/master/images/check_updates_1.png#how-to-get-and-open-examples"></a></h3>



<ul class="wp-block-list">
<li>Install git and clone the examples repository.</li>



<li>Open the link below and download the examples folders or execute on local git app the following command: 
<ul class="wp-block-list">
<li><code>git clone https://github.com/CONTROLLINO-PLC/OpenPLC_examples.git</code></li>
</ul>
</li>
</ul>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://github.com/CONTROLLINO-PLC/OpenPLC_examples/tree/master">OpenPLC examples on Github</a></div>
</div>



<p></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Embbeded web to test Controllino MICRO features</title>
		<link>https://www.controllino.com/embbeded-web-to-test-controllino-micro-features/</link>
		
		<dc:creator><![CDATA[CONTROLLINO]]></dc:creator>
		<pubDate>Sat, 07 Dec 2024 01:02:43 +0000</pubDate>
				<category><![CDATA[MICRO]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Tutorials]]></category>
		<guid isPermaLink="false">https://www.controllino.com/?p=17511</guid>

					<description><![CDATA[The project provides an easy to install tool to test the main features of the Controllino MICRO by serving an embedded web application directly from the device, easilly accesible from any web browser. Fast get started Download latest firmware Controllino MICRO RS485 .uf2 https://github.com/CONTROLLINO-PLC/micro_embedded_web/releases/download/global/web_micro_rs485.uf2 Controllino MICRO CAN .uf2 https://github.com/CONTROLLINO-PLC/micro_embedded_web/releases/download/global/web_micro_can.uf2   Upload firmware For easy installation [&#8230;]]]></description>
										<content:encoded><![CDATA[		<div data-elementor-type="wp-post" data-elementor-id="17511" class="elementor elementor-17511" data-elementor-post-type="post">
									<section class="elementor-section elementor-top-section elementor-element elementor-element-2e392bfb elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="2e392bfb" data-element_type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-765b8c54" data-id="765b8c54" data-element_type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
								<div class="elementor-element elementor-element-359013ac elementor-widget__width-initial elementor-widget elementor-widget-text-editor" data-id="359013ac" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
			<style>/*! elementor - v3.15.0 - 20-08-2023 */
.elementor-widget-text-editor.elementor-drop-cap-view-stacked .elementor-drop-cap{background-color:#69727d;color:#fff}.elementor-widget-text-editor.elementor-drop-cap-view-framed .elementor-drop-cap{color:#69727d;border:3px solid;background-color:transparent}.elementor-widget-text-editor:not(.elementor-drop-cap-view-default) .elementor-drop-cap{margin-top:8px}.elementor-widget-text-editor:not(.elementor-drop-cap-view-default) .elementor-drop-cap-letter{width:1em;height:1em}.elementor-widget-text-editor .elementor-drop-cap{float:left;text-align:center;line-height:1;font-size:50px}.elementor-widget-text-editor .elementor-drop-cap-letter{display:inline-block}</style>				<p>The project provides an easy to install tool to test the main features of the Controllino MICRO by serving an embedded web application directly from the device, easilly accesible from any web browser.</p>
<p><!-- /wp:paragraph --><!-- wp:image {"id":17512,"sizeSlug":"full","linkDestination":"none"} --></p>
<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1002" height="434" class="wp-image-17512" src="https://www.controllino.com/wp-content/uploads/2024/12/dashboard.png" alt="" srcset="https://www.controllino.com/wp-content/uploads/2024/12/dashboard.png 1002w, https://www.controllino.com/wp-content/uploads/2024/12/dashboard-300x130.png 300w, https://www.controllino.com/wp-content/uploads/2024/12/dashboard-768x333.png 768w" sizes="auto, (max-width: 1002px) 100vw, 1002px" /></figure>
<h3><strong>Fast get started</strong></h3>
<p><!-- /wp:image --><!-- wp:quote --></p>
<blockquote class="wp-block-quote">
<p><!-- wp:heading {"level":3} --></p>
<p><!-- /wp:heading --></p>
</blockquote>
<p><!-- /wp:quote --><!-- wp:list --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li><strong>Download latest firmware</strong></li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --><!-- wp:list {"ordered":true} --></p>
<ol class="wp-block-list">
<li style="list-style-type: none;">
<ol class="wp-block-list"><!-- wp:list-item --></ol>
</li>
</ol>
<ol class="wp-block-list">
<li style="list-style-type: none;">
<ol class="wp-block-list">
<li>Controllino MICRO RS485 <strong>.uf2</strong> <a href="https://github.com/CONTROLLINO-PLC/micro_embedded_web/releases/download/global/web_micro_rs485.uf2">https://github.com/CONTROLLINO-PLC/micro_embedded_web/releases/download/global/web_micro_rs485.uf2</a></li>
<li>Controllino MICRO CAN <strong>.uf2</strong><a href=" https://github.com/CONTROLLINO-PLC/micro_embedded_web/releases/download/global/web_micro_can.uf2"> https://github.com/CONTROLLINO-PLC/micro_embedded_web/releases/download/global/web_micro_can.uf2</a></li>
</ol>
</li>
</ol>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ol class="wp-block-list">
<li style="list-style-type: none;"> </li>
</ol>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --><!-- wp:list --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li><strong>Upload firmware</strong></li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --><!-- wp:paragraph --></p>
<p>For easy installation first it is necessary to put the device in bootloader mode, to do this:</p>
<p><!-- /wp:paragraph --><!-- wp:list {"ordered":true} --></p>
<ol class="wp-block-list">
<li style="list-style-type: none;">
<ol class="wp-block-list"><!-- wp:list-item --></ol>
</li>
</ol>
<ol class="wp-block-list">
<li style="list-style-type: none;">
<ol class="wp-block-list">
<li>First method: Without external power press the boot button while connecting the USB cable, and then release the button.</li>
<li>Second method: Press both boot and reset buttons at the same time, then release the reset button and finally release the boot button.</li>
</ol>
</li>
</ol>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ol class="wp-block-list">
<li style="list-style-type: none;"> </li>
</ol>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --><!-- wp:paragraph --></p>
<p>The board will appear as a mass storage device, copy then the <strong>.uf2</strong> file to the device, it will reboot and start the web server</p>
<p><!-- /wp:paragraph --><!-- wp:list --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li><strong>Connect to the web server</strong></li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --><!-- wp:paragraph --></p>
<p>The default IP address is <strong>10.22.1.184</strong> and the default user and password are <strong>admin</strong> and <strong>admin</strong> respectively so just open a browser and go to <a href="http://10.22.1.184/">http://10.22.1.184/</a> to access the web server. Enjoy!</p>
<p><!-- /wp:paragraph --><!-- wp:heading {"level":3} --></p>
<h3 class="wp-block-heading">OTA(Over Ethernet) Firmware update</h3>
<p><!-- /wp:heading --><!-- wp:gallery {"linkTo":"none"} --></p>
<figure class="wp-block-gallery has-nested-images columns-default is-cropped"><!-- wp:image {"id":17513,"sizeSlug":"large","linkDestination":"none"} -->
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" class="wp-image-17513  alignnone" src="https://www.controllino.com/wp-content/uploads/2024/12/firmware_update.png" alt="" width="449" height="143" srcset="https://www.controllino.com/wp-content/uploads/2024/12/firmware_update.png 1022w, https://www.controllino.com/wp-content/uploads/2024/12/firmware_update-300x95.png 300w, https://www.controllino.com/wp-content/uploads/2024/12/firmware_update-768x244.png 768w" sizes="auto, (max-width: 449px) 100vw, 449px" /></figure>
<p><!-- /wp:image --></p>
</figure>
<p><!-- /wp:gallery --><!-- wp:paragraph --></p>
<p> </p>
<p>In the tap <strong>FIRMWARE UPDATE</strong> you can update the firmware using the OTA feature.</p>
<p><!-- /wp:paragraph --><!-- wp:list {"ordered":true} --></p>
<ol class="wp-block-list">
<li style="list-style-type: none;">
<ol class="wp-block-list"><!-- wp:list-item --></ol>
</li>
</ol>
<ol class="wp-block-list">
<li style="list-style-type: none;">
<ol class="wp-block-list">
<li>The firmware update process begin by uploading a new .bin firmware file on <strong>UPLOAD NEW FIRMWARE: CHOOSE .BIN FILE</strong> button, after uploaded the status of this current firmware will be <strong>MG_OTA_UNCOMMITTED</strong>.</li>
<li>To mark the uploaded firmware to be applied in the next reboot <strong>COMMIT THIS FIRMWARE</strong> button must be pressed, the status will change to <strong>MG_OTA_COMMITTED</strong>.</li>
<li>After the next reboot for example by pressing the <strong>REBOOT DEVICE</strong> button the firmware will be updated and the status will change to <strong>MG_OTA_FIRST_BOOT</strong>.</li>
<li>On the next reboot the current firmware will be saved as previous firmware with the status <strong>MG_OTA_COMMITTED</strong> and the current firmware info will be reseted. At any point you can come back to this old firmware by pressing the <strong>ROLLBACK TO THIS FIRMWARE</strong> button, except if a new firmware goes through all the process.</li>
<li>When pressing the <strong>ROLLBACK TO THIS FIRMWARE</strong> button the board will reboot and apply the previous firmware kepping previous firmware info.</li>
</ol>
</li>
</ol>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ol class="wp-block-list">
<li style="list-style-type: none;"> </li>
</ol>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ol class="wp-block-list">
<li style="list-style-type: none;"> </li>
</ol>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ol class="wp-block-list">
<li style="list-style-type: none;"> </li>
</ol>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ol class="wp-block-list">
<li style="list-style-type: none;"> </li>
</ol>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --><!-- wp:paragraph --></p>
<p><strong>Here there are some .bin files to test the OTA feature:</strong></p>
<p><!-- /wp:paragraph --><!-- wp:list --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>Controllino MICRO RS485:<!-- wp:list --><br />
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>User led blink 1s <a href="https://github.com/CONTROLLINO-PLC/micro_embedded_web/releases/download/global/web_micro_rs485_blink_1s.bin">https://github.com/CONTROLLINO-PLC/micro_embedded_web/releases/download/global/web_micro_rs485_blink_1s.bin</a></li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>Normal no user led blink <a href="https://github.com/CONTROLLINO-PLC/micro_embedded_web/releases/download/global/web_micro_rs485.bin">https://github.com/CONTROLLINO-PLC/micro_embedded_web/releases/download/global/web_micro_rs485.bin</a></li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --></p>
</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>Controllino MICRO CAN:<!-- wp:list --><br />
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>User led blink 1s <a href="https://github.com/CONTROLLINO-PLC/micro_embedded_web/releases/download/global/web_micro_can_blink_1s.bin">https://github.com/CONTROLLINO-PLC/micro_embedded_web/releases/download/global/web_micro_can_blink_1s.bin</a></li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>Normal no user led blink <a href="https://github.com/CONTROLLINO-PLC/micro_embedded_web/releases/download/global/web_micro_can.bin">https://github.com/CONTROLLINO-PLC/micro_embedded_web/releases/download/global/web_micro_can.bin</a></li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --></p>
</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --><!-- wp:heading {"level":3} --></p>
<h3 class="wp-block-heading">Tools and technologies used</h3>
<p><!-- /wp:heading --><!-- wp:list --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>PlatformIO to manage the project and build the firmware.</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>Mongoose web server as core to genrate the web server app.</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>React js to develop the web app.</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --><!-- wp:heading {"level":3} --></p>
<h3 class="wp-block-heading">Internal and external dependencies description</h3>
<p><!-- /wp:heading --><!-- wp:list --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>From <a href="https://github.com/CONTROLLINO-PLC/controllino_rp2040_firmware">controllino_rp2040_firmmware</a><!-- wp:list --><br />
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>SPI library <a href="https://github.com/CONTROLLINO-PLC/controllino_micro_embedded_web/blob/master/lib/SPI">lib/SPI</a> until internal the SPI code for the internal MICRO components works good with the new SPI library version on Arduino-Pico.</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>CAN modified version of Arduino CAN library (MCP2515) <a href="https://github.com/CONTROLLINO-PLC/controllino_micro_embedded_web/blob/master/lib/arduino_can">lib/arduino_can</a> original library <a href="https://github.com/sandeepmistry/arduino-CAN">here</a></li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>Controllino MICRO variant firmware <a href="https://github.com/CONTROLLINO-PLC/controllino_micro_embedded_web/blob/master/lib/controllino_micro">lib/controllino_micro</a></li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --></p>
</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>From Arduino-Pico <a href="https://github.com/earlephilhower/arduino-pico">https://github.com/earlephilhower/arduino-pico</a> OTA related libraries<!-- wp:list --><br />
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>LittleFS <a href="https://github.com/CONTROLLINO-PLC/controllino_micro_embedded_web/blob/master/lib/LittleFS">lib/LittleFS</a></li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>PicoOTA <a href="https://github.com/CONTROLLINO-PLC/controllino_micro_embedded_web/blob/master/lib/PicoOTA">lib/PicoOTA</a></li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>Updater <a href="https://github.com/CONTROLLINO-PLC/controllino_micro_embedded_web/blob/master/lib/Updater">lib/Updater</a></li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>MD5Builder <a href="https://github.com/CONTROLLINO-PLC/controllino_micro_embedded_web/blob/master/lib/MD5Builder">lib/MD5Builder</a></li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --></p>
</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>Mongoose OTA and device port for Arduino-Pico <a href="https://github.com/CONTROLLINO-PLC/controllino_micro_embedded_web/blob/master/lib/mongoose_arduino_pico">lib/mongoose_arduino_pico</a></li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>Mongoose web server application <a href="https://github.com/CONTROLLINO-PLC/controllino_micro_embedded_web/blob/master/lib/webapp">lib/webapp</a> based on device dashboard example</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>External dependencies installed with PlatformIO see <a href="https://github.com/CONTROLLINO-PLC/controllino_micro_embedded_web/blob/master/platformio.ini">platformio.ini</a><!-- wp:list --><br />
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>ArduinoJson</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>ArduinoRS485</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --></p>
</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --><!-- wp:heading {"level":3} --></p>
<h3 class="wp-block-heading">Web development project</h3>
<p><!-- /wp:heading --><!-- wp:paragraph --></p>
<p>Developed on react js uses also gulp to automate some parts of the build process, trying to generate the minimal weight app to embed in the microcontroller.</p>
<p><!-- /wp:paragraph --><!-- wp:paragraph --></p>
<p>On PlatformIO build <a href="https://github.com/CONTROLLINO-PLC/controllino_micro_embedded_web/blob/master/build_web.py">build_web.py</a> script is executed to build the web app into <a href="https://github.com/CONTROLLINO-PLC/controllino_micro_embedded_web/blob/master/lib/webapp/packed_fs.c">lib/webapp/packed_fs.c</a> source file that later is compiled with the firmware.</p>
<p><!-- /wp:paragraph --><!-- wp:heading {"level":3} --></p>
<h3 class="wp-block-heading">Requirements</h3>
<p><!-- /wp:heading --><!-- wp:paragraph --></p>
<p><!-- /wp:paragraph --><!-- wp:list --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>node v18.x.x</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>npm v8.x.x</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>react v18.x.x</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>Python 3.x.x</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --><!-- wp:heading {"level":3} --></p>
<h3 class="wp-block-heading">Manual setup for web development</h3>
<p><!-- /wp:heading --><!-- wp:kevinbatdorf/code-block-pro {"code":"cd webdev","codeHTML":"\u003cpre class=\u0022shiki nord\u0022 style=\u0022background-color: #2e3440ff\u0022 tabindex=\u00220\u0022\u003e\u003ccode\u003e\u003cspan class=\u0022line\u0022\u003e\u003cspan style=\u0022color: #D8DEE9\u0022\u003ecd\u003c/span\u003e\u003cspan style=\u0022color: #D8DEE9FF\u0022\u003e \u003c/span\u003e\u003cspan style=\u0022color: #D8DEE9\u0022\u003ewebdev\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e","language":"javascript","theme":"nord","bgColor":"#2e3440ff","textColor":"#d8dee9ff","fontSize":".875rem","fontFamily":"Code-Pro-JetBrains-Mono","lineHeight":"1.25rem","clampFonts":false,"lineNumbers":false,"headerType":"headlights","disablePadding":false,"footerType":"none","seeMoreType":"","seeMoreString":"","seeMoreTransition":false,"highlightingHover":false,"lineHighlightColor":"rgba(201, 218, 248, 0.2)","copyButton":true,"copyButtonType":"heroicons","useTabs":false} --></p>
<div class="wp-block-kevinbatdorf-code-block-pro" style="font-size: .875rem; font-family: Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace; line-height: 1.25rem; --cbp-tab-width: 2; tab-size: var(--cbp-tab-width, 2);" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono">
<pre class="shiki nord" style="background-color: #2e3440ff;" tabindex="0"><code><span class="line"><span style="color: #d8dee9;">cd</span> <span style="color: #d8dee9;">webdev</span></span></code></pre>
</div>
<p><!-- /wp:kevinbatdorf/code-block-pro --><!-- wp:kevinbatdorf/code-block-pro {"code":"npm install","codeHTML":"\u003cpre class=\u0022shiki nord\u0022 style=\u0022background-color: #2e3440ff\u0022 tabindex=\u00220\u0022\u003e\u003ccode\u003e\u003cspan class=\u0022line\u0022\u003e\u003cspan style=\u0022color: #D8DEE9\u0022\u003enpm\u003c/span\u003e\u003cspan style=\u0022color: #D8DEE9FF\u0022\u003e \u003c/span\u003e\u003cspan style=\u0022color: #D8DEE9\u0022\u003einstall\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e","language":"javascript","theme":"nord","bgColor":"#2e3440ff","textColor":"#d8dee9ff","fontSize":".875rem","fontFamily":"Code-Pro-JetBrains-Mono","lineHeight":"1.25rem","clampFonts":false,"lineNumbers":false,"headerType":"headlights","disablePadding":false,"footerType":"none","seeMoreType":"","seeMoreString":"","seeMoreTransition":false,"highlightingHover":false,"lineHighlightColor":"rgba(201, 218, 248, 0.2)","copyButton":true,"copyButtonType":"heroicons","useTabs":false} --></p>
<div class="wp-block-kevinbatdorf-code-block-pro" style="font-size: .875rem; font-family: Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace; line-height: 1.25rem; --cbp-tab-width: 2; tab-size: var(--cbp-tab-width, 2);" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono">
<pre class="shiki nord" style="background-color: #2e3440ff;" tabindex="0"><code><span class="line"><span style="color: #d8dee9;">npm</span> <span style="color: #d8dee9;">install</span></span></code></pre>
</div>
<p><!-- /wp:kevinbatdorf/code-block-pro --><!-- wp:heading {"level":3} --></p>
<h3 class="wp-block-heading">Start development server</h3>
<p><!-- /wp:heading --><!-- wp:kevinbatdorf/code-block-pro {"code":"npm run dev","codeHTML":"\u003cpre class=\u0022shiki nord\u0022 style=\u0022background-color: #2e3440ff\u0022 tabindex=\u00220\u0022\u003e\u003ccode\u003e\u003cspan class=\u0022line\u0022\u003e\u003cspan style=\u0022color: #D8DEE9\u0022\u003enpm\u003c/span\u003e\u003cspan style=\u0022color: #D8DEE9FF\u0022\u003e \u003c/span\u003e\u003cspan style=\u0022color: #D8DEE9\u0022\u003erun\u003c/span\u003e\u003cspan style=\u0022color: #D8DEE9FF\u0022\u003e \u003c/span\u003e\u003cspan style=\u0022color: #D8DEE9\u0022\u003edev\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e","language":"javascript","theme":"nord","bgColor":"#2e3440ff","textColor":"#d8dee9ff","fontSize":".875rem","fontFamily":"Code-Pro-JetBrains-Mono","lineHeight":"1.25rem","clampFonts":false,"lineNumbers":false,"headerType":"headlights","disablePadding":false,"footerType":"none","seeMoreType":"","seeMoreString":"","seeMoreTransition":false,"highlightingHover":false,"lineHighlightColor":"rgba(201, 218, 248, 0.2)","copyButton":true,"copyButtonType":"heroicons","useTabs":false} --></p>
<div class="wp-block-kevinbatdorf-code-block-pro" style="font-size: .875rem; font-family: Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace; line-height: 1.25rem; --cbp-tab-width: 2; tab-size: var(--cbp-tab-width, 2);" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono">
<pre class="shiki nord" style="background-color: #2e3440ff;" tabindex="0"><code><span class="line"><span style="color: #d8dee9;">npm</span> <span style="color: #d8dee9;">run</span> <span style="color: #d8dee9;">dev</span></span></code></pre>
</div>
<p><!-- /wp:kevinbatdorf/code-block-pro --><!-- wp:heading {"level":3} --></p>
<h3 class="wp-block-heading">React project description</h3>
<p><!-- /wp:heading --><!-- wp:list --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li><strong>Login<!-- wp:list --></strong><br />
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>Description: Component to get access to the dashboard using user credentials.</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>ubication: <a href="https://github.com/CONTROLLINO-PLC/controllino_micro_embedded_web/blob/master/webdev/src/components/Login.jsx">webdev/src/components/Login.jsx</a></li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>used in:<!-- wp:list --><br />
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>App</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --></p>
</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --></p>
</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li><strong>Home<!-- wp:list --></strong><br />
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>description: Display all main screen components</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>ubication: <a href="https://github.com/CONTROLLINO-PLC/controllino_micro_embedded_web/blob/master/webdev/src/components/Home.jsx">webdev/src/components/Home.jsx</a></li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>used in:<!-- wp:list --><br />
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>App</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --></p>
</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --></p>
</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li><strong>Navbar<!-- wp:list --></strong><br />
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>description: Header of the web app and render some features as logout</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>ubication: <a href="https://github.com/CONTROLLINO-PLC/controllino_micro_embedded_web/blob/master/webdev/src/components/Navbar.jsx">webdev/src/components/Navbar.jsx</a></li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>used in:<!-- wp:list --><br />
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>Home</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --></p>
</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --></p>
</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li><strong>FormComms<!-- wp:list --></strong><br />
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>description: Form to manage the network configuration</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>ubication: <a href="https://github.com/CONTROLLINO-PLC/controllino_micro_embedded_web/blob/master/webdev/src/components/FormComms.jsx">webdev/src/components/FormComms.jsx</a></li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>used in:<!-- wp:list --><br />
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>Home</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --></p>
</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --></p>
</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li><strong>FormBoard<!-- wp:list --></strong><br />
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>description: Main form to manage the board</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>ubication: <a href="https://github.com/CONTROLLINO-PLC/controllino_micro_embedded_web/blob/master/webdev/src/components/FormBoard.jsx">webdev/src/components/FormBoard.jsx</a></li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>used in:<!-- wp:list --><br />
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>Home</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --></p>
</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --></p>
</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li><strong>Inputs, Outputs and ComComponent</strong><!-- wp:list --><br />
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>description: Actuate and configure inputs, outputs and serial comunications</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>ubication:<!-- wp:list --><br />
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li><a href="https://github.com/CONTROLLINO-PLC/controllino_micro_embedded_web/blob/master/webdev/src/components/comComponen.jsx">webdev/src/components/comComponen.jsx</a></li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li><a href="https://github.com/CONTROLLINO-PLC/controllino_micro_embedded_web/blob/master/webdev/src/components/Inputs.jsx">webdev/src/components/Inputs.jsx</a></li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li><a href="https://github.com/CONTROLLINO-PLC/controllino_micro_embedded_web/blob/master/webdev/src/components/Outputs.jsx">webdev/src/components/Outputs.jsx</a></li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --></p>
</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>used in:<!-- wp:list --><br />
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>FormBoard</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --></p>
</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --></p>
</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li><strong>ItemContainer<!-- wp:list --></strong><br />
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>description: Container to display inputs, outputs and serial comunications</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>ubication: <a href="https://github.com/CONTROLLINO-PLC/controllino_micro_embedded_web/blob/master/webdev/src/components/ItemContainer.jsx">webdev/src/components/ItemContainer.jsx</a></li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>used in:<!-- wp:list --><br />
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>Inputs</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>Outputs</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>ComComponent</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --></p>
</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --></p>
</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li><strong>LedInput, LedOutput and NetworkLeds</strong><!-- wp:list --><br />
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>description: Component to visually display network activity and digital states of inputs and outputs</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>ubication:<!-- wp:list --><br />
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li><a href="https://github.com/CONTROLLINO-PLC/controllino_micro_embedded_web/blob/master/webdev/src/components/LedInputs.jsx">webdev/src/components/LedInputs.jsx</a></li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li><a href="https://github.com/CONTROLLINO-PLC/controllino_micro_embedded_web/blob/master/webdev/src/components/LedOutput.jsx">webdev/src/components/LedOutput.jsx</a></li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li><a href="https://github.com/CONTROLLINO-PLC/controllino_micro_embedded_web/blob/master/webdev/src/components/networkLeds.jsx">webdev/src/components/networkLeds.jsx</a></li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --></p>
</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>used in:<!-- wp:list --><br />
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>FormBoard</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --></p>
</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --></p>
</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li><strong>TmcuCard, TsensorCard and VsupplyCard</strong><!-- wp:list --><br />
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>description: Card like component to monitor certain internal variables</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>ubication:<!-- wp:list --><br />
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li><a href="https://github.com/CONTROLLINO-PLC/controllino_micro_embedded_web/blob/master/webdev/src/components/TmcuCard.jsx">webdev/src/components/TmcuCard.jsx</a></li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li><a href="https://github.com/CONTROLLINO-PLC/controllino_micro_embedded_web/blob/master/webdev/src/components/TsensorCard.jsx">webdev/src/components/TsensorCard.jsx</a></li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li><a href="https://github.com/CONTROLLINO-PLC/controllino_micro_embedded_web/blob/master/webdev/src/components/VsuplyCard.jsx">webdev/src/components/VsupplyCard.jsx</a></li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --></p>
</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --><!-- wp:list-item --></p>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>used in:<!-- wp:list --><br />
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list"><!-- wp:list-item --></ul>
</li>
</ul>
<ul class="wp-block-list">
<li style="list-style-type: none;">
<ul class="wp-block-list">
<li>Home</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --></p>
</li>
</ul>
</li>
</ul>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --></p>
</li>
</ul>
</li>
</ul>
<h3> </h3>
<h3 class="wp-block-heading">Conclusions</h3>
<p class="p3">1.<b>Ease of Use and Installation</b><b></b></p>
<p class="p4">This project offers a simple and quick approach to testing the functionalities of the Controllino MICRO through an embedded web server accessible from any browser, eliminating the need for complex configurations or external tools.</p>
<p class="p3">2.<b>Intuitive OTA Updates</b><b></b></p>
<p class="p4">The implementation of the OTA firmware update system ensures an efficient workflow for keeping the device up to date, allowing testing, rollback, and management of firmware versions in a reliable and user-friendly manner.</p>
<p class="p3">3.<b>Integration of Modern Tools</b><b></b></p>
<p class="p4">Combining technologies such as PlatformIO, React, and Mongoose demonstrates a commitment to modern and efficient development, ensuring optimal performance for both the firmware and the web application.</p>
<p class="p3">4.<b>Flexibility and Customization</b><b></b></p>
<p class="p4">Thanks to the modular structure of the project, developers can customize both the firmware and the web application according to their specific needs, using well-organized and documented components.</p>
<p class="p3">5.<b>Contribution to the Open-Source Community</b><b></b></p>
<p class="p4">By leveraging open-source dependencies and providing clear documentation, this project fosters collaboration and learning within the community, making it accessible and extensible for other developers.</p>
<p class="p3">6.<b>Solid Foundation for Future Developments</b><b></b></p>
<p class="p4">This project not only meets current needs for testing and configuring the Controllino MICRO but also lays a scalable foundation to integrate additional functionalities and extend its capabilities in the future.</p>
<p class="p3">7.<b>Educational and Professional Benefits</b><b></b></p>
<p class="p4">Combining hardware and software in this project makes it a valuable tool for both enthusiasts and professionals, facilitating understanding and experimentation with modern embedded technologies.</p>
<p> </p>
<p><!-- /wp:list-item --></p>
<p><!-- /wp:list --><!-- wp:paragraph --></p>
<p><!-- /wp:paragraph --></p>						</div>
				</div>
					</div>
		</div>
							</div>
		</section>
							</div>
		]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>OpenPLC Water Reserve Control</title>
		<link>https://www.controllino.com/water-reserve-control-system/</link>
		
		<dc:creator><![CDATA[CONTROLLINO]]></dc:creator>
		<pubDate>Sat, 30 Nov 2024 22:50:39 +0000</pubDate>
				<category><![CDATA[MAXI]]></category>
		<category><![CDATA[MEGA]]></category>
		<category><![CDATA[MINI]]></category>
		<category><![CDATA[OpenPLC]]></category>
		<category><![CDATA[Tutorials]]></category>
		<guid isPermaLink="false">https://www.controllino.com/?p=17463</guid>

					<description><![CDATA[Introduction This tutorial explains how to implement an automatic water reserve control system using a CONTROLLINO PLC and OpenPLC. The system monitors the water levels of a cistern (minimum level) and an elevated tank (minimum and maximum levels) to control a pump that transfers water from the cistern to the elevated tank. Additionally, manual pump [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Introduction</h2>



<p>This tutorial explains how to implement an automatic water reserve control system using a CONTROLLINO PLC and OpenPLC. The system monitors the water levels of a cistern (minimum level) and an elevated tank (minimum and maximum levels) to control a pump that transfers water from the cistern to the elevated tank. Additionally, manual pump control is possible using start and stop buttons.</p>



<h2 class="wp-block-heading">Prerequisites</h2>



<p>Before starting, ensure you have the following:</p>



<ul class="wp-block-list">
<li>OpenPLC software installed.</li>



<li>A CONTROLLINO PLC (any model) or a compatible PLC.</li>



<li>Sensors for water level detection:</li>



<li>Minimum level sensor for the cistern.</li>



<li>Minimum and maximum level sensors for the elevated tank.</li>



<li>Two buttons for manual control (Start and Stop).</li>



<li>Basic knowledge of ladder logic programming.</li>
</ul>



<h2 class="wp-block-heading">Step-by-Step Guide</h2>



<h3 class="wp-block-heading">Step 1: Install and Set Up OpenPLC</h3>



<ol class="wp-block-list">
<li><strong>Download OpenPLC</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Visit the <a href="https://www.openplcproject.com/">OpenPLC official website</a> and download the software.</li>



<li>Follow the installation instructions for your operating system.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Set Up the OpenPLC Environment</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Open the OpenPLC editor.</li>



<li>Configure the device by selecting your CONTROLLINO model in <strong>Settings &gt; Device</strong>.</li>



<li>Assign the correct COM port for communication with the PLC.</li>
</ul>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://github.com/CONTROLLINO-PLC/OpenPLC_examples/tree/master" target="_blank" rel="noreferrer noopener">Controllino&#8217;s OpenPLC repository</a></div>
</div>



<h3 class="wp-block-heading">Step 2: Configure System Inputs and Outputs</h3>



<p>Define the following inputs and outputs in your ladder logic program:</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Name</strong></th><th><strong>Type</strong></th><th><strong>Description</strong></th><th><strong>Pin</strong></th></tr></thead><tbody><tr><td><code>Pool_Low_Level_Sensor</code></td><td>BOOL</td><td>Indicates the minimum water level in the cistern.</td><td><code>%IX0.0</code></td></tr><tr><td><code>Tank_High_Level_Sensor</code></td><td>BOOL</td><td>Indicates the maximum water level in the tank.</td><td><code>%IX0.1</code></td></tr><tr><td><code>Tank_Low_Level_Sensor</code></td><td>BOOL</td><td>Indicates the minimum water level in the tank.</td><td><code>%IX0.2</code></td></tr><tr><td><code>Automatic_Manual_Switch</code></td><td>BOOL</td><td>Switch for selecting automatic or manual mode.</td><td><code>%IX0.3</code></td></tr><tr><td><code>Stop_Button</code></td><td>BOOL</td><td>Push button to stop the pump manually.</td><td><code>%IX0.4</code></td></tr><tr><td><code>Start_Button</code></td><td>BOOL</td><td>Push button to start the pump manually.</td><td><code>%IX0.5</code></td></tr><tr><td><code>Water_Pump</code></td><td>BOOL</td><td>Output controlling the water pump.</td><td><code>%QX0.0</code></td></tr></tbody></table></figure>



<h3 class="wp-block-heading">Step 3: Program the Ladder Logic</h3>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://github.com/CONTROLLINO-PLC/OpenPLC_examples/tree/master/water_control">Download OpenPLC project here</a></div>
</div>



<ol class="wp-block-list">
<li><strong>Automatic Mode</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>The pump (<code>Water_Pump</code>) is activated automatically when:
<ul class="wp-block-list">
<li>The cistern is above its minimum level (<code>Pool_Low_Level_Sensor</code> is active).</li>



<li>The tank is below its minimum level (<code>Tank_Low_Level_Sensor</code> is active).</li>
</ul>
</li>



<li>The pump is deactivated when:
<ul class="wp-block-list">
<li>The tank reaches its maximum level (<code>Tank_High_Level_Sensor</code> is active).</li>



<li>The cistern falls below its minimum level (<code>Pool_Low_Level_Sensor</code> is inactive).</li>
</ul>
</li>
</ul>



<ol class="wp-block-list">
<li><strong>Manual Mode</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>The pump can be directly controlled using the buttons:
<ul class="wp-block-list">
<li>The Start Button (<code>Start_Button</code>) activates the pump.</li>



<li>The Stop Button (<code>Stop_Button</code>) deactivates the pump.</li>
</ul>
</li>



<li>The switch (<code>Automatic_Manual_Switch</code>) must be in manual mode to enable this functionality.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Switching Between Modes</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>The <code>Automatic_Manual_Switch</code> toggles between automatic and manual modes.</li>



<li>In manual mode, sensor readings do not affect the pump operation.</li>
</ul>



<h3 class="wp-block-heading">Step 4: Connect the Hardware</h3>



<ol class="wp-block-list">
<li><strong>Wiring</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Connect the level sensors to the respective input pins.</li>



<li>Connect the Start and Stop buttons to other input pins.</li>



<li>Connect the water pump to the assigned output pin.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Pin Mapping</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Ensure that the variable names in OpenPLC match the physical connections.</li>
</ul>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="766" src="https://www.controllino.com/wp-content/uploads/2024/11/Esquema-de-conexion-1024x766.png" alt="" class="wp-image-17482" srcset="https://www.controllino.com/wp-content/uploads/2024/11/Esquema-de-conexion-1024x766.png 1024w, https://www.controllino.com/wp-content/uploads/2024/11/Esquema-de-conexion-300x225.png 300w, https://www.controllino.com/wp-content/uploads/2024/11/Esquema-de-conexion-768x575.png 768w, https://www.controllino.com/wp-content/uploads/2024/11/Esquema-de-conexion-1200x898.png 1200w, https://www.controllino.com/wp-content/uploads/2024/11/Esquema-de-conexion.png 1526w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h3 class="wp-block-heading">Step 5: Test the System</h3>



<ol class="wp-block-list">
<li><strong>Load the Program</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Save your project in the OpenPLC editor.</li>



<li>Connect your CONTROLLINO PLC to the computer and upload the program.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Test Automatic Mode</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Ensure the cistern is above its minimum level.</li>



<li>Lower the water level in the tank below its minimum.</li>



<li>Observe how the pump automatically activates and fills the tank until it reaches the maximum level.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Test Manual Mode</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Switch to manual mode using the <code>Automatic_Manual_Switch</code>.</li>



<li>Press the Start Button to activate the pump and the Stop Button to deactivate it.</li>
</ul>



<h2 class="wp-block-heading">Ladder Logic Explanation</h2>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="602" src="https://www.controllino.com/wp-content/uploads/2024/11/OpenPLC-program-1024x602.jpg" alt="" class="wp-image-17484" srcset="https://www.controllino.com/wp-content/uploads/2024/11/OpenPLC-program-1024x602.jpg 1024w, https://www.controllino.com/wp-content/uploads/2024/11/OpenPLC-program-300x176.jpg 300w, https://www.controllino.com/wp-content/uploads/2024/11/OpenPLC-program-768x451.jpg 768w, https://www.controllino.com/wp-content/uploads/2024/11/OpenPLC-program-1536x902.jpg 1536w, https://www.controllino.com/wp-content/uploads/2024/11/OpenPLC-program-1200x705.jpg 1200w, https://www.controllino.com/wp-content/uploads/2024/11/OpenPLC-program.jpg 1920w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h3 class="wp-block-heading">Automatic Mode</h3>



<ol class="wp-block-list">
<li><strong>Automatic Activation</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>When both <code>Pool_Low_Level_Sensor</code> and <code>Tank_Low_Level_Sensor</code> are active, the pump (<code>Water_Pump</code>) turns on.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Automatic Deactivation</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>The pump turns off when either:
<ul class="wp-block-list">
<li><code>Tank_High_Level_Sensor</code> is active (tank full).</li>



<li><code>Pool_Low_Level_Sensor</code> is inactive (cistern empty).</li>
</ul>
</li>
</ul>



<h3 class="wp-block-heading">Manual Mode</h3>



<ol class="wp-block-list">
<li><strong>Manual Control</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Pressing <code>Start_Button</code> turns on the pump manually.</li>



<li>Pressing <code>Stop_Button</code> turns off the pump manually.</li>
</ul>



<h2 class="wp-block-heading">Troubleshooting</h2>



<ol class="wp-block-list">
<li><strong>Check Wiring</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Ensure sensors and buttons are connected to the correct input pins.</li>



<li>Verify the pump is connected to the correct output pin.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Verify Variables</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Check that the variable names in OpenPLC match the physical connections.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Debugging</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Use the OpenPLC debugging tools to monitor the state of inputs, outputs, and signals.</li>
</ul>



<h2 class="wp-block-heading">Conclusion</h2>



<p>Congratulations! You have successfully implemented a water reserve control system with both automatic and manual modes. This system is ideal for efficiently managing water levels in elevated tanks and cisterns. You can further customize the system by adding additional sensors or modifying the logic to suit specific requirements.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>OpenPLC Staircase Light Control</title>
		<link>https://www.controllino.com/openplc-staircase-light-control-tutorial/</link>
		
		<dc:creator><![CDATA[CONTROLLINO]]></dc:creator>
		<pubDate>Sat, 30 Nov 2024 22:46:34 +0000</pubDate>
				<category><![CDATA[MAXI]]></category>
		<category><![CDATA[MEGA]]></category>
		<category><![CDATA[MINI]]></category>
		<category><![CDATA[OpenPLC]]></category>
		<category><![CDATA[Tutorials]]></category>
		<guid isPermaLink="false">https://www.controllino.com/?p=17461</guid>

					<description><![CDATA[Introduction This tutorial demonstrates how to create an automatic staircase lighting system using OpenPLC and a CONTROLLINO PLC. The system uses two push buttons for manual control and a PIR sensor for automatic activation. The light toggles manually with button presses or turns on automatically when motion is detected, staying on for 20 seconds before [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h1 class="wp-block-heading">Introduction</h1>



<p>This tutorial demonstrates how to create an automatic staircase lighting system using OpenPLC and a CONTROLLINO PLC. The system uses two push buttons for manual control and a PIR sensor for automatic activation. The light toggles manually with button presses or turns on automatically when motion is detected, staying on for 20 seconds before turning off if no further motion occurs.</p>



<h2 class="wp-block-heading">Prerequisites</h2>



<p>Before you begin, ensure you have the following:</p>



<ul class="wp-block-list">
<li>OpenPLC software installed.</li>



<li>A CONTROLLINO PLC (any model) or compatible PLC.</li>



<li>A Passive Infrared (PIR) motion sensor.</li>



<li>Two push buttons (for manual control).</li>



<li>Basic knowledge of ladder logic programming.</li>
</ul>



<h2 class="wp-block-heading">Step-by-Step Guide</h2>



<h3 class="wp-block-heading">Step 1: Install and Configure OpenPLC</h3>



<ol class="wp-block-list">
<li><strong>Download OpenPLC</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Visit the <a href="https://www.openplcproject.com/">OpenPLC website</a> and download the software.</li>



<li>Follow the installation instructions for your operating system.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Set Up the OpenPLC Environment</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Open the OpenPLC Editor.</li>



<li>Configure the environment for your CONTROLLINO PLC by selecting the correct model in <strong>Settings &gt; Device</strong>.</li>



<li>Assign the appropriate COM port for communication.</li>
</ul>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://github.com/CONTROLLINO-PLC/OpenPLC_examples/tree/master">Controllino&#8217;s OpenPLC repository</a></div>
</div>



<h3 class="wp-block-heading">Step 2: Define System Inputs and Outputs</h3>



<p>Configure the following inputs and outputs in your ladder logic program:</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Name</th><th>Type</th><th>Description</th><th>Pin</th></tr></thead><tbody><tr><td><code>stairs_pir_sensor</code></td><td>BOOL</td><td>Input from the PIR motion sensor.</td><td><code>%IX0.0</code></td></tr><tr><td><code>control_button_down</code></td><td>BOOL</td><td>Input from the downstairs push button.</td><td><code>%IX0.1</code></td></tr><tr><td><code>control_button_up</code></td><td>BOOL</td><td>Input from the upstairs push button.</td><td><code>%IX0.2</code></td></tr><tr><td><code>stairs_light</code></td><td>BOOL</td><td>Output to control the staircase light.</td><td><code>%QX0.0</code></td></tr></tbody></table></figure>



<p><strong>Timers</strong>:</p>



<ul class="wp-block-list">
<li><code>TOF0</code> (Off Delay Timer): Controls the light timeout after motion detection.</li>



<li>Duration: <code>T#20s</code>.</li>
</ul>



<h3 class="wp-block-heading">Step 3: Create the Ladder Logic Program</h3>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://github.com/CONTROLLINO-PLC/OpenPLC_examples/tree/master/stairs_light_control">Download OpenPLC project here</a></div>
</div>



<ol class="wp-block-list">
<li><strong>Manual Light Control</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>When either <code>control_button_down</code> or <code>control_button_up</code> is pressed, the <code>lights_buttons_state</code> toggles the <code>stairs_light</code>.</li>



<li>This allows manual on/off control of the staircase light.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Automatic Light Control</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>When the <code>stairs_pir_sensor</code> detects motion, it activates the timer <code>TOF0</code>.</li>



<li>The light (<code>stairs_light</code>) remains on while the timer is active or as long as motion is detected.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Light Timeout</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>When no motion is detected for 20 seconds, the <code>TOF0</code> timer deactivates.</li>



<li>The light turns off automatically unless toggled manually.</li>
</ul>



<h3 class="wp-block-heading">Step 4: Connect the Hardware</h3>



<ol class="wp-block-list">
<li><strong>Wiring</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Connect the PIR sensor output to a digital input pin (e.g., <code>DI0</code>).</li>



<li>Connect the downstairs push button to another input pin (e.g., <code>DI1</code>).</li>



<li>Connect the upstairs push button to a separate input pin (e.g., <code>DI2</code>).</li>



<li>Connect the staircase light to a digital output pin (e.g., <code>DO0</code>).</li>
</ul>



<ol class="wp-block-list">
<li><strong>Pin Mapping</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Assign the corresponding input and output variables in OpenPLC:
<ul class="wp-block-list">
<li><code>stairs_pir_sensor</code> → <code>%IX0.0</code></li>



<li><code>control_button_down</code> → <code>%IX0.1</code></li>



<li><code>control_button_up</code> → <code>%IX0.2</code></li>



<li><code>stairs_light</code> → <code>%QX0.0</code></li>
</ul>
</li>
</ul>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="765" src="https://www.controllino.com/wp-content/uploads/2024/11/Electric-diagram-1024x765.png" alt="" class="wp-image-17488" srcset="https://www.controllino.com/wp-content/uploads/2024/11/Electric-diagram-1024x765.png 1024w, https://www.controllino.com/wp-content/uploads/2024/11/Electric-diagram-300x224.png 300w, https://www.controllino.com/wp-content/uploads/2024/11/Electric-diagram-768x573.png 768w, https://www.controllino.com/wp-content/uploads/2024/11/Electric-diagram-1200x896.png 1200w, https://www.controllino.com/wp-content/uploads/2024/11/Electric-diagram.png 1334w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h3 class="wp-block-heading">Step 5: Load and Test the Program</h3>



<ol class="wp-block-list">
<li><strong>Upload the Program</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Save your ladder logic project in the OpenPLC Editor.</li>



<li>Connect your CONTROLLINO PLC to your computer and upload the program.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Test Manual Light Control</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Press the upstairs (<code>control_button_up</code>) or downstairs (<code>control_button_down</code>) push button.</li>



<li>Confirm that the light toggles on and off with each press.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Test Automatic Light Control</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Walk near the PIR sensor to simulate motion detection.</li>



<li>Observe the light turning on and staying active for 20 seconds after the motion stops.</li>



<li>Ensure the light turns off automatically after the timer expires.</li>
</ul>



<h3 class="wp-block-heading">Ladder Logic Explanation (Detailed)</h3>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="676" src="https://www.controllino.com/wp-content/uploads/2024/11/OpenPLC-program-1-1024x676.jpg" alt="" class="wp-image-17490" srcset="https://www.controllino.com/wp-content/uploads/2024/11/OpenPLC-program-1-1024x676.jpg 1024w, https://www.controllino.com/wp-content/uploads/2024/11/OpenPLC-program-1-300x198.jpg 300w, https://www.controllino.com/wp-content/uploads/2024/11/OpenPLC-program-1-768x507.jpg 768w, https://www.controllino.com/wp-content/uploads/2024/11/OpenPLC-program-1-1536x1014.jpg 1536w, https://www.controllino.com/wp-content/uploads/2024/11/OpenPLC-program-1-1200x792.jpg 1200w, https://www.controllino.com/wp-content/uploads/2024/11/OpenPLC-program-1.jpg 1920w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h4 class="wp-block-heading">Manual Light Control</h4>



<ol class="wp-block-list">
<li><strong>Toggling the Light</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Each button press (<code>control_button_up</code> or <code>control_button_down</code>) changes the state of <code>lights_buttons_state</code>.</li>



<li>The state of <code>lights_buttons_state</code> determines whether <code>stairs_light</code> is turned on or off.</li>
</ul>



<h4 class="wp-block-heading">Automatic Light Control</h4>



<ol class="wp-block-list">
<li><strong>PIR Sensor Activation</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>When the <code>stairs_pir_sensor</code> detects motion, the timer <code>TOF0</code> starts.</li>



<li>The <code>stairs_light</code> remains on while motion is detected or while the timer is active.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Light Timeout</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>The <code>TOF0</code> timer turns off the light 20 seconds after the PIR sensor stops detecting motion.</li>
</ul>



<h4 class="wp-block-heading">Combining Manual and Automatic Control</h4>



<ul class="wp-block-list">
<li>The light can be manually toggled on or off at any time using the push buttons.</li>



<li>Automatic activation by the PIR sensor operates independently, ensuring flexibility.</li>
</ul>



<h3 class="wp-block-heading">Troubleshooting</h3>



<ol class="wp-block-list">
<li><strong>Verify Wiring</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Ensure all sensors and buttons are correctly connected to the appropriate input pins.</li>



<li>Confirm the light is connected to the correct output pin.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Check Variable Assignments</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Double-check that the input and output variables in OpenPLC match your physical connections.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Debugging</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Use the OpenPLC debugging tools to monitor the state of variables and timers.</li>
</ul>



<h3 class="wp-block-heading">Conclusion</h3>



<p>Congratulations! You have successfully implemented an automatic staircase lighting system using OpenPLC and a CONTROLLINO PLC. This system combines manual and automatic control for optimal flexibility and convenience. Experiment with different timer durations or additional sensors to customize the system further.</p>



<p></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>OpenPLC Light Intensity Control</title>
		<link>https://www.controllino.com/pwm-light-intensity-control-system-tutorial/</link>
		
		<dc:creator><![CDATA[CONTROLLINO]]></dc:creator>
		<pubDate>Sat, 30 Nov 2024 22:40:52 +0000</pubDate>
				<category><![CDATA[MAXI]]></category>
		<category><![CDATA[MEGA]]></category>
		<category><![CDATA[MICRO]]></category>
		<category><![CDATA[MINI]]></category>
		<category><![CDATA[OpenPLC]]></category>
		<category><![CDATA[Tutorials]]></category>
		<guid isPermaLink="false">https://www.controllino.com/?p=17457</guid>

					<description><![CDATA[Introduction This tutorial explains how to create a PWM-based light intensity control system using OpenPLC software and a CONTROLLINO Micro PLC. The system adjusts the brightness of a light through a single push button, using a digital output. Each button press decreases the brightness until it cycles back to full intensity. This project showcases ladder [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h1 class="wp-block-heading">Introduction</h1>



<p>This tutorial explains how to create a PWM-based light intensity control system using OpenPLC software and a CONTROLLINO Micro PLC. The system adjusts the brightness of a light through a single push button, using a digital output. Each button press decreases the brightness until it cycles back to full intensity. This project showcases ladder logic programming to control light intensity using PWM.</p>



<h2 class="wp-block-heading">Prerequisites</h2>



<p>Before you begin, ensure you have the following:</p>



<ul class="wp-block-list">
<li>OpenPLC software installed.</li>



<li>A CONTROLLINO Micro PLC.</li>



<li>Basic knowledge of ladder logic and PWM.</li>



<li>Hardware setup ready, including a connected push button and light output.</li>
</ul>



<h2 class="wp-block-heading">Step-by-Step Guide</h2>



<h3 class="wp-block-heading">Step 1: Install and Configure OpenPLC</h3>



<ol class="wp-block-list">
<li>Download OpenPLC from the official <a href="https://www.openplcproject.com/">OpenPLC website</a>.</li>



<li>Install the software on your computer.</li>



<li>Open the OpenPLC Editor and configure the environment for your CONTROLLINO Micro PLC:</li>
</ol>



<ul class="wp-block-list">
<li>Navigate to <strong>Settings &gt; Device</strong> and select &#8220;CONTROLLINO Micro&#8221; from the list.</li>



<li>Ensure the correct COM port is selected.</li>
</ul>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://github.com/CONTROLLINO-PLC/OpenPLC_examples/tree/master">Controllino&#8217;s OpenPLC repository</a></div>
</div>



<h3 class="wp-block-heading">Step 2: Create the Ladder Logic Program</h3>



<ol class="wp-block-list">
<li><strong>Define Variables</strong>:<br>Open the OpenPLC editor and define the variables listed below: Name Type Description <code>Control_button</code> BOOL Push button input to control brightness cycling. <code>Light_output</code> BOOL PWM output controlling the light intensity. <code>Light_bright</code> INT Tracks the current brightness level. <code>Pulse_regulator</code> TIME Timing variable for PWM modulation. <code>Light_on_state</code> BOOL Indicates whether the light is currently on. <code>Reset_state</code> BOOL Resets the brightness level to maximum. <code>Flag_cicle</code> BOOL Controls PWM signal cycling. <code>Full_bright</code> BOOL Indicates the full brightness state.</li>
</ol>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="370" src="https://www.controllino.com/wp-content/uploads/2024/11/OpemPLC-Variables-1024x370.jpg" alt="" class="wp-image-17498" srcset="https://www.controllino.com/wp-content/uploads/2024/11/OpemPLC-Variables-1024x370.jpg 1024w, https://www.controllino.com/wp-content/uploads/2024/11/OpemPLC-Variables-300x108.jpg 300w, https://www.controllino.com/wp-content/uploads/2024/11/OpemPLC-Variables-768x277.jpg 768w, https://www.controllino.com/wp-content/uploads/2024/11/OpemPLC-Variables-1536x554.jpg 1536w, https://www.controllino.com/wp-content/uploads/2024/11/OpemPLC-Variables-1200x433.jpg 1200w, https://www.controllino.com/wp-content/uploads/2024/11/OpemPLC-Variables.jpg 1920w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<ol class="wp-block-list">
<li><strong>Draw the Ladder Diagram</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Implement the logic as described in the <strong>Ladder Logic Explanation</strong> section below.</li>



<li>Use counters (CTU), timers (TP and TOF), and comparators (EQ, GT) to create the control logic.</li>
</ul>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://github.com/CONTROLLINO-PLC/OpenPLC_examples/tree/master/Dimmer_light_control">Download OpenPLC project here</a></div>
</div>



<h3 class="wp-block-heading">Step 3: Understanding the Ladder Logic</h3>



<h4 class="wp-block-heading">Button Press and Brightness Cycling</h4>



<ol class="wp-block-list">
<li><strong>Counter (CTU0)</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Each button press increments the counter.</li>



<li>The counter cycles through brightness levels (0, 1, 2, 3) and resets to 0 after reaching the maximum level.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Brightness Level Comparison</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Use comparators to determine the brightness level (<code>Light_bright</code>) and adjust the PWM pulse width accordingly.</li>
</ul>



<ol class="wp-block-list">
<li><strong>PWM Signal Generation</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Use timers to control the on/off duration of the PWM signal based on the current brightness level.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Light Output Control</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>The variable <code>Pulse_regulator</code> adjusts the <code>Light_output</code> signal to modulate light intensity.</li>
</ul>



<h3 class="wp-block-heading">Step 4: Connect the Hardware</h3>



<ol class="wp-block-list">
<li><strong>Wiring</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Connect the push button to a digital input pin (e.g., <code>CONTROLLINO_D0</code>).</li>



<li>Connect the light output to a PWM-capable pin (e.g., <code>CONTROLLINO_Q0</code>).</li>
</ul>



<ol class="wp-block-list">
<li><strong>Pin Mapping</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Assign the <code>Control_button</code> variable to the input pin connected to the push button.</li>



<li>Assign the <code>Light_output</code> variable to the output pin connected to the light.</li>
</ul>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="768" src="https://www.controllino.com/wp-content/uploads/2024/11/Electric-diagram-1-1024x768.png" alt="" class="wp-image-17495" srcset="https://www.controllino.com/wp-content/uploads/2024/11/Electric-diagram-1-1024x768.png 1024w, https://www.controllino.com/wp-content/uploads/2024/11/Electric-diagram-1-300x225.png 300w, https://www.controllino.com/wp-content/uploads/2024/11/Electric-diagram-1-768x576.png 768w, https://www.controllino.com/wp-content/uploads/2024/11/Electric-diagram-1-1536x1152.png 1536w, https://www.controllino.com/wp-content/uploads/2024/11/Electric-diagram-1-1200x900.png 1200w, https://www.controllino.com/wp-content/uploads/2024/11/Electric-diagram-1.png 1630w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h3 class="wp-block-heading">Step 5: Load and Run the Program</h3>



<ol class="wp-block-list">
<li><strong>Upload the Program</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Save your ladder logic project.</li>



<li>Use the OpenPLC Editor to upload the program to your CONTROLLINO Micro.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Test the System</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Power on the CONTROLLINO Micro.</li>



<li>Press the push button and observe the light cycling through brightness levels.</li>
</ul>



<h3 class="wp-block-heading">Ladder Logic Explanation (Detailed)</h3>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="819" src="https://www.controllino.com/wp-content/uploads/2024/11/OplenPLC-Program-1-1024x819.jpg" alt="" class="wp-image-17496" srcset="https://www.controllino.com/wp-content/uploads/2024/11/OplenPLC-Program-1-1024x819.jpg 1024w, https://www.controllino.com/wp-content/uploads/2024/11/OplenPLC-Program-1-300x240.jpg 300w, https://www.controllino.com/wp-content/uploads/2024/11/OplenPLC-Program-1-768x614.jpg 768w, https://www.controllino.com/wp-content/uploads/2024/11/OplenPLC-Program-1-1200x960.jpg 1200w, https://www.controllino.com/wp-content/uploads/2024/11/OplenPLC-Program-1.jpg 1358w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p><strong>Counter (CTU0)</strong>:</p>



<ol class="wp-block-list">
<li></li>
</ol>



<ul class="wp-block-list">
<li>Tracks the number of button presses and increments the <code>Light_bright</code> variable.</li>



<li>Resets to 0 after reaching the maximum brightness level.</li>
</ul>



<p><strong>Reset and Cycling</strong>:</p>



<ul class="wp-block-list">
<li>When the brightness reaches the lowest level, the <code>Reset_state</code> variable resets the system to the maximum brightness level.</li>
</ul>



<p><strong>Brightness Control</strong>:</p>



<ol class="wp-block-list">
<li></li>
</ol>



<ul class="wp-block-list">
<li>Use comparators (<code>EQ</code>, <code>GT</code>) to map the brightness level to a PWM duty cycle.</li>



<li>Timers (<code>TP0</code>, <code>TOF0</code>) generate the PWM signal by controlling the on/off duration of <code>Light_output</code>.</li>
</ul>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="474" src="https://www.controllino.com/wp-content/uploads/2024/11/OplenPLC-Program-2-1024x474.png" alt="" class="wp-image-17497" srcset="https://www.controllino.com/wp-content/uploads/2024/11/OplenPLC-Program-2-1024x474.png 1024w, https://www.controllino.com/wp-content/uploads/2024/11/OplenPLC-Program-2-300x139.png 300w, https://www.controllino.com/wp-content/uploads/2024/11/OplenPLC-Program-2-768x355.png 768w, https://www.controllino.com/wp-content/uploads/2024/11/OplenPLC-Program-2-1200x555.png 1200w, https://www.controllino.com/wp-content/uploads/2024/11/OplenPLC-Program-2.png 1344w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h3 class="wp-block-heading">Troubleshooting</h3>



<ol class="wp-block-list">
<li>Verify the wiring between the push button, light, and CONTROLLINO.</li>



<li>Ensure that the correct input and output pins are assigned to the variables.</li>



<li>Check for errors in the ladder logic program using the OpenPLC debugger.</li>
</ol>



<h3 class="wp-block-heading">Conclusion</h3>



<p>You have successfully implemented a PWM-based light intensity control system using a CONTROLLINO Micro and OpenPLC. By integrating ladder logic and PWM, this project demonstrates an efficient way to control light brightness with a single push button. Experiment with the timing variables and additional functionality to customize the system further.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Modbus TCP Server Client I/O</title>
		<link>https://www.controllino.com/modbus-tcp-master-client-i-o/</link>
		
		<dc:creator><![CDATA[CONTROLLINO]]></dc:creator>
		<pubDate>Fri, 27 Sep 2024 16:57:09 +0000</pubDate>
				<category><![CDATA[MAXI]]></category>
		<category><![CDATA[MEGA]]></category>
		<category><![CDATA[Tutorials]]></category>
		<guid isPermaLink="false">https://www.controllino.com/?p=17155</guid>

					<description><![CDATA[Introduction This is an example guide to setting up Modbus TCP communication between a client and server using CONTROLLINO and an Ethernet shield. This tutorial will help you configure the client to read and write inputs and outputs and the server to synchronize its state with the client. Prerequisites Modbus TCP connection example Point to [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Introduction</h2>



<p>This is an example guide to setting up Modbus TCP communication between a client and server using CONTROLLINO and an Ethernet shield. This tutorial will help you configure the client to read and write inputs and outputs and the server to synchronize its state with the client.</p>



<h2 class="wp-block-heading">Prerequisites</h2>



<ul class="wp-block-list">
<li>Installed Arduino IDE.</li>



<li>CONTROLLINO PLC board (e.g., MAXI(also Automation), or MEGA).</li>



<li>Basic understanding of Modbus TCP and Ethernet setup.</li>
</ul>



<h4 class="wp-block-heading">Modbus TCP connection example</h4>



<p>Point to point connection</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="429" src="https://www.controllino.com/wp-content/uploads/2024/09/Controllino-TCP-connection-1024x429.jpg" alt="" class="wp-image-17346" srcset="https://www.controllino.com/wp-content/uploads/2024/09/Controllino-TCP-connection-1024x429.jpg 1024w, https://www.controllino.com/wp-content/uploads/2024/09/Controllino-TCP-connection-300x126.jpg 300w, https://www.controllino.com/wp-content/uploads/2024/09/Controllino-TCP-connection-768x321.jpg 768w, https://www.controllino.com/wp-content/uploads/2024/09/Controllino-TCP-connection.jpg 1056w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>Connection using switch </p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="639" src="https://www.controllino.com/wp-content/uploads/2024/09/Controllino-TCP-switch-connection-1024x639.jpg" alt="" class="wp-image-17347" srcset="https://www.controllino.com/wp-content/uploads/2024/09/Controllino-TCP-switch-connection-1024x639.jpg 1024w, https://www.controllino.com/wp-content/uploads/2024/09/Controllino-TCP-switch-connection-300x187.jpg 300w, https://www.controllino.com/wp-content/uploads/2024/09/Controllino-TCP-switch-connection-768x479.jpg 768w, https://www.controllino.com/wp-content/uploads/2024/09/Controllino-TCP-switch-connection.jpg 1084w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading"> Example Code</h2>



<p>You can download the example Modbus TCP&nbsp;<strong>Client</strong>&nbsp;and&nbsp;<strong>Server</strong>&nbsp;code from the following GitHub repository:</p>



<ul class="wp-block-list">
<li><strong>Modbus TCP Client code</strong></li>
</ul>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://github.com/CONTROLLINO-PLC/CONTROLLINO_Library/tree/master/examples/Expand_Modbus/TCP/ControllinoClient" target="_blank" rel="noreferrer noopener">Client code link</a></div>
</div>



<ul class="wp-block-list">
<li><strong>Modbus TCP Server code</strong></li>
</ul>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://github.com/CONTROLLINO-PLC/CONTROLLINO_Library/tree/master/examples/Expand_Modbus/TCP/ControllinoServer" target="_blank" rel="noreferrer noopener">Server code link</a></div>
</div>



<ul class="wp-block-list">
<li><strong>Detailed example explanation</strong></li>
</ul>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://github.com/CONTROLLINO-PLC/CONTROLLINO_Library/blob/master/examples/Expand_Modbus/TCP/README.md" target="_blank" rel="noreferrer noopener">README</a></div>
</div>



<h2 class="wp-block-heading">Step-by-Step Guide</h2>



<h3 class="wp-block-heading">Modbus TCP Client</h3>



<p>The Modbus TCP client communicates with the server to toggle coils and read and write registers.</p>



<h4 class="wp-block-heading">Step 1: Setup the Arduino Environment</h4>



<ul class="wp-block-list">
<li>Connect your CONTROLLINO board to your computer.</li>



<li>Open the Arduino IDE.</li>



<li>Ensure that the CONTROLLINO is selected in the&nbsp;<code>Tools</code>&nbsp;menu.</li>



<li>Include the necessary libraries for communication:
<ul class="wp-block-list">
<li><code>ArduinoRS485</code></li>



<li><code>ArduinoModbus</code></li>



<li><code>Controllino</code></li>



<li><code>SPI</code></li>



<li><code>Ethernet</code></li>
</ul>
</li>
</ul>



<h4 class="wp-block-heading">Step 2: Initialize the Ethernet and Modbus TCP Client</h4>



<p>In the&nbsp;<code>setup()</code>&nbsp;function:</p>



<ol class="wp-block-list">
<li>Start the Ethernet connection by calling&nbsp;<code>Ethernet.begin(mac, ip)</code>&nbsp;using the MAC address of your Ethernet shield.</li>



<li>Check the Ethernet hardware and cable connection.</li>



<li>If the connection is successful, initialize the Modbus TCP client by using&nbsp;<code>modbusTCPClient.begin(server, 502)</code>.</li>
</ol>



<h4 class="wp-block-heading">Step 3: Configure Digital and Analog Pins</h4>



<p>In the&nbsp;<code>loop()</code>&nbsp;function:</p>



<ol class="wp-block-list">
<li><strong>Digital Inputs and Coils</strong>:
<ul class="wp-block-list">
<li>Declare an array&nbsp;<code>slaveInputs[]</code>&nbsp;to store the state of the slave&#8217;s digital inputs.</li>



<li>Read these inputs using&nbsp;<code>modbusTCPClient.discreteInputRead()</code>.</li>



<li>Synchronize the state of the slave inputs to the master outputs using&nbsp;<code>digitalWrite()</code>.</li>



<li>Write the current state of the master digital input to the slave using&nbsp;<code>modbusTCPClient.coilWrite()</code>.</li>
</ul>
</li>



<li><strong>Analog Inputs and Holding Registers</strong>:
<ul class="wp-block-list">
<li>Declare an array&nbsp;<code>slaveInRegisters[]</code>&nbsp;to store the state of the slave&#8217;s holding registers.</li>



<li>Read the analog inputs using&nbsp;<code>modbusTCPClient.inputRegisterRead()</code>.</li>



<li>Synchronize the master’s analog outputs using&nbsp;<code>analogWrite()</code>&nbsp;and update the slave’s holding registers using&nbsp;<code>modbusTCPClient.holdingRegisterWrite()</code>.</li>
</ul>
</li>
</ol>



<h3 class="wp-block-heading">Modbus TCP Server</h3>



<p>The Modbus TCP server simulates a coil and synchronizes the state of its inputs and outputs with the client.</p>



<h4 class="wp-block-heading">Step 1: Setup the Arduino Environment</h4>



<ul class="wp-block-list">
<li>Connect your CONTROLLINO board to your computer.</li>



<li>Open the Arduino IDE.</li>



<li>Ensure that the CONTROLLINO is selected in the&nbsp;<code>Tools</code>&nbsp;menu.</li>



<li>Include the same libraries as in the client setup:
<ul class="wp-block-list">
<li><code>ArduinoRS485</code></li>



<li><code>ArduinoModbus</code></li>



<li><code>Controllino</code></li>



<li><code>SPI</code></li>



<li><code>Ethernet</code></li>
</ul>
</li>
</ul>



<h4 class="wp-block-heading">Step 2: Initialize the Ethernet and Modbus TCP Server</h4>



<p>In the&nbsp;<code>setup()</code>&nbsp;function:</p>



<ol class="wp-block-list">
<li>Start the Ethernet connection using&nbsp;<code>Ethernet.begin(mac, ip)</code>.</li>



<li>Start the Modbus TCP server by calling&nbsp;<code>modbusTCPServer.begin()</code>.</li>



<li>Configure the Modbus coils, discrete inputs, holding registers, and input registers using:
<ul class="wp-block-list">
<li><code>modbusTCPServer.configureCoils()</code></li>



<li><code>modbusTCPServer.configureDiscreteInputs()</code></li>



<li><code>modbusTCPServer.configureHoldingRegisters()</code></li>



<li><code>modbusTCPServer.configureInputRegisters()</code></li>
</ul>
</li>
</ol>



<h4 class="wp-block-heading">Step 3: Configure Digital and Analog Pins</h4>



<ol class="wp-block-list">
<li>Set up digital input and output pins.
<ul class="wp-block-list">
<li>Use&nbsp;<code>pinMode()</code>&nbsp;to define the pins as either INPUT or OUTPUT.</li>



<li>Initialize output pins to a LOW state.</li>
</ul>
</li>



<li>Set up analog output pins for holding registers using&nbsp;<code>analogWrite()</code>.</li>
</ol>



<h4 class="wp-block-heading">Step 4: Synchronizing Coils and Registers</h4>



<p>In the&nbsp;<code>loop()</code>&nbsp;function:</p>



<ol class="wp-block-list">
<li><strong>Client Connection</strong>:
<ul class="wp-block-list">
<li>Wait for incoming client connections using&nbsp;<code>ethernetServer.available()</code>.</li>



<li>Accept the client connection with&nbsp;<code>modbusTCPServer.accept(client)</code>.</li>
</ul>
</li>



<li><strong>Synchronize Coils and Registers</strong>:
<ul class="wp-block-list">
<li>In the&nbsp;<code>executeSynchronization()</code>&nbsp;function:
<ul class="wp-block-list">
<li>Read the state of the server’s coils using&nbsp;<code>modbusTCPServer.coilRead()</code>, and update the corresponding output pins using&nbsp;<code>digitalWrite()</code>.</li>



<li>Read the state of the input pins using&nbsp;<code>digitalRead()</code>&nbsp;and update the corresponding coil register with&nbsp;<code>modbusTCPServer.coilWrite()</code>.</li>



<li>For analog outputs, write the value from the holding register to the PWM outputs using&nbsp;<code>analogWrite()</code>.</li>



<li>Read the analog input pins and update the corresponding input registers using&nbsp;<code>modbusTCPServer.inputRegisterWrite()</code>.</li>
</ul>
</li>
</ul>
</li>
</ol>



<h3 class="wp-block-heading">Conclusion</h3>



<p>You have now successfully configured Modbus TCP communication between a CONTROLLINO client and server using an Ethernet shield. The client reads and writes digital and analog inputs/outputs, while the server synchronizes its state accordingly. Experiment with different pin configurations and data handling to expand your project!</p>



<p></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Modbus RTU Master Slave I/O</title>
		<link>https://www.controllino.com/modbus-rtu-master-slave-synchronization/</link>
		
		<dc:creator><![CDATA[CONTROLLINO]]></dc:creator>
		<pubDate>Wed, 25 Sep 2024 23:36:09 +0000</pubDate>
				<category><![CDATA[MAXI]]></category>
		<category><![CDATA[MEGA]]></category>
		<category><![CDATA[Tutorials]]></category>
		<guid isPermaLink="false">https://www.controllino.com/?p=17117</guid>

					<description><![CDATA[Introduction This tutorial will guide you through setting up&#160;Modbus RTU communication&#160;between a&#160;master&#160;and a&#160;slave&#160;device using two&#160;CONTROLLINO devices. The master device reads&#160;digital&#160;and&#160;analog inputs&#160;from the slave and sends data to control its outputs, while the slave responds with data controlling its own outputs based on commands received from the master. Note The Controllino BSP, for MAXI and MEGA, [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Introduction</h2>



<p>This tutorial will guide you through setting up&nbsp;<strong>Modbus RTU communication</strong>&nbsp;between a&nbsp;<strong>master</strong>&nbsp;and a&nbsp;<strong>slave</strong>&nbsp;device using two&nbsp;<strong>CONTROLLINO </strong>devices. The master device reads&nbsp;<strong>digital</strong>&nbsp;and&nbsp;<strong>analog inputs</strong>&nbsp;from the slave and sends data to control its outputs, while the slave responds with data controlling its own outputs based on commands received from the master.</p>



<h3 class="wp-block-heading">Note<a href="https://github.com/CONTROLLINO-PLC/CONTROLLINO_Tutorials/tree/master/Modbus/RTU#note"></a></h3>



<p>The Controllino BSP, for MAXI and MEGA, inside&nbsp;<strong>pins_arduino.h</strong>&nbsp;contains the following definitions:</p>



<pre class="wp-block-preformatted"><code>// ArduinoRS485 library support<br>#define RS485_SERIAL_PORT           Serial3<br>#define RS485_DEFAULT_TX_PIN        14<br>#define CUSTOM_RS485_DEFAULT_DE_PIN 75<br>#define CUSTOM_RS485_DEFAULT_RE_PIN 76</code></pre>



<p>These allows the use of the default instance of RS485 library:</p>



<pre class="wp-block-preformatted"><code>RS485Class RS485(RS485_SERIAL_PORT, RS485_DEFAULT_TX_PIN, RS485_DEFAULT_DE_PIN, RS485_DEFAULT_RE_PIN);</code></pre>



<p>Which is also the default RS485 interface for&nbsp;<strong>ModbusRTUServer</strong>&nbsp;and&nbsp;<strong>ModbusRTUClient</strong>&nbsp;the default instances for RTU in ArduinoModbus library.</p>



<p>This allows an easy integration of the libraries and the Controllino BSP so there is not need to create an instance of RS485 and later an instance of ModbusRTUServer or ModbusRTUClient, but just use the default instances like in the library examples.</p>



<h2 class="wp-block-heading">Prerequisites</h2>



<ul class="wp-block-list">
<li>Installed&nbsp;<strong>Arduino IDE</strong>.</li>



<li><strong>CONTROLLINO Mega</strong> or <strong>Maxi</strong>&nbsp;PLC board for both master and slave devices.</li>



<li>Basic understanding of&nbsp;<strong>Modbus RTU</strong>&nbsp;communication and&nbsp;<strong>pin setup</strong>.</li>



<li>Connect two Controllino boards using de RS485 pins as show the pictures above.</li>
</ul>



<h5 class="wp-block-heading">RS485 connection for Controllino Maxi</h5>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="604" src="https://www.controllino.com/wp-content/uploads/2024/09/Controll1no-Max1-RS485-1024x604.jpg" alt="" class="wp-image-17253" srcset="https://www.controllino.com/wp-content/uploads/2024/09/Controll1no-Max1-RS485-1024x604.jpg 1024w, https://www.controllino.com/wp-content/uploads/2024/09/Controll1no-Max1-RS485-300x177.jpg 300w, https://www.controllino.com/wp-content/uploads/2024/09/Controll1no-Max1-RS485-768x453.jpg 768w, https://www.controllino.com/wp-content/uploads/2024/09/Controll1no-Max1-RS485-1536x906.jpg 1536w, https://www.controllino.com/wp-content/uploads/2024/09/Controll1no-Max1-RS485-1200x708.jpg 1200w, https://www.controllino.com/wp-content/uploads/2024/09/Controll1no-Max1-RS485.jpg 1920w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h5 class="wp-block-heading">RS485 connection for Controllino Mega</h5>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="546" src="https://www.controllino.com/wp-content/uploads/2024/09/Controll1no-Mega-RS485-1024x546.jpg" alt="" class="wp-image-17254" srcset="https://www.controllino.com/wp-content/uploads/2024/09/Controll1no-Mega-RS485-1024x546.jpg 1024w, https://www.controllino.com/wp-content/uploads/2024/09/Controll1no-Mega-RS485-300x160.jpg 300w, https://www.controllino.com/wp-content/uploads/2024/09/Controll1no-Mega-RS485-768x409.jpg 768w, https://www.controllino.com/wp-content/uploads/2024/09/Controll1no-Mega-RS485-1200x640.jpg 1200w, https://www.controllino.com/wp-content/uploads/2024/09/Controll1no-Mega-RS485.jpg 1332w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">Example Code</h2>



<p>You can download the example Modbus RTU&nbsp;<strong>master</strong>&nbsp;and&nbsp;<strong>slave</strong>&nbsp;code from the following GitHub repository:</p>



<ul class="wp-block-list">
<li><strong>Modbus RTU Master code</strong></li>
</ul>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://github.com/CONTROLLINO-PLC/CONTROLLINO_Library/tree/master/examples/Expand_Modbus/RTU/ControllinoMaster" target="_blank" rel="noreferrer noopener">Master code link</a></div>
</div>



<ul class="wp-block-list">
<li><strong>Modbus RTU Slave code</strong></li>
</ul>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://github.com/CONTROLLINO-PLC/CONTROLLINO_Library/tree/master/examples/Expand_Modbus/RTU/ControllinoSlave" target="_blank" rel="noreferrer noopener">Slave code link</a></div>
</div>



<ul class="wp-block-list">
<li><strong>Detailed example explanation</strong></li>
</ul>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://github.com/CONTROLLINO-PLC/CONTROLLINO_Library/blob/master/examples/Expand_Modbus/RTU/README.md" target="_blank" rel="noreferrer noopener">README</a></div>
</div>



<h2 class="wp-block-heading">Step-by-Step Guide</h2>



<h3 class="wp-block-heading">Step 1: Setup the Arduino Environment</h3>



<ol class="wp-block-list">
<li><strong>Connect your CONTROLLINO</strong>&nbsp;boards (both master and slave) to your computer.</li>



<li><strong>Open the Arduino IDE</strong>.</li>



<li>Ensure the appropriate&nbsp;<strong>CONTROLLINO Mega board</strong>&nbsp;and&nbsp;<strong>port</strong>&nbsp;are selected in the&nbsp;<strong>Tools</strong>&nbsp;menu.</li>



<li><strong>Include the necessary libraries</strong>:
<ul class="wp-block-list">
<li><strong>ArduinoRS485</strong>&nbsp;library for Modbus RTU communication.</li>



<li><strong>ArduinoModbus</strong>&nbsp;library for handling Modbus RTU protocol.</li>



<li><strong>Controllino library</strong>&nbsp;to handle CONTROLLINO-specific pins.</li>
</ul>
</li>
</ol>



<h3 class="wp-block-heading">Step 2: Initialize Modbus RTU Communication and Serial Debugging</h3>



<ol class="wp-block-list">
<li>In the&nbsp;<strong>setup() function</strong>&nbsp;of both master and slave:
<ul class="wp-block-list">
<li>Initialize&nbsp;<strong>Modbus RTU</strong>&nbsp;communication by calling&nbsp;<code>ModbusRTUClient.begin(9600)</code>&nbsp;for the master and&nbsp;<code>ModbusRTUServer.begin(1, 9600)</code>&nbsp;for the slave. This sets up the master to communicate at a&nbsp;<strong>9600 baud rate</strong>, and the slave is assigned&nbsp;<strong>ID 1</strong>.</li>



<li>Initialize&nbsp;<strong>serial communication</strong>&nbsp;for debugging purposes using&nbsp;<code>Serial.begin(9600)</code>.</li>
</ul>
</li>



<li>On the&nbsp;<strong>master</strong>&nbsp;side, you will configure the Modbus client, while the&nbsp;<strong>slave</strong>&nbsp;initializes the Modbus server.</li>
</ol>



<h3 class="wp-block-heading">Step 3: Configure Digital and Analog Pins</h3>



<ol class="wp-block-list">
<li><strong>Master Configuration</strong>:
<ul class="wp-block-list">
<li><strong>Digital Inputs and Outputs</strong>:
<ul class="wp-block-list">
<li>Configure&nbsp;<strong>digital pins</strong>&nbsp;<code>CONTROLLINO_A0</code>&nbsp;to&nbsp;<code>CONTROLLINO_A10</code>&nbsp;as inputs.</li>



<li>Configure&nbsp;<strong>relay pins</strong>&nbsp;<code>CONTROLLINO_R0</code>&nbsp;to&nbsp;<code>CONTROLLINO_R10</code>&nbsp;as outputs.</li>
</ul>
</li>



<li><strong>Analog Inputs and Outputs</strong>:
<ul class="wp-block-list">
<li>Configure&nbsp;<strong>analog input pins</strong>&nbsp;<code>CONTROLLINO_A11</code>&nbsp;to&nbsp;<code>CONTROLLINO_A15</code>&nbsp;as inputs.</li>



<li>Configure&nbsp;<strong>PWM output pins</strong>&nbsp;<code>CONTROLLINO_D0</code>&nbsp;to&nbsp;<code>CONTROLLINO_D4</code>&nbsp;as outputs.</li>
</ul>
</li>
</ul>
</li>



<li><strong>Slave Configuration</strong>:
<ul class="wp-block-list">
<li><strong>Digital Inputs and Outputs</strong>:
<ul class="wp-block-list">
<li>The same digital input-output configuration will be applied to the&nbsp;<strong>slave</strong>.</li>
</ul>
</li>



<li><strong>Analog Inputs and Outputs</strong>:
<ul class="wp-block-list">
<li>Similarly, configure&nbsp;<strong>analog input pins</strong>&nbsp;and&nbsp;<strong>PWM output pins</strong>&nbsp;as on the master.</li>
</ul>
</li>
</ul>
</li>
</ol>



<h3 class="wp-block-heading">Step 4: Sending and Receiving Data Between Master and Slave</h3>



<h4 class="wp-block-heading">Master Code</h4>



<p>In the&nbsp;<strong>loop() function</strong>:</p>



<ol class="wp-block-list">
<li>Start by&nbsp;<strong>reading the digital inputs</strong>&nbsp;(<code>CONTROLLINO_A0</code>&nbsp;to&nbsp;<code>CONTROLLINO_A10</code>) on the master.</li>



<li><strong>Write the input states to the slave&#8217;s coils</strong>&nbsp;using&nbsp;<code>ModbusRTUClient.coilWrite()</code>. This will send the master’s inputs to the corresponding&nbsp;<strong>digital outputs</strong>&nbsp;(<code>CONTROLLINO_R0</code>&nbsp;to&nbsp;<code>CONTROLLINO_R10</code>) on the slave.</li>



<li>Read the&nbsp;<strong>analog input values</strong>&nbsp;on the master, and split the 10-bit values into&nbsp;<strong>Modbus registers</strong>. Write these to the slave&#8217;s&nbsp;<strong>holding registers</strong>.</li>



<li>After sending data to the slave,&nbsp;<strong>read the slave&#8217;s discrete inputs</strong>&nbsp;and&nbsp;<strong>input registers</strong>&nbsp;to update the master&#8217;s digital and analog outputs.</li>
</ol>



<h4 class="wp-block-heading">Slave Code</h4>



<p>In the&nbsp;<strong>loop() function</strong>&nbsp;of the slave:</p>



<ol class="wp-block-list">
<li>Use&nbsp;<code>ModbusRTUServer.poll()</code>&nbsp;to check for incoming Modbus requests from the master.</li>



<li>For&nbsp;<strong>digital outputs</strong>, read the&nbsp;<strong>coil values</strong>&nbsp;sent by the master and update the&nbsp;<strong>digital output pins</strong>&nbsp;accordingly.</li>



<li>For&nbsp;<strong>analog outputs</strong>, read the values from the&nbsp;<strong>holding registers</strong>&nbsp;and use them to set the&nbsp;<strong>PWM outputs</strong>.</li>
</ol>



<h3 class="wp-block-heading">Step 5: Synchronizing Digital and Analog Outputs</h3>



<ol class="wp-block-list">
<li>The master’s&nbsp;<strong>digital outputs</strong>&nbsp;(<code>CONTROLLINO_R0</code>&nbsp;to&nbsp;<code>CONTROLLINO_R10</code>) are updated based on the data received from the slave’s&nbsp;<strong>discrete inputs</strong>.</li>



<li>The master’s&nbsp;<strong>analog outputs</strong>&nbsp;(<code>CONTROLLINO_D0</code>&nbsp;to&nbsp;<code>CONTROLLINO_D4</code>) are updated based on the slave’s&nbsp;<strong>input registers</strong>.</li>



<li>On the slave, the&nbsp;<strong>digital outputs</strong>&nbsp;and&nbsp;<strong>PWM outputs</strong>&nbsp;are controlled by the master’s Modbus write commands, allowing for synchronized control across the devices.</li>
</ol>



<h3 class="wp-block-heading">Step 6: Debugging and Monitoring Communication</h3>



<ol class="wp-block-list">
<li>Add&nbsp;<strong>serial print statements</strong>&nbsp;to monitor Modbus communication between the master and slave.</li>



<li>Ensure the&nbsp;<strong>Modbus client</strong>&nbsp;is correctly reading and writing data from and to the&nbsp;<strong>slave device</strong>.</li>



<li>Use&nbsp;<strong>LEDs or external devices</strong>&nbsp;connected to the outputs to visualize changes in state as you control the system through Modbus communication.</li>
</ol>



<h2 class="wp-block-heading">Troubleshooting</h2>



<ul class="wp-block-list">
<li><strong>Modbus Communication Issues</strong>: Verify the&nbsp;<strong>slave ID</strong>&nbsp;and&nbsp;<strong>Modbus address</strong>&nbsp;in both the master and slave codes.</li>



<li><strong>Serial Debugging</strong>: Ensure the&nbsp;<strong>Serial Monitor</strong>&nbsp;is open at the correct baud rate (<strong>9600 baud</strong>).</li>



<li><strong>Wiring</strong>: Double-check the&nbsp;<strong>RS485</strong>&nbsp;connections between the master and slave devices. Ensure that the&nbsp;<strong>A+</strong>&nbsp;and&nbsp;<strong>B-</strong>terminals are properly connected.</li>



<li><strong>Pin Setup</strong>: Verify that the correct pins are configured as inputs and outputs on both the master and slave.</li>
</ul>



<h2 class="wp-block-heading">Conclusion</h2>



<p>You have now successfully established&nbsp;<strong>Modbus RTU communication</strong>&nbsp;between a&nbsp;<strong>CONTROLLINO master and slave</strong>. The master reads digital and analog inputs, sends this data to the slave, and controls the slave’s outputs accordingly. Experiment with this setup to synchronize&nbsp;<strong>multiple devices</strong>&nbsp;or expand your project with additional sensors and actuators!</p>



<p>Also this tutorial can be a base example on how to extend the I/Os of a <strong>CONTROLLINO</strong> with another <strong>CONTROLLINO</strong>, using Modbus RTU and RS485.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>I2C Master Slave I/O</title>
		<link>https://www.controllino.com/i2c-master-slave-i-o/</link>
		
		<dc:creator><![CDATA[CONTROLLINO]]></dc:creator>
		<pubDate>Tue, 17 Sep 2024 20:45:54 +0000</pubDate>
				<category><![CDATA[MAXI]]></category>
		<category><![CDATA[MEGA]]></category>
		<category><![CDATA[MINI]]></category>
		<category><![CDATA[Tutorials]]></category>
		<guid isPermaLink="false">https://www.controllino.com/?p=17065</guid>

					<description><![CDATA[Introduction This tutorial will guide you through setting up I2C communication between a master and a slave device using a CONTROLLINO PLC. The master device reads analog and digital inputs and sends this data to the slave, while the slave responds with data that controls the outputs on the master. Prerequisites I2C Connection example This [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Introduction</h2>



<p>This tutorial will guide you through setting up I2C communication between a master and a slave device using a CONTROLLINO PLC. The master device reads analog and digital inputs and sends this data to the slave, while the slave responds with data that controls the outputs on the master.</p>



<h2 class="wp-block-heading">Prerequisites</h2>



<ul class="wp-block-list">
<li>Installed Arduino IDE.</li>



<li>CONTROLLINO PLC board (e.g., MINI, MAXI, or MEGA).</li>



<li>Basic understanding of I2C communication and pin setup.</li>
</ul>



<h5 class="wp-block-heading">I2C Connection example</h5>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="584" src="https://www.controllino.com/wp-content/uploads/2024/09/I2C-Controllino-Mega-1024x584.jpg" alt="" class="wp-image-17342" srcset="https://www.controllino.com/wp-content/uploads/2024/09/I2C-Controllino-Mega-1024x584.jpg 1024w, https://www.controllino.com/wp-content/uploads/2024/09/I2C-Controllino-Mega-300x171.jpg 300w, https://www.controllino.com/wp-content/uploads/2024/09/I2C-Controllino-Mega-768x438.jpg 768w, https://www.controllino.com/wp-content/uploads/2024/09/I2C-Controllino-Mega.jpg 1112w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>This example of connection is based on the Controllino Mega but I2C connections for Maxi and Mini uses the same pins of the same X1 connector. </p>



<h2 class="wp-block-heading">Example Code</h2>



<p>Please grab the following example .ino file from Github:</p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://github.com/CONTROLLINO-PLC/CONTROLLINO_Library/tree/master/examples/Expand_I2C/Master" target="_blank" rel="noreferrer noopener">I2C Master Code Example</a></div>
</div>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://github.com/CONTROLLINO-PLC/CONTROLLINO_Library/tree/master/examples/Expand_I2C/Slave" target="_blank" rel="noreferrer noopener">I2C Slave Code Example</a></div>
</div>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://github.com/CONTROLLINO-PLC/CONTROLLINO_Library/blob/master/examples/Expand_I2C/README.md" target="_blank" rel="noreferrer noopener">Readme file Link</a></div>
</div>



<h2 class="wp-block-heading">Step-by-Step Guide</h2>



<h3 class="wp-block-heading">Step 1: Setup the Arduino Environment</h3>



<ol class="wp-block-list">
<li>Connect your CONTROLLINO board to your computer.</li>



<li>Open the Arduino IDE.</li>



<li>Ensure that the appropriate CONTROLLINO board and port are selected in the&nbsp;<strong>Tools</strong>&nbsp;menu.</li>



<li>Include the&nbsp;<strong>Wire</strong>&nbsp;and&nbsp;<strong>Controllino</strong>&nbsp;libraries in your project.</li>
</ol>



<h3 class="wp-block-heading">Step 2: Initialize I2C Communication and Serial Debugging</h3>



<ol class="wp-block-list">
<li>In the&nbsp;<code>setup()</code>&nbsp;function, initialize the I2C communication by calling&nbsp;<code>Wire.begin()</code>. This sets up the CONTROLLINO device as a master.</li>



<li>Initialize serial communication for debugging purposes using&nbsp;<code>Serial.begin(9600)</code>.</li>
</ol>



<h3 class="wp-block-heading">Step 3: Configure Digital and Analog Pins</h3>



<ol class="wp-block-list">
<li>Set up the digital pins:
<ul class="wp-block-list">
<li>The first 5 digital pins (<code>CONTROLLINO_D0</code>&nbsp;to&nbsp;<code>CONTROLLINO_D4</code>) are configured as inputs.</li>



<li>The corresponding relay pins (<code>CONTROLLINO_R0</code>&nbsp;to&nbsp;<code>CONTROLLINO_R4</code>) are set as outputs.</li>
</ul>
</li>



<li>Set up the analog pins:
<ul class="wp-block-list">
<li>The next 2 analog input pins (<code>CONTROLLINO_A0</code>&nbsp;and&nbsp;<code>CONTROLLINO_A1</code>) are configured as inputs.</li>



<li>The same pins will also serve as PWM outputs, configured as outputs.</li>
</ul>
</li>
</ol>



<h3 class="wp-block-heading">Step 4: Sending Analog and Digital Inputs to the Slave</h3>



<ol class="wp-block-list">
<li>In the&nbsp;<code>loop()</code>&nbsp;function, start communication with the slave by calling&nbsp;<code>Wire.beginTransmission(slaveAddress)</code>.</li>



<li>Read the values from the analog input pins and split each 10-bit value into two bytes. Send these bytes to the slave using&nbsp;<code>Wire.write()</code>.</li>



<li>Read the states of the digital input pins, and store them in a single byte using bitwise operations. Send this byte to the slave.</li>
</ol>



<h3 class="wp-block-heading">Step 5: Receiving Data from the Slave</h3>



<ol class="wp-block-list">
<li>After ending the transmission with&nbsp;<code>Wire.endTransmission()</code>, request data from the slave by calling&nbsp;<code>Wire.requestFrom(slaveAddress, 5)</code>.</li>



<li>Once data is available, read the byte that contains the digital output states and update the output pins accordingly.</li>



<li>For analog data, combine the two bytes received into a single integer, and use this value to set the PWM outputs on the master.</li>
</ol>



<h3 class="wp-block-heading">Step 6: Control Digital Outputs Based on Slave Data</h3>



<ol class="wp-block-list">
<li>Use the byte received from the slave to set the states of the digital output pins (<code>CONTROLLINO_R0</code>&nbsp;to&nbsp;<code>CONTROLLINO_R4</code>).</li>



<li>Each bit in the byte represents the state of one output pin, and the&nbsp;<code>digitalWrite()</code>&nbsp;function is used to control these pins.</li>
</ol>



<p>Certainly! Here’s an expanded explanation with more details on how the slave code works and its interaction with the master:</p>



<h3 class="wp-block-heading">Step 7: Set Up the Slave Address and Digital/Analog Pins</h3>



<p>In the slave code, the device is initialized with a specific I2C address using <code>Wire.begin(8)</code>. This address must match the address used in the master code for communication to work.</p>



<p>The digital and analog pins on the slave are then configured:</p>



<ul class="wp-block-list">
<li>The first 5 digital pins are set as inputs and outputs, similar to the master.</li>



<li>The next 2 pins are designated as PWM outputs (for receiving analog data from the master) and as analog inputs (for sending data back to the master).</li>
</ul>



<p>This ensures that both the master and slave are working with the same configuration, which is essential for seamless data exchange.</p>



<h3 class="wp-block-heading">Step 8: Handling Data Received from the Master</h3>



<p>The <code>receiveEvent()</code> function in the slave code is triggered whenever the master sends data to the slave. This function:</p>



<ol class="wp-block-list">
<li>Reads the analog values sent by the master, reconstructing each value from two bytes.</li>



<li>Writes the reconstructed analog values to the designated PWM output pins on the slave, enabling the master to control the analog output on the slave remotely.</li>



<li>Reads the byte representing the digital output states, where each bit corresponds to the state of one digital output pin.</li>
</ol>



<p>The slave then uses <code>digitalWrite()</code> to set its digital output pins based on the master’s instructions, allowing the master to control these outputs directly.</p>



<h3 class="wp-block-heading">Step 9: Responding to the Master’s Data Request</h3>



<p>When the master requests data from the slave, the <code>requestEvent()</code> function on the slave is executed:</p>



<ol class="wp-block-list">
<li>The analog inputs are read, its value is splited into two bytes for transmission.</li>



<li>The combined digital input states are read and stored in a single byte, with each bit representing one digital input.</li>
</ol>



<p>The slave then sends these values back to the master via <code>Wire.write()</code>, allowing the master to read the current state of the slave’s inputs and use this data in its control logic.</p>



<h3 class="wp-block-heading">Step 10: Synchronizing Data Between Master and Slave</h3>



<p>The master and slave continuously communicate over I2C to maintain synchronization:</p>



<ol class="wp-block-list">
<li>The master sends analog values to control the PWM outputs on the slave.</li>



<li>The master also sends digital states to control specific digital outputs on the slave.</li>



<li>The slave responds with its own digital and analog input states, enabling the master to monitor and react to the slave’s environment.</li>
</ol>



<p>This bidirectional data flow ensures the master can dynamically control and respond to the conditions on the slave, creating a cohesive system where both devices operate in harmony.</p>



<h3 class="wp-block-heading">Troubleshooting</h3>



<ul class="wp-block-list">
<li>Ensure the I2C address of the slave matches the value set in&nbsp;<code>slaveAddress</code>.</li>



<li>Check the wiring between the master and slave, ensuring the I2C SDA and SCL lines are connected properly.</li>



<li>Verify the CONTROLLINO board and port are correctly selected in the Arduino IDE.</li>
</ul>



<h2 class="wp-block-heading">Conclusion</h2>



<p>You have now successfully established I2C communication between a CONTROLLINO master and slave. By reading analog and digital inputs on the master and controlling its outputs based on data received from the slave, this setup enables synchronized control between two devices. Experiment with different pin configurations and data handling to expand your project!</p>



<p></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
