Omron CJ - REFERENCE MANUAL 02-2010 Reference Manual page 834

Table of Contents

Advertisement

3. Instructions
Precaution
• Do not read or write the system word (C) from any other instruction. HKY(212) will not operate
correctly if the system word is accessed by another instruction. The system word is not initialized by
HKY(212) in the first cycle when program execution starts. If HKY(212) is being used from the first
cycle, clear the system word from the program.
• I/O refreshing must be performed with the I/O Unit connected to the hexadecimal keypad after each
HKY(212) instruction is executed. If the cycle time is short, operation may not be correct depending
on the ON/OFF response time of the I/O Unit. If necessary, use an I/O Unit with a short ON/OFF
response time or use the minimum cycle time function to adjust the cycle time. Do not connect the
hexadecimal keypad to the following Units.
• Basic I/O Units or High-density I/O Units mounted in a SYSMAC BUS Remote I/O Slave Rack
• Communications Slaves (DeviceNet or CompoBus/S Slaves)
• HKY(212) determines which key is pressed by identifying which input is ON when a given selection
signal is ON, so it can take anywhere from 3 to 12 cycles for one hexadecimal digit to be read. After
the key input is read, HKY(212) starts over and reads another digit in the next 3 to 12 cycles.
• When executed, HKY(212) begins reading the key input data from the first selection signal,
regardless of the point at which the last instruction was stopped.
• The two-word register in D1 and D1+1 operates as an 8-digit shift register. When a key is pressed on
the ten-key keypad, the corresponding hexadecimal digit is shifted into the least significant digit of
D1. The other digits of D1, D1+1 are shifted left and the most significant digit of D1+1 is lost.
• When one of the keypad keys is being pressed, input from the other keys is disabled.
• There is no restriction on the number of times that HKY(212) can appear in the program (unlike the
CQM1H Series).
Example Programming
In this example, HKY(212) reads up to 8 digits of hexadecimal data from a hexadecimal keypad and
stores the data in D0 and D1. The hexadecimal keypad is connected through CIO 100 (allocated to a
CS1W-ID211 16-point DC Input Unit) and CIO 200 (allocated to a CS1W-OD211 16-point Transistor
Output Unit). D32000 is used as the system word.
P_On
Always ON Flag
798
HKY(212)
I
100
O
200
D0
D
C
D32000
CS/CJ/NSJ Series Instructions Reference Manual (W474)

Advertisement

Table of Contents
loading

Table of Contents