Priority scheduling for interrupts and mcps, Priority scheduling for interrupts and mcps -11 – Rockwell Automation 1785-Lxxx Enhanced and Ethernet PLC-5 Programmable Controllers User Manual

Page 229

Advertising
background image

Publication 1785-UM012D-EN-P - July 2005

Programming Considerations 13-11

Deciding When to Use Special Routine

s

Priority Scheduling for
Interrupts and MCPs

PLC-5 controllers prioritize when fault routines, interrupts, and main control
programs are executed. This prioritization is called “scheduling.” The PLC-5
controller considers some scheduling tasks to be of greater importance than
others. The scheduling priority of each task is as follows (from highest to
lowest):

1. Fault Routine

2. Controller Input Interrupt (PII)

3. Selectable Timed Interrupt (STI)

4. Main Control Program (MCP)

If a Portion of Logic

Should Execute

Example

Use

By Doing the Following:

Immediately on
detecting conditions
that require a startup

Restart the system after
the system has been shut
down

Power-Up Routine

Create a separate file for a controlled start-up procedure for the first time
you start a program or when you start a program after system down time.
The controller executes the power-up routine to completion.

Immediately on detecting
a major fault

Shut down plant floor
devices safely upon
detecting a major fault

or

Send critical status to a
supervisory controller
via DH+ after detecting a
major fault

Fault Routine

Create a separate file for a controlled response to a major fault. The first
fault detected determines which fault routine is executed. The controller
executes the fault routine to completion. If the routine clears the fault, the
controller resumes the main logic program where it was interrupted. If
not, the controller faults and switches to program mode.

At a specified time
interval

Monitor machine position
every 250ms and
calculate the average
rate-of-change

or

Take a measurement and
compare it with a
standard every 1.0
seconds

Selectable Timed
Interrupt (STI)

Create a separate program file and specify the interrupt time interval. The
controller interrupts the main logic program at the specified interval, runs
the STI to completion, then resumes the main logic program where it left
off.
The controller interrupts the main logic program at the specified interval
and runs the STIs. When a block-transfer instruction to remote I/O is
encountered in an STI, the controller resumes execution of lower priority
programs (main logic program) until the block-transfer is completed.
When this occurs and you want your STI to run to completion before
returning to the main logic program, use UID and UIE instructions in your
STI program file.

Immediately when an
event occurs

Eject a faulty bottle from
a bottling line

Controller Input
Interrupt (PII)

Create a separate program file and specify 16 inputs of an input word in
the I/O rack. When the event(s) occurs, the controller interrupts the main
logic program, runs the PII to completion, then resumes the main logic
program where it left off.
When a block-transfer instruction to remote I/O is encountered in a PII, the
controller resumes execution of lower priority programs (main logic
program) until the block-transfer is completed. When this occurs and you
want your PII to run to completion before returning to the main logic
program, use UID and UIE instructions in your PII program file.

Advertising