101
OR=
K100 C0
Y0
DOR>
K68899D10
M50
M4
X0
X2
S1·
S2·
When the source data’s highest bit (16 bits: b15,32 bits: b31) is 1, it is seemed to negative
number.
The comparison of32 bits counter should use32 bits instruction. If using16 bits instruction,
the program or operation will be error.
Example: forbid the outputs when it reaches the certain time. In the below program, when the
date is June 30
th
, 2012, all the outputs will be disabled. The password 1234 is stored in
(D4000, D4001). When the password is correct, all the outputs are enabled.
LD SM0 //SM0 is always ON coil
TRD D0 //read the RTC (real time clock) value and store in D0~D6
LD>= D2 K30 //RTC date ≥30
AND>= D1 K6 //RTC month ≥6
AND>= D0 K12 //RTC year ≥12
LD>= D1 K7 //or RTC month ≥ 7
AND>= D0 K12 //RTC year ≥ 12
ORB //or
OR>= D0 K13 //RTC year ≥ 13
DAND<> D4000 K1234 //and password ≠1234
SET SM34 //set ON M34, all the outputs are disabled
DLD= D4000 K1234 //password=1234, correct password
RST SM34 //reset M34, all the outputs are enabled
tudonghoatoancau.com