Codesys, or one of it's derivatives such as TwinCAT, is possibly the most widely used PC based PLC. The nice thing about it is that you can write a program that runs on a PC, then use the same program to download to a hardware based real-time controller, such as a Beckhoff CX8090.
Codesys also has a Raspberry Pi based run time (non-real time) that turns a Pi into a PLC that can you use the GPIO. It also supports Ethernet/IP as scanner or adapter, EtherCAT, and Profibus directly from the Ethernet port. On top of it there is a web based HMI built into it. Quite an impressive set of features for less than $100
I've been playing around with Codesys using an industrialized Raspberry Pi along with Beckhoff EtherCAT IO and have it setup as an Ethernet/IP adapter to a CompactLogix.
If you download the free Codesys development environment, it also installs a non-real-time run-time on your same PC that you can download programs to and they will run for 2 hours.