PMAC Quick Reference Guide Most of the housekeeping functions are safety checks such as following error limits and overtravel limits. Since compiled PLCCs are executed at the same rate as the housekeeping functions, code to complement or replace these functions could be placed in a compiled PLCC. If, for example, an extra input flag is wanted for position capturing purposes either the end-of-travel limit inputs or the amplifier fault input could be used.
The automatic check of the input flag could be disabled by an appropriate setting of the corresponding Ix25 variable and replaced by a PLCC code that will check a general purpose input where the amplifier fault or end-of-travel limit would be connected instead. On power-up\reset, PLC programs are executed sequentially from 1 to 31. This makes PLC1, the first code executed, the ideal place to perform initialization commands like other PLCs disabling, motors phasing and motion programs start. After its execution, PLC1 could disable itself with the command DIS PLC1, running only once on power-up\reset. Bits of the first word returned from the global status bits request command, ??? :
Bit 22 Real-Time Interrupt Re-entry: This bit is 1 if a real-time interrupt task has taken long enough so that it was still executing when the next real-time interrupt came (I8+1 servo cycles later). It stays at 1 until the card is reset, or until this bit is changed manually to 0. If motion program calculations cause this, it is not a serious problem. If PLC 0 causes this (no motion programs running) it could be serious. Bit 20 Servo Error: This bit is 1 if PMAC could not complete its servo routines properly. This is a serious error condition. It is 0 if the servo operations have been completed properly.
Priority Level Optimization Usually, PMAC will have enough speed and calculation power to perform all of the tasks asked of it without worry. Some applications will put a large demand on a certain priority level and to make PMAC run more efficiently. When PMAC begins to run out of time, problems such as sluggish communications, slow PLC/PLCC scan rates, run-time errors, and even tripping the watchdog timer can occur. The active part of the Encoder Conversion Table is ended by the first Y word that is equal to all zeros.
For an application with less than eight encoders (the default table converts the eight incremental encoder registers on the base PMAC), a last entry with all zeros in the Y word could be defined as necessary. Check to see if everything performed in the Real Time Interrupt (RTI) is necessary or if some of it could be moved to a lower priority or slowed down. PLC0 could be done as PLCC1, or the RTI could be done every fourth or fifth servo cycle setting I8=3 or higher. Large PLC programs can be split into a few shorter PLC programs. This increases the frequency of housekeeping and communications by giving more breaks in PLC scans.
Motion program WHILE (condition)WAIT statements can be done as follows: WHILE (condition) DWELL20 ENDWHILE This will give more time to other RTI jobs such as Move Planning and PLC/PLCC0. If routines of lower priority than the servo loop are not executing fast enough, consider slowing down the servo update rate (increasing the update time). The PMAC may be updating faster than is required for the dynamic performance needed. If so, processor time is being wasted on needless extra updates. For example, doubling the servo update time from 442 µ sec to 885 µ sec, virtually doubles the time available for motion and PLC program execution, allowing much faster motion block rates and PLC scan rates.
This frequency change could be executed either by jumpers or individually per motor by means of the Ix60 variable. Introduction 11