omron — PMAC Quick Reference

PMAC Quick Reference Guide Compiled PLC Programs PLCCs are compiled by PEWIN in the downloading process. Only the compiled code gets downloaded to PMAC. Therefore, save the ASCII source code in the host computer separately since it cannot be retrieved from PMAC. Compiled PLCs are firmware dependent and so they must be recompiled when the firmware is changed in PMAC. If more than one PLCC is programmed, all the PLCCs code must belong to the same ASCII text file. PEWIN will compile all the PLCC code present on the file and place it in the appropriate buffer in PMAC.

If a single PLCC code is downloaded, all the rest of the PLCCs that might have been present in memory will be erased, leaving only the last compiled code. The multiple-file download feature of the PEWIN File menu allows the PLCC codes to be in different files. They are combined by PEWIN in the downloading process. The use of L-Variables in a PLC program statement tells the compiler that the statement is to be executed using integer operations instead of floating-point operations. To implement integer arithmetic in a compiled PLC, define any L-Variables to be used and substitute them in the programs for the variables that were used in the interpreted form (usually M-Variables).

The compiler will interpret statements containing only L-Variables (properly defined) and integer constants as operations to be executed using integer arithmetic in compiled PLCs. Preparation of compiled PLCs is a multi-step process. The basic steps are as follows: 1. Write and debug the PLC programs in interpreted form (simple PLCs programs). 2. Change all references to PLCs to be compiled from PLC to PLCC. 3. For integer arithmetic, define L-Variables and substitute these for the old variable names in the programs. 4. Combine all of the PLC programs to be compiled into one file on the PC. 5. Make sure the Support MACROs/PLCCs option is checked before downloading. 6.

Activate the compiled PLCs. If operation is not correct, return to step 1 or 2. 7. PLCCs can be deleted using the DELETE PLCCn command (replace n by the appropriate number). 66 PLC Programs