Node-RED & 7" Panel PC tutorial: How to test inputs and outputs
Node-RED and 7" Panel PC Applications
11 May, 2021 by
Node-RED & 7" Panel PC tutorial: How to test inputs and outputs
Boot & Work Corp. S.L., Fernandez Queralt Martinez


Introduction

Node-RED has multiple applications such as monitoring different values from inputs and outputs from open source projects.

So, in this blog you will learn how to activate different outputs, and how to check what is the value for the inputs from your open source Panel PC.

 If you want to know more about basics about inputs and outputs from our 7" Panel PC for industrial monitoring, check out the link below:

More info  >>

Node-RED

Related links

How to connect 
Raspberry PLC to Wi-Fi

Read >>

 

Basics about Raspberry Pi PLC
analog outputs

Read >>


How to find your
perfect industrial PLC

Read >>

How to program Raspberry PLC
interrupt inputs with Python

Read >>

Raspberry PLC
family products

Read >>

TouchBerry Pi
family products

Read >>

Explanation

In this blog, you are going to learn how to make a UI dashboard with Node-RED. By doing this, you will be able to enable or disable the outputs, and if outputs are enabled, you will be able to get the input values.

So let's start creating our Node-RED Application!


1. First of all, plug the Ethernet cable in your hmi industrial Panel PC, and power it on. 

2. Next, let's make sure that you already have Node-RED installed in your Panel PC for industrial automation by typing the following in a terminal window:

sudo systemctl status nodered.service

If you see that it is activated and running like in the picture below, it is working: 

Node-Red





3. Go to your browser, and type the following to connect through SSH to the Node-RED from the panel PC for industrial control:

http://10.10.10.20:1880/


4. Once you can see the browser-based editor, let's install first some nodes so that you can make a Dashboard easily:

    1. Go to the right menu 

    2. Click on Manage palette.

    3. Go to Install.

    4. Type and install: node-red-dashboard

    5. Type and install: node-red-contrib-ui-led

5. Now, add 5 switch nodes from Dashboard, one for each output. And configure each of them so that, when pressed, it sends a number 1 if it is On, and a number 0 when the switch node is Off:


Node-Red
















6. Now, add five led nodes for each output, just to show the status for the switch nodes and the outputs. Connect them:

Node-Red











7. Let's execute the commands and set the digital outputs when the switch nodes change their status. So, add five exec nodes and connect them to the switch nodes:

Node-Red











8. To keep getting the values of the inputs, you will follow only if the msg.payload.code is 0 while executing the command "set-digital-output" in your Industrial Panel PC monitoring. So, to each exec node, connect a switch node from the Return code output like shown below:

Node-Red











9. Once you have checked that the configuration of the digital output has been succesful, let's get the values of the digital inputs. Add five exec node next to the switch nodes, connect them and configure each one like this:

Node-Red












10. As the value you get from getting the input value is a string + '\n', you are going to delete the '\n' and convert it to a single number. Also, let's set it to the msg.payload, to be able to get it from the ui led node:

Node-Red











11. Once the msg.payload is the number that you get from the get-digital-input command, let's add five more nodes to add a led for each input:

Node-Red









12. Then, go to the Dashboard menu on the right > Layout > Tabs & Links > Hover on your tab > Layout.

Node-Red











13. You will see the Dashboard layout editor to display your Dashboard as you like!

Node-Red









14. Finally, click on the Deploy red button to save your changes and display your Dashboard succesfully in:

http://10.10.10.20:1880/ui


Tips

If in the Dashboard layout editor, you cannot resize the widgets, go to each Dashboard node, and modify the size section. Replace the Auto with any other, like 3x1. You will be able to modify them later on the Dashboard layout editor.

Now, enjoy your application using Node-RED and the Industrial Panel PC control from Industrial Shields to create as many open source projects as you want! 


Node-Red












Check out our YouTube channel to know more about Node-RED projects with our PLCs:

  • IOT Demo with Arduino Industrial PLC and industrial Raspberry Pi Panel PC. Dashboard created with Node-RED  >>

  • Node-RED inputs on INDUSTRIAL ARDUINO PLC. Example lesson from our FREE COURSE >>

Node-RED & 7" Panel PC tutorial: How to test inputs and outputs
Boot & Work Corp. S.L., Fernandez Queralt Martinez
11 May, 2021
Share this post
Archive

Looking for your ideal PLC?

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!