Mitsubishi Electronics 13JW55 Network Card User Manual


 
5 - 57
Project name QTEST11
Program name MAIN
5.7.7 Exercise 7 D-multiplication and D-division
Create a program that:
1) Multiplies the value set by the 5-digit digital switches (X20 to X33) by 1,100 in
binary when X2 is turned on. When the result is 99,999,999 or less, it is
displayed on the displays (Y40 to Y5F).
2) Divides the value set by the 8-digit digital switches (X20 to X3F) by 40,000 in
binary when X3 is turned on. When X4 is on, the quotient is displayed on the
displays (Y40 to Y5F). When X4 is off, the remainder is displayed on the displays
(Y40 to Y5F).
(X20 to X33) × 1100
(Y40 to Y5F)
Quotient (Y40 to Y5F) ... X4: ON
(X20 to X3F) / 40000
Remainder (Y40 to Y5F) ... X4: OFF
Create the program with GX Works2 filling in the blanks in the following. Then,
check the operation using the demonstration machine.
D0
X2
0
D2
1)
D0K5X20
K1100
X3
2)
D2
D4
Y77
D4K99999999D< Y77
K8Y40
D10
X3
24
D12
4)
D10K8X20
K40000
X2
3)
5)
D12 D14
X4
K8Y40D4DBCDP
K8Y40DBCD
DBCD
6)
7)
DBINP
X4
1)
2)
3)
4)
5)
6)
7)