Bradley Smoker PLC-5 user manual Priority Scheduling for Interrupts and MCPs

Models: PLC-5

1 388
Download 388 pages 13.97 Kb
Page 229
Image 229

Programming Considerations

13-11

 

 

Deciding When to Use Special Routines

If a Portion of Logic

 

 

 

Should Execute

Example

Use

By Doing the Following:

 

 

 

 

Immediately on

Restart the system after

Power-Up Routine

Create a separate file for a controlled start-up procedure for the first time

detecting conditions

the system has been shut

 

you start a program or when you start a program after system down time.

that require a startup

down

 

The controller executes the power-up routine to completion.

 

 

 

 

Immediately on detecting

Shut down plant floor

Fault Routine

Create a separate file for a controlled response to a major fault. The first

a major fault

devices safely upon

 

fault detected determines which fault routine is executed. The controller

 

detecting a major fault

 

executes the fault routine to completion. If the routine clears the fault, the

 

 

 

controller resumes the main logic program where it was interrupted. If

 

or

 

not, the controller faults and switches to program mode.

 

Send critical status to a

 

 

 

supervisory controller

 

 

 

via DH+ after detecting a

 

 

 

major fault

 

 

 

 

 

 

At a specified time

Monitor machine position

Selectable Timed

Create a separate program file and specify the interrupt time interval. The

interval

every 250ms and

Interrupt (STI)

controller interrupts the main logic program at the specified interval, runs

 

calculate the average

 

the STI to completion, then resumes the main logic program where it left

 

rate-of-change

 

off.

 

or

 

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

 

Take a measurement and

 

encountered in an STI, the controller resumes execution of lower priority

 

 

programs (main logic program) until the block-transfer is completed.

 

compare it with a

 

When this occurs and you want your STI to run to completion before

 

standard every 1.0

 

returning to the main logic program, use UID and UIE instructions in your

 

seconds

 

STI program file.

 

 

 

 

Immediately when an

Eject a faulty bottle from

Controller Input

Create a separate program file and specify 16 inputs of an input word in

event occurs

a bottling line

Interrupt (PII)

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.

 

 

 

 

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)

Publication 1785-UM012D-EN-P - July 2005

Page 229
Image 229
Bradley Smoker PLC-5 user manual Priority Scheduling for Interrupts and MCPs, Deciding When to Use Special Routines