Compile (F9)

Previous  Top  Next

Compiles the current source program. It works, according to context, of two different ways:

1.If the user builds or opens (reads or loads) from disk a program into LCE and orders that this one be compiled, as result of the compilation, if there is no error, is generated another program in the language Instruction List - IL, that will be also, automatically compiled (however, the instructions generated in this second compilation aren't visible to the user). If there is no compilation error, a ladder diagram will be drawn, representing the implemented control, that will be ready for simulation of its behavior. If there are compilation errors in the program into LCE, in the text area reserved to the program generated into IL will be presented the compilation errors - click on the little buttons at front for go to the point of the error in the program. If also there are errors in the list of instructions IL, is presented to the user other text area with the found errors (see note below).  
2.   If the user loads (reads) from disk a program in the language Instruction List - IL the program will be automatically compiled (the generated instructions in this compilation are not visible to the user), but if the program be written at beginning or be changed, the command of compilation must be explicitly selected. If there is no compilation error, the correspondent ladder diagram to the control program will be drawn, ready to be simulated. In the case of occurrence of errors, will be open a text area presenting the identified errors, that must be corrected keeping in sight the recommendations of the item 1 and note below.  
Attention: in the case of occurrence of errors, you should fix the errors from final to beginning of the source code, that is, check the errors of the lines of larger numbering first, because, as yet wasn't implemented dynamic pointers for locations of error in the source text, the repair of error at a location does that the static pointers of the errors toward the following positions remain out of the place, to distance from (size of text deleted - size of text included) characters of the correct points of errors. Notice still that, as occurs on compilations in all programming languages, subsequent false errors messages occur frequently, caused by precedent true errors.

: as occurs with all compilers, the code generated into IL by the compilation of a source program into LCE is, in general, less optimized and less elegant that equivalent code directly produced by a skillful programmer.

: the variables utilized in the Simulator can present any name, thus if there is error in the typewriting of the name of some meaningful variable, this will not be detected as compilation error, but only as warning.

For instance, on the following excerpt there will be a warning indicating use of the third variable Swich
, that wasn't associated to any variable in the clause var. If the user choose to continue the compilation, without correction, will be generated code considering that Swich is a third variable, different from I0.0 and not associated to any input or output point.

   I0.0   Switch,
(Swich) { turn_on Lamp; }