Industrial manufacturing
Industrial Internet of Things | Industrial materials | Equipment Maintenance and Repair | Industrial programming |
home  MfgRobots >> Industrial manufacturing >  >> Manufacturing Technology >> Industrial Technology

Maximizing PLCnext Engineer Simulation: Connect to Node‑RED via REST

Hello Community!

When we meet with PLCnext Technology, as developers we can’t wait to try its functionalities 😊 So, with the great milestone of New PLCnext Engineer Simulation and inspired by this article Node-RED communication with an AXC using the PLCnext Connector now we can interact from our simulation environment with Node-RED, and in this way, test IoT functionalities before we have the hardware on the table.

Installing Node-RED on Windows 10

Node-RED can run on multiple platforms, it's a very lightweight visual programming tool that we can install in our PLCnext controllers (on a Docker container for example) and also in a PC. For this demo, follow the installation steps for Windows 10 in this guide. After that, you can run the application using the cmd tool or PowerShell with the command node-red.

Once it's running, just type in your favorite web browser the the URL http://localhost:1880.

Downloading Node-RED connector for PLCnext

The following article show us how to download and use a node to connect our PLC variables in PLCnext Engineer with Node-RED via REST, you can found more information in the npm repo. So, in this step you only have to search the node in the Manage Palette and install it:

Maximizing PLCnext Engineer Simulation: Connect to Node‑RED via REST

Configuring PLCnext Engineer Project

You need to install the Firmware image for AXC F 1152 from the Phoenix Contact website and the software PLCnext Engineer >= 2022 version to use the Simulation environment.

  1. Create a project for that controller, go to the Cockpit area and then change the connection to “Simulation”.
Maximizing PLCnext Engineer Simulation: Connect to Node‑RED via REST
  1. Choose the program variables that you want to share with Node-RED checking the “HMI” box.
Maximizing PLCnext Engineer Simulation: Connect to Node‑RED via REST
  1. Go to the Plant area and double click on HMI Web Server. Enable REST interface checkbox.
Maximizing PLCnext Engineer Simulation: Connect to Node‑RED via REST

That’s all! Connect and download the project to your simulation environment. Remember that the credentials are “admin” as user and “plcnext” as password.

Check connection in Node-RED

You can try a “plc-browse-items” node to add the PLCnext connection. You have to use the same credentials and enter in Host IP the URL “localhost:5050”.

Maximizing PLCnext Engineer Simulation: Connect to Node‑RED via REST

Deploy your code and voilà! Your connection is ready to read and write your PLCnext program variables in your favorite 61131-3 language 😉

Maximizing PLCnext Engineer Simulation: Connect to Node‑RED via REST

If you want to know more about REST data interface, you can visit the Info Center.

Happy code!


Industrial Technology

  1. Maximizing the Potential of STL Files for Flawless 3D Printing
  2. 6 Expert Tips to Maximize Your Preventive Maintenance Program
  3. Maximizing the Performance of Your Industrial Physical Assets
  4. Maximize Efficiency: Expert Tips for Your Warehouse Scanning System
  5. Unlocking Value in Bulk Chemical Plants: Strategies for Growth
  6. Maximizing Value from Safety Audit & Inspection Findings
  7. Connect Node-RED to PLCnext Controllers with the New REST API Connector
  8. Effortless Remote RS232/RS485 Connectivity for PLCnext PLCs Using Pseudo TTY
  9. Build Your First Go Application on PLCnext: A Beginner’s Guide
  10. Maximize Efficiency and ROI in Your Workcell with Advanced Simulation