I am studying PLCs as a part of my Elements of Industrial Automation class. Trouble is, I can't imagine why would anyone use such a thing.
For complex tasks, microcontrollers are available. The vast majority of practicing programmers are well-versed in C, so creating a system with an ARM core (for example) is relative cheep. Furthermore, there are numerous free and tested RTOS for hard-realtime design to rest upon.
For massively parallelizable, hard realtime, low-latency tasks, there are FPGA-s. Those are a little harder to program. Yet there are many VHDL/Verilog guys out there in the job market.
Now to address the reliability of PLCs:
the PLC is designed for multiple inputs and output arrangements, extended temperature ranges, immunity to electrical noise, and resistance to vibration and impact
The same can IMHO be acheaved (and far surpassed) by extensive redundancy e.g. 3 identical systems operating simultaniously, upon detection of a problem in the primary system, another one, located at a different place, and programmed in a different way, kick in.
Where are PLCs used in modern industry? Why are they the best solution in those situations, instead of one of the solutions above?
if()
s inside that, check. \$\endgroup\$