Delta Tau GEO BRICK LV User Manual

Page of 440
Turbo PMAC User Manual 
Writing and Executing PLC Programs
 
381
 
If an Option 5x0 standard memory configuration is ordered, 48K words of program memory are available 
for the machine code of compiled PLCs (P:$050000 through P:$05BFFF).  If an Option 5x3 extended 
memory configuration is ordered, 432K words of program memory are available for the machine code of 
compiled PLCs (P:$050000 through P:$0BBFFF).  The Executive program’s downloader will tell you 
how many words of program memory are occupied by the PLC programs you just compiled and 
downloaded. 
For general data memory, most users will utilize some of Turbo PMAC’s 8192 P-variables for floating-
point values.  If just a few open registers are desired for use, the registers at X/Y:$0010F0 – 
X/Y:$0010FF are unused by any firmware task, other than to be zeroed automatically at power-up/reset. 
For large amounts of extra data memory, it is recommended to use the “User Buffer” setup with the on-
line DEFINE UBUFFER command.  The User Buffer occupies a number of registers at the high end of 
X/Y data memory.  With an Option 5x0 standard memory configuration, the end of data memory is at 
X/Y:$0107FF; if DEFINE UBUFFER 2048 is declared, all data memory from $010000 through 
$0107FF is reserved for your own purposes.  With an Option 5x3 extended memory configuration, the 
end of data memory is at X/Y:$03FFFF; there is by default a User Buffer of 65,536 words, reserving all 
memory registers from X/Y:$030000 to X/Y:$03FFFF for your use.  It is your responsibility to make sure 
that registers in the UBUFFER utilized for Open Servo data storage are not used for other purposes as 
well. 
Compiling the PLCs 
The download function of the PMAC Executive program’s editor will compile these PLCs automatically 
and transmit the resulting compiled machine code to the Turbo PMAC.  The process of compilation is 
basically invisible to the user, requiring no more work than downloading interpreted programs or on-line 
commands. 
The downloader observes the following rules in processing the editor file: 
• 
The downloader automatically incorporates the contents of any file reference with a #include 
directive.  If the contents of the included file (e.g. macro substitutions) are referenced in the main file, 
the #include directive must precede the use of the contents. 
• 
The downloader automatically takes note of any macro substitution set with a #define directive.  
Such a macro substitution directive must precede the use of the macro name in the file, whether made 
directly in the file, or accessed through a #include directive. 
• 
The downloader automatically recognizes L-variable and F-variable definitions, and uses them for 
subsequent compiled code, but does transmit these statements to Turbo PMAC, as it would for M-
variable definition statements. 
• 
The downloader recognizes three styles of comment delimiters.  All characters from a semi-colon (;) 
or a double-slash (//) to the end of the line are ignored; all characters from a “slash-star” (/*) to a star-
slash (*/) are ignored. 
• 
The downloader will attempt to compile all statements between OPEN PLCC n and CLOSE, except 
comments.  The CLEAR command is not required after OPEN PLCC n, because the act of 
downloading new compiled PLCs automatically erases the existing version.  However, there is no 
need to remove the CLEAR command for the compiler.   
• 
The downloader automatically erases all of the compiled PLCs in the Turbo PMAC if it encounters 
any compiled PLCs in the file(s) to be downloaded.  Therefore, it is necessary to compile all of the 
PLCC programs together every time.  A change to a single PLCC program requires re-compilation of 
all of the PLCC programs. 
• 
All other commands are passed unchanged through the compiler to the output file. 
The downloader places the compiled PLC code in Turbo PMAC’s active, but volatile SRAM memory.  
To retain these programs through a power-cycle or reset, copy them to Turbo PMAC’s non-volatile flash 
memory with the SAVE command.