Blog post by Nick Sadro, Electrical Engineer
Anyone who has programmed, in industrial automation or other areas, will admit their first draft of the program is never perfect. Programmers try to review their code as best as possible, but reading lines of code is not an easy way to detect issues. Usually, most issues are discovered once the programming “goes live” in a machine or a software package. Discovering problems when the code is running can be quick and straightforward. However, code bugs can be harmful to data, machinery, or even people. In industrial automation, one way to detect problems is to simulate the program before installing it in a machine. Most PLC programming environments include a platform to simulate PLC programs before install. This digitalized approach prevents potential problems caused by code bugs. With Siemens TIA Portal, PLCs can be simulated using the built-in simulation software PLCSIM and WinCC Runtime Advanced can be used to simulate HMIs.
To launch PLCSIM in TIA Portal, simply select the PLC you wish to simulate, then click the “Start simulation” button on the toolbar.
When simulating PLCs with PLCSIM in TIA Portal, the PLC can be switched between run, stop, and memory reset exactly like an actual PLC.
Code blocks can be monitored exactly as if they were monitored on a running PLC. Using force or watch tables, data can be modified and input can be triggered as if it was actual input from a physical machine. The example below shows a network from a simulated PLC with the inputs forced to specific values. The red “F” indicates that an input is being forced.
The ability to run code without a physical PLC or machinery can be a great benefit to debugging and can help catch issues before they cause expensive damage or downtime. With Siemens PLCSIM and TIA Portal, simulating and monitoring code is quick and easy.
Another important component in many industrial automation projects is the human-machine interface, or HMI. These screens can be very detailed and complicated to set up. Usually, starting up a machine can include a lot of HMI debug. Onsite debug on a customer floor can be costly to the integrator and the end customer. As with PLCs, simulating the HMI programs before install can drastically reduce glitches and startup time.
To simulate an HMI, select the device from the project tree, then click the “Start simulation” button on the toolbar.
Using WinCC Runtime Advanced with TIA portal, HMI debug can be done in advance to reduce costly onsite debug time. If setup correctly, the simulated PLC and HMI can be connected to fully simulate a system without ever leaving your desk. This helps ensure system start-ups go smoothly without any major issues.