News & Articles Applications

Using data from the internet in a PLC application

Alex@PLCnextTeam 08 May 2022 10 min. read
772 views 0 comments LoadingSave

A lot of information is (freely) available in the cloud and on the internet. For example, think of energy prices, water levels in our rivers or weather information at a certain location in the world. It can be very interesting to use this actual information including the predictions in future control applications. This makes it possible to develop new technological applications that proactively respond to current and future situations.

It is It is important that access to the machine or installation is protected as much as possible. This can only be achieved through deep integration of various security mechanisms and processes at all levels of industrial control, the associated development environment and the communication protocol.

Easy access to current or predictive data

Not every PLC programmer has the necessary IT knowledge to realise this. It is therefore important that these services are also made easily accessible to them, in a way that is known and safe to them. The PLCnext Technology therefore offers both onboard cloud connectors and the necessary security (Security-by-Design) out-of-the-box, so that PLC variables can be easily and safely pushed to the cloud.Not every PLC programmer has the necessary IT knowledge to realise this. It is therefore important that these services are also made easily accessible to them, in a way that is known and safe to them. The PLCnext Ecosystem offers the necessary elements for this; the PLCnext Controllers offer the necessary security out-of-the-box (Security-by-Design); and the PLCnext Store offers apps for this that can be installed on the PLCnext Controller just as easily as with the Smart Phone.  Depending on the installed app, the PLC programmer can then access current or predictive data from the Internet in his classic PLC program, for example.

PC with dashboards on screens in a control room

App development for the PLCnext Store

If an app that provides the required functionality or information is not yet available in the PLCnext Store, it can still be developed. Software engineers who have followed the PLCnext Certified Engineers Expert program have learned how to make a PLCnext app during this training course. But also on the PLCnext Store Info Center you can read how an app for the PLCnext Controllers can be developed. These apps can be provided for free or for a fee by the developer on the PLCnext Store. 80% of the proceeds go directly to the app developer!

In addition, it does not have to be complicated to ‘only’ use a piece of existing code or (Open Source) software in a control application on a PLCnext Controller. The PLCnext Store Info Center describes how, for example, a C++ application can be integrated as a real-time PLCnext Runtime application or as a native Linux application.

Sample application with OpenWeather

For example, we have written a small C++ application for the PLCnext Controller for inspiration. Information is requested from and received from a server on the internet via a so-called Application Programming Interface (API). An API provides a type of data link for a computer program that can request information from a web page containing text and images. For this we have created an account at OpenWeather and received a password (API key). With these login details, the C++ application requests information from their server via the OpenWeather API and then receives this data (in JSON or XML format).

The PLC (IEC) program on the PLCnext Controller can then access this data, just like the local NGINX HTML5 web server on the PLCnext Controller. In this case, therefore, current and predictive weather reports from OpenWeather for the GPS coordinates provided by us.

Sequence of runtime

Enrich your applications with apps

Using the apps in the PLCnext Store, also PLC programmers without IT knowledge can easily and securely access cloud services and information on the web. And if the required app does not yet exist, it can still be developed.

Do you have a great idea for an app, but don’t have the time or knowledge? Let us know, because we may be able to develop it for you.

Alex @PLCnextTeam
772 views 0 comments LoadingSave

Discussion

Please login/register to comment

Login/Register

Leave a Reply

Newsletter
Never miss a new article
Sign up for the newsletter
Never miss news about PLCnext Technology
Get interesting content via newsletter four times a year
Receive exclusive information before all other users