This paper reports the implementation of an automatic system for programming programmable logic controllers (PLC) using as an input scripts that describe the control logic of automated manufacturing/assembly cells. The systems makes use of the object oriented paradigm for representing all the manufacturing entities that participate in a given application and their relationships. Though the use of the object oriented paradigm, issues such as consistence and traceability are guaranteed. The implementation of the code generation module is made by using the definite clause grammars methodology, that allows construction of compilers, interpreters and code generators in a readable manner. The user can define once the control logic for an application, and generate source code for a selected PLC many times as he/she needs giving reusability to all the programs generated. Through the use of this kind of systems, the programming task, that is an error prone activity, Is enhanced and can be performed attaining high productivity and reliability levels. The systems was written in Arity Prolog and runs under Windows on a personal computer.