User's Manual

PMAC User Manual
244 Writing a PLC Program
If the compiler can compile the entire file successfully, it will create an output file containing the PMAC
machine code in form that can be directly downloaded to PMAC. This file has the same name as the
input file, but with a .56K extension. The following message displays on the screen:
*** PMAC PLC Compiler V1.2 04/28/94 ***
*** PLC compile complete, no errors ***
*** Downloadable PLCC code in file MYPLCC.56K ***
*** PLCC program memory use: 7343 of 15360 words ***
If the compiler finds an error, no output file is created. The compiler stops on the first error that it finds.
The following message displays on the screen:
*** PMAC PLC Compiler V1.2 04/28/94 ***
*** Compilation aborted due to error ***
*** Compile error #: 35 ***
*** PLC source file line: 27 ***
Compiler Errors
The compiler can report the following errors:
Number
Type of Error
33 Unable to pack floating point number
34 Unable to convert string to float number
35 Illegal Command or Format in string
36 Integer number out of range
37 Unmatching parenthesis
38 Illegal Else Cmd
39 Illegal EndIf Cmd
40 Illegal EndWhile Cmd
41 PLCC Output File Error
42 PLCC Input File Error
43 Unclosed If or While Cmd
44 PLCC 56k maximum memory exceeded
45 PLC 56k conversion stack exceeded
46 First pass of Tokens exceeded maximum
47 Far heap allocate error
48 String must be in quotes & < 255 char
49 L-Variable address not defined
50 Two L-Variables with same address definition or has
already been defined
Compiler Processing
The compiler observes the following rules in interpreting the input file:
Comments – all characters from a semicolon (;) character to the end of a line – are ignored, and they
are not passed on to the output file
The compiler recognizes and uses L-variable definitions, but does not pass them on to the output file.
All statements between OPEN PLCC n and CLOSE, except comments, are compiled into DSP
machine code. The CLEAR command is not required after OPEN PLCC n, because the act of
downloading new compiled PLCCs erases the existing version automatically. However, there is no
need to remove the CLEAR command for the compiler.
For each compiled PLC n that is created, the compiler will add the commands OPEN PLC n
CLEAR CLOSE to the output automatically. When sent to PMAC, this erases the uncompiled PLC
of this number automatically. The reason this is done is to prevent uncompiled and compiled versions
of the same PLC from trying to execute simultaneously.