PMAC Quick Reference Guide
Troubleshooting
71
PLC Programs
PLCs and PLCCs are one of the most common sources for communication or watchdog timer failures.
Any
SEND
,
COMMAND
, or
DISPLAY
action statement should be done only on an edge-triggered
condition, because the PLC can cycle faster than these operations can process their information, and the
communications channels can get overwhelmed if these statements are executed on consecutive scans
through the PLC.
IF (M11=1)
; input is ON
IF (P11=0)
; input was not ON last time
COMMAND"#1J+"
;
JOG
motor
P11=1
;
set
latch
ENDIF
ELSE
P11=0
;
reset
latch
ENDIF
PLC0 or PLCC0 should be used for only a few tasks (usually a single task) that must be done at a higher
frequency than the other PLC tasks. The PLC 0 will execute every real-time interrupt as long as the tasks
from the previous RTI have been completed. PLC 0 is potentially the most dangerous task on PMAC as
far as disturbing the scheduling of tasks is concerned. If it is too long, it will starve the background tasks
for time
.
The first thing noticed is that communications and background PLC tasks will become sluggish.
In the worst case, the watchdog timer will trip, shutting down the card, because the housekeeping task in
background did not have the time to keep it updated.
Because all PLC programs in PMAC’s memory are enabled at power-on/reset, it is good practice to have
I5 saved as 0 in PMAC’s memory when developing PLC programs. This will allow PMAC to be reset,
no PLCs running (an enabled PLC only runs if I5 is set properly) and recover more easily from a PLC
programming error.
As an example, type these commands in the terminal window. After that, open a watch window and
monitor for P1 to be counting up:
OPEN PLC1 CLEAR
; Prepare buffer to be written
P1=P1+1
; P1 continuously incrementing
CLOSE
; Close written buffer, PLC1
I5=2
Press <CTRL+D> and type ENA PLC1
Summary of Contents for PMAC Mini
Page 4: ......
Page 8: ...PMAC Quick Reference Guide iv Table of Contents ...
Page 28: ...PMAC Quick Reference Guide 20 PMAC Executive Program PEWIN ...
Page 80: ...PMAC Quick Reference Guide 72 Troubleshooting ...
Page 82: ...PMAC Quick Reference Guide 74 Appendix A PMAC Error Code Summary ...
Page 88: ...PMAC Quick Reference Guide 80 Appendix B PMAC I Variables Summary ...
Page 106: ...PMAC Quick Reference Guide 98 Appendix F I O Suggested M Variable Definitions ...