430
Advanced I/O Instructions
Section 5-31
If the input word for connecting the digital switch is specified at for IW, and the
output word is specified for OW, then operation will proceed as shown below
when the program is executed.
SR 25410 will turn ON while DSW(87) is being executed.
Note
1.
Do not use DSW(87) more than once within the same program.
2.
When using DSW(87), set the input constant for the relevant input word to
less than the cycle time. (Input constants can be changed from DM 6620
onwards.) The characteristics of the digital switch must also be considered
in system and program design.
3.
Input and output bits not used here can be used as ordinary input and out-
put bits.
With this instruction, 4-digit or 8-digit set values can be read in 16 cycles.
Application Example
This example shows a program for reading 4 digits in BCD from the digital
switch. Assume that the digital switch is connected to IR 000 (input) and IR
100 (output), and assume the default status for all the PC Setup (4 digits to
read).
The data set from the digital switch by DSW(87) is stored in HR 51.
When IR 00015 turns ON, the value stored in HR 51 is moved to DM 0001.
Note
Output point 5 (here, IR 10005) turns on when one round of data is read and
can be used to time switching the data storage area and gate signal (CS sig-
nal) when DSW(87) is used to input data to different areas of memory.
00
01
02
03
04
05
Wd 0
10
0
10
1
10
2
10
3
D+1
D
Four digits: 00 to 03
Eight digits: 00 to 03, 04 to 07
0
1
2
3
4
5
6
7
8
9
10 11 12
13
14
15 16
IW
When only 4 digits are read,
only word D is used.
Leftmost
4 digits
Rightmost
4 digits
16 cycles to complete one round of execution
Input data
CS signal
1 Round Flag
RD (read) signal
@MOV(21)
HR51
DM0000
DSW(87)
000
100
HR51
25313
00015