PLC code generator