Omron CPM1 - PROGRAMING MANUAL 02-2001 Programming Manual page 517

Hide thumbs Also See for CPM1 - PROGRAMING MANUAL 02-2001:
Table of Contents

Advertisement

Special Instructions
Description
Caution
!
Flags
Flags
7-28-3 BIT COUNTER – BCNT(67)
Limitations
Description
Flags
To refresh I/O words, specify the first (St) and last (E) I/O words to be refreshed.
When the execution condition for IORF(97) is ON, all words between St and E
will be refreshed. This will be in addition to the normal I/O refresh performed dur-
ing the CPU Unit's cycle.
(If St>E, IORF(97) will be treated as NOP(00).)
Normally, I/O refreshing is performed just once each cycle at the end of program
execution, but IORF(97) can be used to refresh I/O words immediately during
program execution.
Although IORF(97) can be used in interrupt subroutines, you must be careful of
the interval between IORF(97) executions. If IORF(97) is executed to frequently,
a fatal system error may occur (FALS 9F), stopping operation. The interval be-
tween executions of IORF(97) should be at least 1.3 ms + total execution time of
the interrupt subroutine.
ER:
St or E is not within the allowed range (IR 000 to IR 019).
St is greater than E. (If St>E, IORF(97) will be treated as NOP(00).)
There are no flags affected by this instruction.
Ladder Symbols
BCNT(67)
N
SB
R
Note BCNT(67) is an expansion instruction in the CPM2A/CPM2C and SRM1(-V2).
The function code 67 is the factory setting and can be changed for if desired.
N cannot be 0.
DM 6144 to DM 6655 cannot be used for R.
When the execution condition is OFF, BCNT(67) is not executed. When the
execution condition is ON, BCNT(67) counts the total number of bits that are ON
in all words between SB and SB+(N–1) and places the result in R.
ER:
N is not BCD, or N is 0; SB and SB+(N–1) are not in the same area.
A DM address is used for SB, but SB through SB+(N–1) are not all in
read/write DM.
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
EQ:
ON when the result is 0.
@BCNT(67)
N
SB
R
Section
Operand Data Areas
N: Number of words (BCD)
IR, SR, AR, DM, HR, TC, LR, #
SB: Source beginning word
IR, SR, AR, DM, HR, TC, LR
R: Destination word
IR, SR, AR, DM, HR, TC, LR
7-28
499

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents