If this is for fun and you have C/C++ experience, then an Arduino will fit the bill.
If it does need a lot of reliability, replication, or sale to others, I would find a simple mobile machine controller from someone like ifm or TTC. These will generally allow you to use Codesys or C and will interface with mobile equipment better than an industrial PLC. They can be a bit more of a pain to work with due to often needing a harness, but for a product that is to be sold to something in that environment, they are the better solution and require no enclosure.