程序段1
O #AlwaysOn
ON #AlwaysOn
= L 17.0
A L 17.0
BLD 102
= #AlwaysOn
A L 17.0
AN #AlwaysOn
= #AlwaysOff
程序段2
A #Run
JC Run
程序段3
O(
L #s_Rooms
L L#0
<=D
)
O(
L #s_Valves
L L#0
<=D
)
SAVE
BEC
程序段4
A #AlwaysOff
= #s_RunPrevStatus
= #s_RunUpEdge
= #T1PrevStatus
= #T1FallEdge
= #T2PrevStatus
= #T2FallEdge
= #T3PrevStatus
= #T3FallEdge
= #T4PrevStatus
= #T4FallEdge
= #T5PrevStatus
= #T5FallEdge
= #T6PrevStatus
= #T6FallEdge
程序段5
A #AlwaysOn
R T 1
R T 2
R T 3
R T 4
R T 5
R T 6
程序段6
A(
L 0
T #RoomNo
SET
SAVE
CLR
A BR
)
JNB _001
L 0
T #ValveNo
_001: NOP 0
程序段7
L #s_Rooms
T #index
NOP 0
程序段8
ClrR: A #AlwaysOff
= L 17.0
BLD 103
A(
A(
L #index
L L#1
-D
T #index
AN OV
SAVE
CLR
A BR
)
JNB _002
L #s_RoomStartAddr
L #index
+D
T #tempdint1
AN OV
SAVE
CLR
_002: A BR
)
JNB _003
CALL "SetBitValue"
addr :=#tempdint1
value:=L17.0
_003: NOP 0
程序段9
L #index
L L#0
>D
JC ClrR
程序段10
L #s_Valves
T #index
NOP 0
程序段11
ClrV: A #AlwaysOff
= L 17.0
BLD 103
A(
A(
L #index
L L#1
-D
T #index
AN OV
SAVE
CLR
A BR
)
JNB _004
L #s_ValveStartAddr
L #index
+D
T #tempdint1
AN OV
SAVE
CLR
_004: A BR
)
JNB _005
CALL "SetBitValue"
addr :=#tempdint1
value:=L17.0
_005: NOP 0
程序段12
L #index
L L#0
>D
JC ClrV
程序段13
A(
L L#0
T #s_Rooms
SET
SAVE
CLR
A BR
)
JNB _006
L L#0
T #s_Valves
_006: NOP 0
程序段14
A #AlwaysOn
SAVE
BEC
程序段15
Run: A #Run
FP #s_RunPrevStatus
= #s_RunUpEdge
程序段16
AN #s_RunUpEdge
JC SRun
程序段17
A #AlwaysOff
= #T1PrevStatus
= #T1FallEdge
= #T2PrevStatus
= #T2FallEdge
= #T3PrevStatus
= #T3FallEdge
= #T4PrevStatus
= #T4FallEdge
= #T5PrevStatus
= #T5FallEdge
= #T6PrevStatus
= #T6FallEdge
程序段18
A(
A(
L #LiftValveCloseTime
T #s_LiftValveCloseTime
SET
SAVE
CLR
A BR
)
JNB _007
L #LiftVavleOpenTime
T #s_LiftVavleOpenTime
SET
SAVE
CLR
_007: A BR
)
JNB _008
L #RoomIntervalTime
T #s_RoomIntervalTime
_008: NOP 0
程序段19
A(
A(
L #ValveIntervalTime
T #s_ValveIntervalTime
SET
SAVE
CLR
A BR
)
JNB _009
L #CycleTime
T #s_CycleTime
SET
SAVE
CLR
_009: A BR
)
JNB _00a
L #PulseTime
T #s_PulseTime
_00a: NOP 0
程序段20
A(
L #Rooms
T #s_Rooms
SET
SAVE
CLR
A BR
)
JNB _00b
L #Valves
T #s_Valves
_00b: NOP 0
程序段21
A(
L #RoomStartAddr
T #s_RoomStartAddr
SET
SAVE
CLR
A BR
)
JNB _00c
L #ValveStartAddr
T #s_ValveStartAddr
_00c: NOP 0
程序段22
A(
L 0
T #RoomNo
SET
SAVE
CLR
A BR
)
JNB _00d
L 0
T #ValveNo
_00d: NOP 0
程序段23
L #s_Rooms
T #index
NOP 0
程序段24
CLRR: A #AlwaysOff
= L 17.0
BLD 103
A(
A(
L #index
L L#1
-D
T #index
AN OV
SAVE
CLR
A BR
)
JNB _00e
L #s_RoomStartAddr
L #index
+D
T #tempdint1
AN OV
SAVE
CLR
_00e: A BR
)
JNB _00f
CALL "SetBitValue"
addr :=#tempdint1
value:=L17.0
_00f: NOP 0
程序段25
L #index
L L#0
>D
JC CLRR
程序段26
L #s_Valves
T #index
NOP 0
程序段27
CLRV: A #AlwaysOff
= L 17.0
BLD 103
A(
A(
L #index
L L#1
-D
T #index
AN OV
SAVE
CLR
A BR
)
JNB _010
L #s_ValveStartAddr
L #index
+D
T #tempdint1
AN OV
SAVE
CLR
_010: A BR
)
JNB _011
CALL "SetBitValue"
addr :=#tempdint1
value:=L17.0
_011: NOP 0
程序段28
L #index
L L#0
>D
JC CLRV
程序段29
SRun: O #s_RunUpEdge
O #T5FallEdge
O #T6FallEdge
= #tempbool
程序段30
A #tempbool
L #s_LiftValveCloseTime
SE T 1
程序段31
A T 1
FN #T1PrevStatus
= #T1FallEdge
程序段32
A #AlwaysOn
= L 17.0
BLD 103
A(
A #tempbool
JNB _012
L #s_RoomStartAddr
L #RoomNo
+D
T #tempdint1
AN OV
SAVE
CLR
_012: A BR
)
JNB _013
CALL "SetBitValue"
addr :=#tempdint1
value:=L17.0
_013: NOP 0
程序段33
O #T1FallEdge
O #T3FallEdge
L #s_PulseTime
SE T 2
程序段34
A T 2
= L 17.0
BLD 103
A(
A #AlwaysOn
JNB _014
L #s_ValveStartAddr
L #ValveNo
+D
T #tempdint2
AN OV
SAVE
CLR
_014: A BR
)
JNB _015
CALL "SetBitValue"
addr :=#tempdint2
value:=L17.0
_015: NOP 0
程序段35
A T 2
FN #T2PrevStatus
= #T2FallEdge
程序段36
L #s_Valves
L L#1
-D
T #tempdint1
NOP 0
程序段37
L #ValveNo
L #tempdint1
<>D
= #tempbool
程序段38
A #tempbool
A #T2FallEdge
L #s_ValveIntervalTime
SE T 3
程序段39
A T 3
FN #T3PrevStatus
= #T3FallEdge
程序段40
A #tempbool
A #T2FallEdge
JNB _016
L #ValveNo
L L#1
+D
T #ValveNo
_016: NOP 0
程序段41
AN #tempbool
A #T2FallEdge
L #s_LiftVavleOpenTime
SE T 4
程序段42
A T 4
FN #T4PrevStatus
= #T4FallEdge
程序段43
A #T4FallEdge
JNB _017
L L#0
T #ValveNo
_017: NOP 0
程序段44
A #AlwaysOff
= L 17.0
BLD 103
A(
A #T4FallEdge
JNB _018
L #s_RoomStartAddr
L #RoomNo
+D
T #tempdint1
AN OV
SAVE
CLR
_018: A BR
)
JNB _019
CALL "SetBitValue"
addr :=#tempdint1
value:=L17.0
_019: NOP 0
程序段45
L #s_Rooms
L L#1
-D
T #tempdint1
NOP 0
程序段46
L #RoomNo
L #tempdint1
<>D
= #tempbool
程序段47
A #tempbool
A #T4FallEdge
L #s_RoomIntervalTime
SE T 5
程序段48
A T 5
FN #T5PrevStatus
= #T5FallEdge
程序段49
A #tempbool
A #T4FallEdge
JNB _01a
L #RoomNo
L L#1
+D
T #RoomNo
_01a: NOP 0
程序段50
AN #tempbool
A #T4FallEdge
L #s_RoomIntervalTime
SE T 6
程序段51
A T 6
FN #T6PrevStatus
= #T6FallEdge
程序段52
AN #tempbool
A #T4FallEdge
JNB _01b
L L#0
T #RoomNo
_01b: NOP 0
程序段53
A #AlwaysOn
SAVE
BEC