batch-example-2/plc/code/s5/updated/fx-blocks/fx-103-charge

450 lines
11 KiB
Plaintext
Raw Permalink Normal View History

2023-11-20 21:08:07 +00:00
Segment 1
*****************************************************************************
BESCHREIBUNG :
---------------
Dieser Baustein setzt das PLI ( Phase Logic Interface ) von Open - Batch
auf die Schnittstelle HsH - PC zur SPS - Waage ( DB 210 ) um
******************************************************************************
PARAMETER :
-----------
PLDX : Nr. des DX Datenbaustein fuer PLI
OFFS : Offset fuer PLI Anfang
WZNR : Zaehlnummer der SPS - Waage
DBPC : Datenbaustein fuer Schnittstelle PC - SPS Waage
DBST : Steuerdatenbaustein PC - SPS Waage
AUTO : Automatik - Mode
******************************************************************************
Name :PL-SS-CH
Decl :PLDX I/Q/D/B/T/C: D KM/KH/KY/KS/KF/KT/KC/KG: KF
Decl :OFFS I/Q/D/B/T/C: D KM/KH/KY/KS/KF/KT/KC/KG: KF
Decl :ADB I/Q/D/B/T/C: D KM/KH/KY/KS/KF/KT/KC/KG: KF
Decl :EOSI I/Q/D/B/T/C: I BI/BY/W/D: BI
Decl :SC? I/Q/D/B/T/C: I BI/BY/W/D: BI
Decl :UNID I/Q/D/B/T/C: I BI/BY/W/D: BI
Decl :PCOM I/Q/D/B/T/C: I BI/BY/W/D: BI
Decl :TDDP I/Q/D/B/T/C: T
:***
Segment 2 PLI DX oeffnen
:LW =PLDX
:T -MW188 ADDR_OBJECT_DB/DX
:DO -MW188 ADDR_OBJECT_DB/DX
:CX -DX 0 SYSTEM PARAMETER
:***
FW 188 = MW188 ADDR_OBJECT_DB/DX
DX 0 = DX 0 SYSTEM PARAMETER
Segment 3 Load Control bits PLI
:LW =OFFS
:L KF +10
:+F
:T -MW186 DW_ADDRESS
:DO -MW186 DW_ADDRESS
:L DW 0
:T -MW 168_OUT_PLI Ausgangsbitleiste von PLI
: --------------------------------
:L -MW186 DW_ADDRESS
:L KF +1
:+F
:T -MW186 DW_ADDRESS 11
:DO -MW186 DW_ADDRESS
:L DW 0
:T -MW 166_IN_PLI Eingangsbitleiste von PLI
: --------------------------------
:***
FW 186 = MW186 DW_ADDRESS
FW 168 = MW 168_OUT_PLI Ausgangssteuerbitleiste von PLI
FW 166 = MW 166_IN_PLI Eingangsbitleiste an PLI
Segment 4 Load Status bits PLI/ Unit idle
:LW =OFFS
:L KF +19
:+F
:T -MW186 DW_ADDRESS
:DO -MW186 DW_ADDRESS
:L DW 0
:T -MW 160_STATUS_PL Status bits PLI
: --------------------------------
:JU =M001 !!! TEST !!!
:A -MO169.4 START_BY_PLI
:AN =UNID
:R -MO169.4 START_BY_PLI
:S -MI167.4 IDLE(ready)
M001 :***
FW 186 = MW186 DW_ADDRESS
FW 160 = MW 160_STATUS_PL
F 169.4 = MO169.4 START_BY_PLI
F 167.4 = MI167.4 IDLE(ready)
Segment 5 Request registers
:LW =OFFS
:T -MW 152 PHASE_REQUEST
:
:L -MW 152 PHASE_REQUEST
:I 13
:T -MW 154 REQ_DATA1
:
:L -MW 152 PHASE_REQUEST
:I 14
:T -MW 156 REQ_DATA2
:
:L -MW 152 PHASE_REQUEST
:I 12
:T -MW 158 PHASE_ST_FAILURE
:
:L KF +0
:DO -MW 158 PHASE_ST_FAILURE
:T DW 0 reset stored failure
:***
FW 152 = MW 152 PHASE_REQUEST
FW 154 = MW 154 REQ_DATA1
FW 156 = MW 156 REQ_DATA2
FW 158 = MW 158 PHASE_ST_FAILURE
Segment 6 Operator confirm
:DO -MW 152 PHASE_REQUEST
:L DW 0
:L KF +1200
:>=F
:= -MS161.4 ! OPER_CONFRM !
:***
FW 152 = MW 152 PHASE_REQUEST
F 161.4 = MS161.4 ! OPER_CONFRM !
Segment 7 Request in work
:DO -MW 152 PHASE_REQUEST
:L DW 0
:L KF +6000
:!=F
:= F 200.0 RQ 6000
:R -MI167.6 RQ_IN_WORK
:DO -MW 152 PHASE_REQUEST
:L DW 0
:L KF +1000
:>=F
:AN F 200.0 RQ 6000
:S -MI167.6 RQ_IN_WORK
:JC =M001
:
:L KF +0
:DO -MW 154 REQ_DATA1
:T DW 0
:DO -MW 156 REQ_DATA2
:T DW 0
M001 :***
FW 152 = MW 152 PHASE_REQUEST
F 167.6 = MI167.6 RQ_IN_WORK
FW 154 = MW 154 REQ_DATA1
FW 156 = MW 156 REQ_DATA2
Segment 8 Complete
:L -MW 152 PHASE_REQUEST
:L KF +4
:+F
:T -MW186 DW_ADDRESS
:DO -MW186 DW_ADDRESS
:L DW 0
:L KF +70
:!=F
:O =PCOM
:S -MI167.1 COMPLETE
:
:AN -MO169.4 START_BY_PLI
:JC =M001
:
:A -M 0.1 CONSTANT 1
:R -MS161.0 STP 90: ACTIVE
:
:AN -M 0.1 CONSTANT 1
:SD =TDDP
M001 :***
FW 152 = MW 152 PHASE_REQUEST
FW 186 = MW186 DW_ADDRESS
F 167.1 = MI167.1 COMPLETE
F 169.4 = MO169.4 START_BY_PLI
F 0.1 = M 0.1 CONSTANT 1
F 161.0 = MS161.0 STP 90: ACTIVE
Segment 9 start sequence
:L -MW 152 PHASE_REQUEST
:L KF +3
:+F
:T -MW186 DW_ADDRESS
:DO -MW186 DW_ADDRESS
:L DW 0
:T -MW 150 PHASE_STEP_INDEX
:
:AN -MO169.4 START_BY_PLI
:AN F 200.0 RQ 6000
:JC =M001
:
:L KF +0
:T -MW 160_STATUS_PL
:
:AN -MO169.4 START_BY_PLI
:JC =M001
:L KF +40
:T -MW 150 PHASE_STEP_INDEX
M001 :***
FW 152 = MW 152 PHASE_REQUEST
FW 186 = MW186 DW_ADDRESS
FW 150 = MW 150 PHASE_STEP_INDEX
F 169.4 = MO169.4 START_BY_PLI
FW 160 = MW 160_STATUS_PL
Segment 10 Step 10: load para
:***
FW 150 = MW 150 PHASE_STEP_INDEX
F 167.5 = MI167.5 PLI_RUNNING
F 167.6 = MI167.6 RQ_IN_WORK
F 160.0 = MS160.0 STP 10: ACTIVE
FW 154 = MW 154 REQ_DATA1
FW 156 = MW 156 REQ_DATA2
F 0.1 = M 0.1 CONSTANT 1
FW 152 = MW 152 PHASE_REQUEST
F 166.0 = MI166.0 RQ_1100 DLpart
F 161.7 = MS161.7 STP 10:HOLD_ACT
FW 158 = MW 158 PHASE_ST_FAILURE
Segment 11 Step 20: wait for message partne
:***
FW 150 = MW 150 PHASE_STEP_INDEX
F 167.5 = MI167.5 PLI_RUNNING
F 167.6 = MI167.6 RQ_IN_WORK
F 160.1 = MS160.1 STP 20: ACTIVE
FW 152 = MW 152 PHASE_REQUEST
F 166.0 = MI166.0 RQ_1100 DLpart
F 0.1 = M 0.1 CONSTANT 1
Segment 12 Step 30: confirm to start ?
:***
FW 150 = MW 150 PHASE_STEP_INDEX
F 167.5 = MI167.5 PLI_RUNNING
F 167.6 = MI167.6 RQ_IN_WORK
F 160.2 = MS160.2 STP 30: ACTIVE
FW 152 = MW 152 PHASE_REQUEST
F 166.0 = MI166.0 RQ_1100 DLpart
F 0.1 = M 0.1 CONSTANT 1
Segment 13 Step 40: start charge
:L -MW 150 PHASE_STEP_INDEX
:L KF +40
:><F
:ON -MI167.5 PLI_RUNNING
:JC =M001
:
:A =EOSI
:R -MS160.3 STP 40: ACTIVE
:
:AN =EOSI
:S -MS160.3 STP 40: ACTIVE
:JC =M001
:
:L KF +70
:T -MM001W 150 PHASE_STEP_INDEX
M001 :***
FW 150 = MW 150 PHASE_STEP_INDEX
F 167.5 = MI167.5 PLI_RUNNING
F 160.3 = MS160.3 STP 40: ACTIVE
Segment 14 Step 50: cleaning
:***
FW 150 = MW 150 PHASE_STEP_INDEX
F 167.5 = MI167.5 PLI_RUNNING
FW 152 = MW 152 PHASE_REQUEST
Segment 15 Step 60: confirm cleaning
:***
FW 150 = MW 150 PHASE_STEP_INDEX
F 167.5 = MI167.5 PLI_RUNNING
F 167.6 = MI167.6 RQ_IN_WORK
F 160.5 = MS160.5 STP 60: ACTIVE
FW 152 = MW 152 PHASE_REQUEST
F 166.0 = MI166.0 RQ_1100 DLpart
F 0.1 = M 0.1 CONSTANT 1
Segment 16 Step 70: ready for complete
:L -MW 150 PHASE_STEP_INDEX
:L KF +70
:><F
:ON -MI167.5 PLI_RUNNING
:O -MI167.6 RQ_IN_WORK
:JC =M001
:A -MS160.6 STP 70: ACTIVE
:JC =M002
:L -MW 152 PHASE_REQUEST
:I 43
:T FW 190
:DO FW 190
:L DW 0
:L KF +1
:><F
:JC =M003
:
:L KF +2204
:DO -MW 152 PHASE_REQUEST
:T DW 0
:AN -MI166.0 RQ_1100 DLpart
:S -MI166.0 RQ_1100 DLpart
M003 :S -MS160.6 STP 70: ACTIVE
:JU =M001
M002 :
:A -M 0.1 CONSTANT 1
:R -MS160.6 STP 70: ACTIVE
:
:L KF +80
:T -MW 150 PHASE_STEP_INDEX
M001 :***
FW 150 = MW 150 PHASE_STEP_INDEX
F 167.5 = MI167.5 PLI_RUNNING
F 167.6 = MI167.6 RQ_IN_WORK
F 160.6 = MS160.6 STP 70: ACTIVE
FW 152 = MW 152 PHASE_REQUEST
F 166.0 = MI166.0 RQ_1100 DLpart
F 0.1 = M 0.1 CONSTANT 1
Segment 17 Step 80: wait
:***
FW 150 = MW 150 PHASE_STEP_INDEX
F 167.5 = MI167.5 PLI_RUNNING
F 167.6 = MI167.6 RQ_IN_WORK
F 160.7 = MS160.7 STP 80: ACTIVE
FW 152 = MW 152 PHASE_REQUEST
F 166.0 = MI166.0 RQ_1100 DLpart
F 0.1 = M 0.1 CONSTANT 1
Segment 18 Step 90: Upload reports
:***
FW 150 = MW 150 PHASE_STEP_INDEX
F 167.5 = MI167.5 PLI_RUNNING
F 167.1 = MI167.1 COMPLETE
F 167.6 = MI167.6 RQ_IN_WORK
FW 152 = MW 152 PHASE_REQUEST
F 161.0 = MS161.0 STP 90: ACTIVE
FW 158 = MW 158 PHASE_ST_FAILURE
F 0.1 = M 0.1 CONSTANT 1
Segment 19 PLI DX
:LW =PLDX
:T -MW188 ADDR_OBJECT_DB/DX
:DO -MW188 ADDR_OBJECT_DB/DX
:CX -DX 0 SYSTEM PARAMETER
:***
FW 188 = MW188 ADDR_OBJECT_DB/DX
DX 0 = DX 0 SYSTEM PARAMETER
Segment 20 Store step number
:LW =OFFS
:L KF +3
:+F
:T -MW186 DW_ADDRESS
:
:L -MW 150 PHASE_STEP_INDEX
:DO -MW186 DW_ADDRESS
:T DW 0
:
:A =UNID
:= -MS161.5 !! UNIT IDLE !!
:***
FW 186 = MW186 DW_ADDRESS
FW 150 = MW 150 PHASE_STEP_INDEX
F 161.5 = MS161.5 !! UNIT IDLE !!
Segment 21 Store Control bits PLI
:LW =OFFS
:L KF +11
:+F
:T -MW186 DW_ADDRESS
:
:L -MW 166_IN_PLI
:DO -MW186 DW_ADDRESS
:T DW 0
:
:LW =OFFS
:L KF +19
:+F
:T -MW186 DW_ADDRESS
:
:L -MW 160_STATUS_PL
:DO -MW186 DW_ADDRESS
:T DW 0
:***
FW 186 = MW186 DW_ADDRESS
FW 166 = MW 166_IN_PLI Eingangsbitleiste an PLI
FW 160 = MW 160_STATUS_PL
Segment 22 Reports to PLI
:LW =ADB
:T FW 190
:
:A =SC?
:L KF +130
:JC =M001
:L KF +30
M001 :T FW 192
:
:L -MW 152 PHASE_REQUEST
:L KF +44
:+F
:T FW 194
:
:A =SC?
:L KF +6
:JC =M002
:L KF +1
M002 :T FW 196
:***
FW 152 = MW 152 PHASE_REQUEST
Segment 23 Reports to PLI
:JU -FB173 COPY BLOCK
Name :COPY DKF
QUEL : KS DB
DB-Q : FW 190
VON : FW 192
BIS : FW 192
ZIEL : KS DX
DB-Z : -MW188 ADDR_OBJECT_DB/DX
NACH : FW 194
FEHL : -M 0.0 IND.ADDRES(DUMMY)
LAEN : FW 196
L-B : KS LA
:BE
FW 188 = MW188 ADDR_OBJECT_DB/DX
F 0.0 = M 0.0 IND.ADDRES(DUMMY)
FB 173 = FB173 COPY BLOCK parameter: EW sp