The PLC Programmable Logic Controller programming is a time consuming task and it needs specific knowledge about the programming language and especially of the PLC, which makes it an expensive work by the need of a high qualified professional. This paper proposes a technique to create programs to PLCs by means of Genetic Programming (GP). As objective function, a group of scenarios were used, which represents the behavior of the automated ambient and that can be defined in an intuitive way without previous knowledge of the PLC or a programming language. The technique showed to be generic for many problems and efficient in finding fast different solutions. With an after-processing analysis, the results indicated parameters configuration that optimizes the genetic search.