340
5
5 High-speed Input5.1.3 Pulse Capture
executes the interrupt subprogram (HSCS) and gives priority to control of counting results. High-speed
counter interrupt is used when the target output of the HSCS instruction is set to I010–I080.
To use the interrupt function, program corresponding interrupt subprograms and turn on the corresponding
"Enable Interrupts" ag before interrupt response. The "Enable Interrupts" ag is shown below:
Settings of Enable/Disable Interrupts
M8050 Enable/Disable I00x interrupts
X input interrupts: 16
interrupts correspond to
interrupts on the rising/
falling edge of X0 to X7
ports.
x = 1: interrupt on the rising
edge
x = 0: interrupt on the falling
edge
Each ag bit corresponds to
Enable/Disable Interrupt control
of one external input:
OFF: enable X input interrupts
ON: disable X input interrupts
M8051 Enable/Disable I10x interrupts
M8052 Enable/Disable I20x interrupts
M8053 Enable/Disable I30x interrupts
M8054 Enable/Disable I40x interrupts
M8055 Enable/Disable I50x interrupts
M8076 Enable/Disable I56x interrupts
M8077 Enable/Disable I57x interrupts
M8059
Enable/Disable counter
interrupts
Enable/Disable counter
interrupts
OFF: Enable counter interrupts
ON: Disable counter interrupts
After the "Enable Interrupts" ag corresponding to each interrupt is turned on, the "Enable Global Interrupts"
ag must also be turned on. That is, the interrupt function can be enabled only after EI instruction (FNC04)
is executed. If the "Disable Global Interrupts" DI instruction (FNC05) is executed, all interrupt responses
are disabled. When the "Enable Interrupt" ag corresponding to an input number is turned on and the input
signal complies with interrupt settings, the corresponding interrupt subprogram will be executed.
For the detailed instruction for use, see
“Chapter 1 Overview” on page 20
.
5.1.3 Pulse Capture
To respond to instant pulse signals at input ports without special requirements on the response time, use
the pulse capture function. The PLC will store signals on the rising edge of the input port in M8090–M8097.
These signals can be used as the basis for judgment and processing in the main program and manually
cleared after the completion of response.
To use the pulse capture function, turn on the "Enable Global Interrupts" EI instruction and the
corresponding "Enable Pulse Capture". After the rising edge is triggered on external input signals, turn on
the corresponding pulse capture ag. The corresponding "Enable Pulse Capture" and pulse capture ags of
each input port are shown below:
Input
Port
H3U Standard
Model
X00 X01 X02 X03 X04 X05 X06 X07
Enable Pulse
Capture
M8080 M8081 M8082 M8083 M8084 M8085 M8086 M8087
Pulse Capture
Flag
M8090 M8091 M8092 M8093 M8094 M8095 M8096 M8097
When "Enable Pulse Capture" is set to ON, the pulse capture function is enabled. When "Enable Pulse
Capture" is set to OFF, the pulse capture function is disabled.
The following example describes the pulse capture function for the X00 input.