Web servers can be an ideal method for distributing IoT information. Here’s a look at the advantages and disadvantages for two different development approaches.
Don Pham, Sr. Product Manager at IDEC Corporation
Internet of Things (IoT) implementations deliver the most value when they distribute information through the Internet. One of the best ways to do this is by using a programmable logic controller (PLC) or a human machine interface (HMI) with web server capability to create web pages, which can then be viewed on any remote device connected to the internet and capable of supporting a web browser. These web pages can also be used to change values within the PLC or HMI, providing two-way interfacing from remote devices such as laptops, smartphones and tablets.
A main challenge with this approach to IoT information distribution is creating the detailed web pages for viewing and interaction with remote devices. Hard-coded HTML programming is an option, providing the opportunity for virtually unlimited customization, but requiring a high degree of expertise on the part of the HTML programmer.
Another alternative is to use a specific web page editor tool within the PLC or HMI programming environment, but such tools are not provided by all PLC and HMI vendors. Even when this feature is provided, care must be taken to evaluate the offering for ease of use, ability to customize, and other capabilities.
We will compare the two main methods of creating PLC/HMI-based web pages: HTML programming versus using a web page editor incorporated within the PLC or HMI programming software. While we focus on PLCs (Figure 1), much of the discussion is also applicable to HMIs. We will look at the advantages and challenges of each method, and show how each can be implemented with a PLC-based automation system.
But first, let’s look at why web servers are often the best choice for distributing IoT information.
Serving information to browsers
The “T” in the term “IoT” can refer to any number of individual smart devices, as well as somewhat larger intelligent equipment. Basically, any low-level networkable device capable of transmitting status information and possibly accepting commands can be included under the IoT umbrella as a “Thing.” These IoT devices are often spread over a large area within a building, facility, or outside.
End users would usually prefer to view IoT information through a handy web browser interface, but a few steps are required to achieve this goal. Coordinating the data flow to users can be a challenge with so many disparate sources. A brute force approach where all top-level systems, such as a supervisory control and data acquisition system, interrogate all low-level resources could be complex and inefficient. A better approach is to incorporate local elements that can concentrate and pre-process the data and organize the traffic.
For most facilities looking to take advantage of IoT devices, it is quite common for PLCs to already be distributed throughout the site to perform local automation tasks. These systems are ideal for IoT edge data processing because they normally have the requisite computing power and connectivity options, including the Ethernet connectivity needed to interface with the IoT. Not only that, but they are engineered for the more difficult and harsh environments encountered in field locations.
When the right PLCs are already in service and positioned, it makes sense to use these platforms to locally aggregate IoT communications by performing edge data processing. Otherwise, it is still economical to add PLCs, or upgrade those in operation with contemporary versions offering the right features.
When configured to process the incoming IoT data and present it in a web page format, PLCs can become a universal bridge to higher-level web-based users. They represent a convenient and cost-effective solution to the problem of serving information up to any web browser, whether it’s hosted on a PC, smartphone or tablet (Figure 2).
But having the hardware in place is just the first step; configuring it is the next.
Web pages are traditionally coded using hypertext markup language (HTML), which is a standardized text-based way to describe how dynamic information and static content will be displayed on a client’s web browser when viewing the page. HTML is flexible and is a foundational part of most modern internet web pages.
Unfortunately, web developers must have significant programming experience to fully harness this power (Figure 3). The programmer needs to identify tagged “live” information within the PLC and connect it to meaningful displays. This sort of data linking is a native ability of web-capable PLCs. Programmers then need to incorporate images, text and other features to represent the information in a useful manner on the web page. Writing HTML in this way to end up with a suitable result is not a trivial undertaking.
To be sure, a PLC offering web page serving capabilities is a vast improvement over previous generations, which required proprietary visualization software. While dedicated HMI software offers specific configuration features to help users create graphics, it also imposes licensing and deployment constraints far more restrictive than an open web browser implementation.
Fortunately, some vendors now offer a hybrid approach where a user-friendly configuration environment enables developers to create PLC-based web pages using the PLC programming software.
Built-in web page editor
Consumer-oriented software products are heavily focused on delivering an intuitive user interface, but industrial and IoT applications aren’t always known for such niceties. That’s why it is notable for a PLC platform to offer a built-in web page editor that can help users create professional, interactive and dynamic web pages—while minimizing the required effort and cost.
For instance, the IDEC MicroSmart FC6A Plus PLC family includes a native web page editor within its WindLDR PLC programming software. Some other PLCs and HMIs offer similar capability, which should be evaluated prior to purchase to verify ease of use, features and performance.
This embedded web page editor means no separate product or installation is needed, and it is designed for any skill level from novice to advanced. In fact, the web page editor operates within the standard web browser of the user’s choice, such as Internet Explorer, Chrome or Firefox.
No programming experience or HTML knowledge is needed, which represents a major advantage over similar products. To make things as easy and intuitive as possible, there are pre-built objects and symbols, which can simply be dragged-and-dropped onto a web page configuration (Figure 4). The range of available dynamic objects includes typical operator interface symbols such as buttons, numerical indicators and bar graphs. Other symbols include factory equipment images such as vessels, pipes, and valves. These libraries enable users to efficiently construct detailed and professional web pages to represent control and IoT systems.
When objects are dropped into the web page editor, available PLC addresses from the PLC programming software are automatically populated for users to select. For example, a user could drop in a tank image and superimpose a vertical bar graph indicating the tank level monitored by the PLC (Figure 5). Users can focus their efforts on applying their creativity to the design, since the technical details are handled by the configuration software. The end result is that IoT devices can be accessed with basic default or fully customized web pages.
Web pages are stored in the PLC’s on-board 5 MB of internal memory, or more extensive configurations can be saved in the optional 32 GB SD card. There is therefore plenty of space for professional web pages with significant graphical content. The PLC is simply connected into the user’s network using one of the two built-in Ethernet ports to make the web pages available to any browser, once proper security procedures are satisfied.
With proper IT configuration to grant the site network internet connectivity, even more advanced notification capabilities such as emailing or text notifications (using third party servers such as Gmail or Yahoo!) are possible. This extends the web page solution from being a user-initiated event and makes it into an automated alert generation system.
The increasing availability of IoT products and other intelligent devices means end users need ways to access and take advantage of this newly obtainable data delivered by these devices. Web browsers viewed on laptops, smartphones, and tablets provide an easy and natural way to deliver this content through web pages.
PLCs are often conveniently located in close proximity to field-installed smart devices, and durable enough to install in remote environments. Hosting web pages at the PLC level is therefore a logical and cost-effective fit, with the only downside being the need to generate complex HTML coding as required for traditional web page design.
A web page editor integrated with the PLC programming software address this issue. This type of intuitive and easy-to-use web page creation tool is built in to the programming software at no extra cost and enables users to readily create rich and functional web pages with minimal effort. These web pages painlessly deliver IoT information on-demand to any user with a browser-capable device, and also offer these remote users the ability send commands to the PLC.