I do not agree with firejo at all, a factory PLC will be out of service after 10 years, and nobody has spareparts, and if then expensive ones.
Ummm, no. PLCs typically have a 20-year life cycle. There are tons of PLCs that have been around for the past 10 years or more. CompactLogix has been around at least that long, as has the I/O, and there are no signs of that slowing down. Replacement parts are easy to find.
As raspberry and arduino are so cheap i send 2 units to a project, and the raspberry is capable of codesys so standard 61131. an arduino is standard C and also very easy to program, (and a lot faster as any PLC is.
(even better what processor is in a micrologix?)
Easy to program, for you, but hard to troubleshoot for the maintenance technician who is used to ladder logic. Are you personally going to go troubleshoot every machine you deploy whenever they have issues for the rest of their production cycles, day or night, 7 days a week, 365 days a year, rain or shine, no matter where they are? I doubt it.
Time and time again I see you microcontroller guys make these grand statements, but you just don't get it. If you make something hard to troubleshoot, it costs your customer money. Even if you are a robot who can clone himself and doesn't require sleep, that extra time it takes you to get to the job site to even start looking at the problem potentially cost your customer tens of thousands of dollars in downtime.
Only foolish people consider the sticker price of a piece of hardware as the only basis for decision-making. The hardware sticker price is not the total cost of ownership. If a customer of mine found out that I could have saved them tens of thousands of dollars of downtime by spending a few extra hundred on a PLC that their maintenance technicians could troubleshoot, they'd never do business with me again. That "cheap" Raspberry Pi cost them more than a full Control Logix Rack in the end!
And we haven't even talked about hardware environmental ratings.
Sure, the Raspberry PI is faster. But in the industrial environment, processor speed takes a backseat to reliability. If my entire program scans every 2 milliseconds, what good does a faster processor do me? None. I don't need a faster processor. I need a RELIABLE processor. The picture here is bigger than clock speeds and cores.
The simple fact of the matter is that Arduinos and Raspberry Pis have no place in the industrial automation environment. They're not rugged enough, they're not user-friendly enough, and who's to say they won't be obsolete and difficult to get in 10 years? What if the MicroSD card that holds everything goes bad and they don't make MicroSD cards anymore? I find it puzzling you're worried about obsolesence in the Automation world and offer up an IT world solution where parts and systems go obsolete orders of magnitude faster than industrial automation systems.