XOD.IO & Arduino based PLC: How to write an output
Using the XOD.io Open-Source Software to program the Arduino based PLC: M-Duino PLC
18 October, 2021 by
XOD.IO & Arduino based PLC: How to write an output
Boot & Work Corp. S.L., Fernandez Queralt Martinez

INTRODUCTION

XOD.IO is a visual programming language for microcontrollers, which is free, open source and cross-platform.

In this tutorial, we will be programming the Arduino based PLC: M-Duino 21+ to activate and deactivate an output with this amazing open-source software!

Latest Posts

REQUIREMENTS

XOD.IDE

The XOD.IDE is an open source software to program microcontrollers such as Arduino boards, by using visual objects instead of  text to code.

If you go to the XOD.IO website >, you will be able to either launch the browser IDE or download the desktop IDE.

Now, we are going to use the browser IDE, so that you can see that there is also an online version of the IDE to develop your application. So, click on Launch Browser IDE and let's start!

Odoo • Image and Text

You will appear in the XOD.IO/IDE website, with its texts in the patch with a little bit of explanation and even exercises to help you learn easily.

The large gray area with boxes and text is the program itself, where you will be programming. It is called a patch, and they are like documents or source files in other systems. A project is made by multiple patches.

On the left-hand side, you will find a list of patches grouped by a project or library name. The list of these patches is called a Project Browser. If you expand them, you will be able to find more.

STEPS

In this tutorial, we are going to use the welcome-to-xod > 102-interactive patch to interact with an output by setting it to 0 or 1.
Expand the welcome-to-xod list, and double click on the 102-interactive patch. You should see the patch from the picture below with a little bit of explanation and an exercise that we will test in this tutorial.

As the Launcher Browser IDE can not upload the patch to the Arduino board, we are going to Download the Desktop IDE and continue with the steps. In case you do not find the 102-interactive patch in the XOD.IO Desktop IDE, select both nodes from the Browser IDE, and paste them in the Desktop IDE.

So, once we are in the 102-interactive patch, we have to find the field to change the pin number to be able to activate and deactivate a concrete output.

The M-Duino PLC has direct connections with the Arduino pins, as you can see in the following picture.

You can see more information in every user guide from the PLCs.

Odoo • Text and Image

In the M-Duino pinout from above, you can see that the output Q0.0 belongs to the pin number 36 Arduino Pin.

By default, it has set the built-in LED number 13. So, we will change the D13 for D36 in order to set the digital output Q0.0 to HIGH. 

Odoo • Image and Text

Once the port number is changed, click on the False node, and in the parameters on the left, change the OUT value from False to True.

Finally, plug your M-Duino PLC and power it with the power supply. Go to Deploy > Upload to Arduino... > Select the board model: Arduino Mega ADK > Click on Refresh, in order to detect the Serial Port where the M-Duino PLC is connected to > Important: Click on Debug after upload > Upload.

Now, the Q0.0 output from your PLC should turn on, since the tweak-boolean node is set to True. The debug mode allows you to change the value of the parameters dynamically without having to upload the code every time. So, change the tweak-boolean node to False, and see how it changes in your Arduino based PLC!

 
 

XOD.IO & Arduino based PLC: How to write an output
Boot & Work Corp. S.L., Fernandez Queralt Martinez
18 October, 2021
Share this post
Archive

Looking for your ideal Programmable Logic Controller?

Take a look at this product comparison with other industrial controllers Arduino-based. 

We are comparing inputs, outputs, communications and other features with the ones of the relevant brands.


Industrial PLC comparison >>>

Do you want more information?

Just fill the form!

Tell me more!