Technical Article

What is Firmware, and Why is PLC Firmware Important?

July 21, 2022 by David Peterson

Inside a controller, code is interpreted into the binary signals that influence input and output signals, flags and registers, and even the communication of network signals. This is the job of firmware.

Understanding the overlap between hardware and software can be a difficult topic in any industrial control system. Often, we think of hardware as the physical parts and pieces that connect to the real world, with the software being the programs and routines that execute logic and cause predictable action. 

This simplified definition is mostly correct, but it assumes that the two pieces work independently of each other and can be researched and studied separately. Not the case at all.

 

What do Hardware and Software Mean?

The names of hard and software are derived from their capacity to be flexed and molded quickly as a situation changes. Hardware is the least flexible. Once you purchase a specific part, you may have little to no capacity to upgrade the system without purchasing a replacement. Software, on the other hand, provides plenty of opportunities to make edits in an instant but requires a processor in the digital controller to actually make effective changes in the real world.

No programmable control system can survive without either of these configurations in place.

 

Firmware vs Software - What’s the Difference?

A program is compiled on a computer then downloaded to the controller all with a proprietary software called an integrated development environment (IDE), such as a PLC or HMI programming software. 

 

Firmware is bridge between hardware and software

Figure 1. Firmware provides the bridge between hardware and software.

 

Inside the controller, the code must be interpreted into the actual binary signals that influence the actions of input and output signals, internal flags and registers, and even the communication of network signals. This is the job of the firmware.

Depending on the hardware included in the system, the program may not be able to execute certain commands. For example, if a CPU version is not built to be connected to a certain high-speed module, any commands referencing that module would create an error. 

In this case, the firmware version of the controller, which dictates all of the hardware-level interaction abilities, would be designated with a particular revision number. The software must also recognize those limitations and inform the programmer that they must not use those commands or risk faults or corruptions on download.

Because of this risk of faulty programming, many programming environments will require the programmer to select a firmware revision number before programming. This will eliminate any incompatibilities between the hardware and software. If the revision selected does not match the revision in the controller, the download will not be permitted.

 

Can I Switch Firmware Revisions?

This question has two separate answers. In the case of software, it is usually more simple to select a firmware revision appropriate for the controller you wish to program. However, you usually cannot make this change during programming. The current project must be abandoned and re-started with the proper firmware selected. If major changes have occurred, you might even need to rebuild the project entirely, though conversion applications may be available.

Regarding switching to new firmware in the controller hardware, this matter may be far more difficult. Some devices with embedded controllers may be able to change firmware with a process known as ‘flashing’. A new firmware revision may be older or newer than the current version. This process requires locating a file, obtaining appropriate flashing software, and a reliable communication path to the CPU. This is not something that would be done on a routine or casual basis.

 

Software and hardware must match with same firmware revision

Figure 2. Software and hardware must be matched with the same firmware revision to ensure compatibility with programs and processes. Image used courtesy of Canva

 

How Do I Flash Firmware in a CPU?

Any current, older, or newer firmware files must be located and downloaded, usually from a manufacturer’s website. 

The flashing software must also be located and installed. In the case of most industrial controllers, the programming software has either a built-in flash application or an app included in the software package. 

Connect using a recommended interface. Usually this will be USB or serial since even network interface card protocols may be overwritten during the process and losing communication during the upgrade would be a fatal error for the equipment. This fatal error is sometimes endearingly referred to as ‘bricking’ the controller.

With these steps in place, the flashing application will guide the programmer through any required steps and the process should be complete.

 

digital industrial equipment is supplied with firmware

Figure 3. Nearly any digital industrial equipment (in other words, containing a PCB with any programmable element) will be supplied with firmware. Image used courtesy of Canva

 

When is Flashing Firmware Required for a CPU?

First, identify the reason for switching. If there is suspicion of a firmware corruption, the current firmware revision is probably the best option. Older versions may be desired if the programming software is likewise an older version. Finally, newer firmware can allow connection to any specific or special-purpose new modules that may have been recently developed.

Devices other than CPUs may also have firmware, such as an HMI, or an I/O module. These devices still execute digital processing functions, and therefore they need a translation from program to binary execution. For these to be flashed, if they can be flashed at all, a small set of exposed pins on the circuit board (usually hidden behind small plastic doors on the casing) will provide the connection terminal.

Flashing firmware should never be considered a first resort in troubleshooting a problem. When a process is working but then suddenly fails to work, firmware corruption is probably not the issue. Sometimes a call with an OEM service line may recommend this step, and it helps to have knowledge of the process before proceeding.

 

Summary

Firmware is not as familiar as either software or hardware, since both are highly visible and tangible in any workplace. Understanding the relationship between the three pieces can help to give a better understanding about how and why certain applications can be done in some cases but not in others. It’s good to be familiar with the concept, even if you may never need to flash new firmware into your own controllers.