KEYENCE KV-D20 User Manual
Page 64
3. Examples of Ladder Programs
3
64
1.
Set the initial number of relays for the cam switch function (0500) in DM1400,
and "No. of 1 encoder rotation x 2 (360 x 2 = 720)" in DM1402.
2.
Set the input time constant of input 0004 to 10
µ
s.
Set the input time constant of input 0006 to 10
µ
s.
Set the input time constant of input 0008 to 10
µ
s.
3.
Turn on Bits 0, 5, and 6 of DM1676 ($0061) to enable changing the screen
between the operator, switch comment, and lamp comment screens.
4.
The cam switch function is started at the rising edge of the ON status of
customized switch F1.
5.
The cam switch function is stopped at the rising edge of the ON status of
customized switch F2.
6.
Customized lamp 1 illuminates when a cam switch error occurs.
7.
Customized lamp 2 illuminates during cam switch operation.
8.
Customized lamp 3 illuminates when cam switch output 0 turns on.
9.
Customized lamp 4 illuminates when cam switch output 1 turns on.
10. Assign TM30 to the device displayed on the first line (specify "#24030" in
DM1580), and set the attributes so that only the comment is displayed (Bit 8:
ON) (DM1680 = $0100).
11. The current angle is obtained from the current number of pulses using the
following equation.
Current angle (Units: 0.1
°
) =
Current No. of pulses x 3600
÷
No. of pulses for 1 encoder rotation
Assign DM0000 to the device displayed on the second line (specify "#30000"
in DM1581), and set the attributes so that the decimal point position is "1"
($0001) and the number of spaces at the right end is "4" ($0040) (DM1681 =
$0041).
12. Assign DM1406 to the device displayed on the third line (specify "#31406" in
DM1582), and set the attributes so that the decimal point position is "1"
($0001), the number of spaces at the right end is "4" ($0040), and the zero-
suppression function is disabled (Bit 13: ON) (DM1682 = $2041).
Assign DM1407 to the device displayed on the fourth line (specify "#31407" in
DM1583), and set the attributes so that the decimal point position is "1"
($0001), the number of spaces at the right end is "4" ($0040), and the zero-
suppression function is disabled (Bit 13: ON) (DM1683 = $2041).
:
Repeat the setting above through to the 20th line.
:
Assign DM1423 to the device displayed on the 20th line (specify "#31423" in
DM1599), and set the attributes so that the decimal point position is "1"
($0001), the number of spaces at the right end is "4" ($0040), and the zero-
suppression function is disabled (Bit 13: ON) (DM1699 = $2041).
kv_d20_manual.p65
08.3.10, 6:09 PM
64