Task 3:
You can use many different types of instructions in the interrupt subroutines. For
Understand the
example, you may need comparative boolean contacts, math instructions, etc.
Types of
Controlling I/O Points in Subroutines:
Instructions used
In most cases, the goal is a fast response. So
in Interrupt
you should try to use the Immediate
Subroutines
Instructions to update any I/O points. These
instructions look like regular contacts with an
"I" in them. They work differently from the
regular
immediately reads the input status from the
module and immediately updates the output
module when the instructions are executed.
This provides a much faster response. (The
CPU normally only updates the inputs and
outputs in a "batch update" at the beginning
and end of the scans respectively.)
Helpful
programming
Instructions are available on the Editing Tool
Box, the Contact Browser, or the Coil Browser.
FOR / NEXT Instructions: The FOR/NEXT
instructions allow you to build a "mini-scan"
within the interrupt subroutine. When the
FOR/NEXT loop is encountered, the CPU
loops through the instructions between the
FOR and NEXT instructions a specified
number of times before moving on to the rung
following the NEXT instruction.
Helpful Hints: In our Direct SOFT programming
software, the FOR/NEXT instructions are
available on the Coil Browser. Look under the
class listed as "Program Control."
NOTE: You can use many different types of instructions in the interrupt subroutines.
However, if you use instructions with long execution times, such as some math
instructions, FOR/NEXT loops, etc., then you may exceed the Watchdog Timer limit.
The Watchdog Timer is set at 200ms from the factory. It can be changed with the
handheld programmer or Direct SOFT. You can also use a RSTWT instruction inside
of the subroutine to reset the Watchdog Timer.
contacts
because
Direct SOFT
Hints:
In
our
software,
the
These rungs are
executed 5 times before
the CPU moves to the
next rung.
21
INT
the
CPU
Read the status of input X20
immediately. If it is ON, turn
on output Y5 immediately.
Immediate
INT
21
21
END
O 0
X20
Y5
OUTI
END
Constant K5
O 1
specifies
5 loops
FOR
K5
X101
Y51
OUTI
X102
Y52
OUTI
NEXT
Need help?
Do you have a question about the DL405 and is the answer not in the manual?
Questions and answers