How would you write software to interface with a Programmable Logic Controller (PLC) or other factory automation hardware?