Selectable timed interrupt (sti) function overview – Rockwell Automation 1761-HHP-B30 MicroLogix 1000 with Hand-Held Programmer (HHP) User Manual

Page 241

Advertising
background image

Chapter 13
Using Application Specific Instructions

13–15

The Selectable Timed Interrupt (STI) function allows you to interrupt the
scan of the application program automatically, on a periodic basis, to scan a
subroutine file. Afterwards, the controller resumes executing the application
program from the point where it was interrupted.

Basic Programming Procedure for the STI Function

To use the STI function in your application file:

1. Enter the desired rungs in File 5. (File 5 is designated for the STI

subroutine.)

2. Enter the setpoint (the time between successive interrupts) using the

program configuration option of the HHP’s menu. (See page 18–9.) The
range is 10–2550 ms (entered in 10 ms increments). A setpoint of zero
disables the STI function.

Important: The setpoint value must be a longer time than the execution

time of the STI subroutine file, or a minor error bit is set.

Operation

After you restore your program and enter the RRUN, RCSN, or RSSN mode,
the STI begins operation as follows:

1. The STI timer begins timing.

2. When the STI interval expires, the program scan is interrupted and the

STI subroutine file is scanned; the STI timer is reset.

3. If while executing the STI (file 5), another STI interrupt occurs the STI

pending bit (S2/0) is set.

4. If while an STI is pending the STI timer expires, the STI lost bit (S5/10)

is set.

5. When the STI subroutine scan is completed, scanning of the program

resumes at the point where it left off, unless an STI is pending. In this
case the subroutine is immediately scanned again.

6. The cycle repeats.

For identification of your STI subroutine, include an INT instruction as the
first instruction on the first rung of the file.

STI Subroutine Content

The STI subroutine contains the rungs of your application logic. You can
program any instruction inside the STI subroutine except a TND instruction.
IIM or IOM instructions are needed in an STI subroutine if your application
requires immediate update of input or output points. End the STI subroutine
with an RET instruction.

Selectable Timed Interrupt
(STI) Function Overview

Advertising