Because it's agile* (doing things piecemeal).
To make development easier and safer, a process simulation allows us to exercise, test, and validate our PLC logic without a physical connection to the actual process hardware.
TL;DR
Many systems are fairly trivial and can be simulated in a few rungs e.g.
- if the air-pump is running, then increment pressure (value of integer or float variable) by 1psi every 100ms; pressure will reach 200psi in 20s.
- if air-pump is not running, then hold pressure at current value
- if the solenoid valve is open, then decrement pressure by 1psi every 100ms.
That is not a high-fidelity model, of course, but it is good enough to validate most the logic of the PLC trying to control it. And I can run it on my PC using the PLC emulator that Click provides, while I am still waiting for the physical PLC to arrive.
* WAY-TL;DR: Pluto TV is a streaming service that is basically broadcast TV i.e. with lots of commercials. But it also has some great (in the eye of the beholder
) channels; one of those channels is the Ed Sullivan channel, which has clips of various acts that were on the Ed Sullivan show over 23y several decades ago. One act is a guy on a unicycle juggling while balancing a stick vertically on his forehead. I suspect he did not learn to do that trying to all three things at once. Surely he learned to just ride a unicycle, then just juggle the pins, and then just balance the stick, before trying any combination of those three ski;ls.
Developing computer programs can be accomplished (performed) the same way, and it also has the benefit of not being overwhelming when looking all at once at
everything we want the program to do.
So, pick a single task, e.g. can I convert and scale the pressure sensor signal to a floating-point REAL value in the PLC? Once that is working, try something else e.g. can I set or clear a bit based on whether the pressure is above 200psi or not?
Two things will happen with this approach:
- By working a sub-task on one aspect of the process, we learn about other aspects of the process
- E.g. while learning to convert and scale the pressure sensor signal, we run the air pump and get an idea about how the pressure responds to the air pump speed.
- What we learn in earlier sub-task will allow us to make better choices in later work.
- E.g. we might realize that if we run the air pump at 100% and turn the pump off at 198PSI, the pressure will overshoot 200PSI by only a few PSI, so there is no need to ramp up the pump speed gradually.
- We won't initially know when we are done: we will finish the last sub-task, and look for the next sub-task, only to either realize that there are no more unfinished sub-tasks and the program is complete, or learn that the other sub-tasks, which we thought were needed, will not provide enough benefit to justify the effort to do them, and we know this because we learned so much about the process while completing the other tasks.