OB1 Main : Main Program Sweep |
|
What you are seeing here is the whole plant consisting of 4-slave modules, and 1-master module. 1. Spring Block; 4-times proving spring quality at max force (slave 1 at index position 3) 2. Spring Elasticity; 4-times proving spring effectiveness after hardening process (slave 2 at index position 8) 3. Spring Diameter; camera - damage inspection (slave 3 at index position 14) 4. Spring Winding Point (both sides); camera - damage inspection (slave 4 at index position 21) 5. Feed, and guide rail; control the movement, and activity of guide, and feeding rail (master) 6. OK/NOK Picking Flap (index position 24) - - - - If one of the modules evaluate spring faulty workmanship, the spring will then slide into the bad springs box, else into the good spring box. |
|
Netzwerk 1: Start measuring runtime (Start Cycle)
"HMI SYS".Support.LastCycle := RUNTIME("HMI SYS".Support.LastCycle_inout); |
|
|
|
Netzwerk 2: Pulse generator
"HMI SYS".Support.Sav_Clock_Byte := "HMI SYS".Support.Sav_Clock_Byte XOR "Clock_Byte"; "M00 PLC Impulse" := "HMI SYS".Support.Sav_Clock_Byte AND "Clock_Byte"; "HMI SYS".Support.Sav_Clock_Byte := "Clock_Byte"; |
|
|
|
Netzwerk 3: CALL distributor
"DI MAIN GLB"(); —>"DI MAIN P01"(); —>"DI MAIN P02"(); —>"DI MAIN P03"(); —>"DI MAIN P04"(); —>"DI MAIN P05"(); // ---- —>"DI OUT P01"(); —>"DI OUT P02"(); —>"DI OUT P03"(); —>"DI OUT P04"(); —>"DI OUT P05"(); |
|
|
|
Netzwerk 4: First cycle evaluation
U "M00 log 1" L s5t#2s SE "T00 OB1 FirstCycle SE" U "T00 OB1 FirstCycle SE" = "M00 OB1 FirstCycle" |
|
|
|
Netzwerk 5: Flag logic =0, =1
"M00 log 0" := FALSE; "M00 log 1" := TRUE; |
|
|
|
Netzwerk 6: End measuring runtime (End Cycle)
"HMI SYS".Support.LastCycle := RUNTIME("HMI SYS".Support.LastCycle_inout); "HMI SYS".Support.LastCycle_real := LREAL_TO_REAL(IN := "HMI SYS".Support.LastCycle); |
|
|
|
FB20 MAIN GLB : Global operating modes and signals evaluation |
|
|
|
Netzwerk 1: Fault acknowledgement
"M00 ACK Imp" := NOT "M00 ACK FP" AND "HMI KEY".SYS.GLB.F1_AckKey; "M00 ACK FP" := "HMI KEY".SYS.GLB.F1_AckKey; |
|
|
|
Netzwerk 2: Call main station safety program
"M00 EStp ok" := "E00 EStp ok"; |
|
|
|
Netzwerk 3: GLB FLT faults monitoring
#FLT(FLT_MODULE := "M00 FLT ModuStp"); |
|
|
|
Netzwerk 4: Assigned failure complete machine
"M00 EStp ok" := "E00 S03 EStop"; "A00 Y56 OnOff" := "E00 S01 SftyDorCLS"; |
|
|
|
Netzwerk 5: Set failure complet machine
IF "M00 FltCmpltMaIS" THEN "M00 FltCmpltMaSR" := true; END_IF;
IF "M00 FltCmpltMaSR" AND NOT "M00 Flt ACK" THEN IF "M00 FltCmpltMaSR" AND "M00 ACK Imp" THEN "M00 Flt ACK" := TRUE; END_IF; ELSIF NOT "M00 FltCmpltMaIS" AND "M00 Flt ACK" THEN "M00 FltCmpltMaSR" := "M00 Flt ACK" := FALSE; END_IF; |
|
|
|
Netzwerk 6: Query assembly module at home position
"M00 HomPos" := "M01 HomPos" AND "M02 HomPos" AND "M03 HomPos" AND "M04 HomPos" AND "M05 HomPos" AND "DatOfMod".GLB.STS.RunTimeCntr_seq3 > 0 AND "DatOfMod".GLB.STS.RunTimeCntr_seq4 > 0;
IF "M00 HomPos" THEN "M00 HomPosSR" := TRUE; END_IF; |
|
|
|
Netzwerk 7: Start operating mode AUTOMATIC
IF "HMI KEY".SYS.GLB.F3_OM_AUTO_ON AND ("M00 HomPosSR" OR "M00 HomPos") THEN "M00 OM AUTO" := TRUE; "M00 OM MANUAL" := "M00 OM HOME POS" := "M00 ManuCmpltMa run" := FALSE; ELSIF "M00 OM AUTO" AND "HMI KEY".SYS.GLB.F5_Start AND ("M00 HomPosSR" OR "M00 HomPos") THEN "M00 AutoCmpltMa run" := TRUE; END_IF; |
|
|
|
Netzwerk 8: Start operating mode MANUAL
IF "HMI KEY".SYS.GLB.F4_OM_MANU_ON THEN "M00 OM MANUAL" := TRUE; "M00 OM AUTO" := "M00 AutoCmpltMa run" := "M00 OM HOME POS" := FALSE; ELSIF "HMI KEY".SYS.GLB.F5_Start AND "M00 OM MANUAL" THEN "M00 ManuCmpltMa run" := TRUE; END_IF;
"M00 ManuCmpltMa Imp" := NOT "M00 ManuCmpltMa run" AND "M00 ManuCmpltM FN"; "M00 ManuCmpltM FN" := "M00 ManuCmpltMa run"; #Halt_TOF_Pulse(IN := "M00 ManuCmpltMa Imp",PT := t#600ms); |
|
|
|
Netzwerk 9: STOP all operating mode
#tmp_save := "M00 OM HOME POS" OR "HMI KEY".SYS.GLB.F8_Stop AND ("M00 AutoCmpltMa run" OR "M00 ManuCmpltMa run"); IF #tmp_save OR "M00 FltCmpltMaSR" THEN "M00 AutoCmpltMa run" := FALSE; END_IF; IF #tmp_save OR "M00 ManuCmpltMa Imp" THEN "M00 ManuCmpltMa run" := FALSE; END_IF; |
|
|
|
Netzwerk 10: Impuls Start complete machine
"M00 TrnsSysRun Imp" := NOT "M00 TrnsSysRun FP" AND ("M00 AutoCmpltMa run" OR "M00 ManuCmpltMa run" OR #SET.SET.S.steps); "M00 TrnsSysRun FP" := "M00 AutoCmpltMa run" OR "M00 ManuCmpltMa run" OR #SET.SET.S.steps; |
|
|
|
Netzwerk 11: Show key colour on HMI
"HMI KEY".SYS.GLB.F15_OM_ON_RUN := "M00 TrnsSysRun FP"; "HMI KEY".SYS.GLB.F11_Show_KeyColour_Start_Stop := "M00 AutoCmpltMa run" OR "M00 ManuCmpltMa run" OR #SET.SET.S.steps; "HMI KEY".SYS.GLB.F14_Show_Key_Start_Stop := "M00 OM AUTO" OR "M00 OM MANUAL" OR "M00 OM HOME POS"; |
|
|
|
Netzwerk 12: Enable running each module
"M00 Enabled" := "M00 OM HOME POS" AND NOT "M00 FLT CmpltMaSR"; "M01 Enabled" := "M00 AutoCmpltMa run" AND NOT "M01 FLT ModuStpSR"; "M02 Enabled" := "M00 AutoCmpltMa run" AND NOT "M02 FLT ModuStpSR"; "M03 Enabled" := "M00 AutoCmpltMa run" AND NOT "M03 FLT ModuStpSR"; "M04 Enabled" := "M00 AutoCmpltMa run" AND NOT "M04 FLT ModuStpSR"; "M05 Enabled" := "M00 AutoCmpltMa run" AND NOT "M05 FLT ModuStpSR"; |
|
|
|
Netzwerk 13: START home position complete machine
IF "HMI KEY".SYS.GLB.F7_OM_HOM_POS_ON AND NOT "M00 HomPos" THEN "M00 OM HOME POS" := TRUE; "M00 OM AUTO" := "M00 OM MANUAL" := FALSE; ELSIF "HMI KEY".SYS.GLB.F5_Start AND "M00 OM HOME POS" AND NOT "M00 FLT CmpltMaSR" THEN #SET.SET.S.steps := TRUE; "M00 HomPosSR" := FALSE; END_IF; IF NOT "M00 OM HOME POS" OR "HMI KEY".SYS.GLB.F8_Stop THEN #SET.SET.S.steps := FALSE; END_IF;
"M00 Active" := #SET.SET.S.steps; #SET.SET.S.steph := "M00 FltCmpltMaSR"; #SET(ACT_STEP => #SET.STEP_NO); |
|
|
|
FB21 SET GLB : execute home position of all modules
|
|
|
|
Netzwerk 1: SET execute home position
#SET(MAX_STEP := 4); #ACT_STEP := #SET.S.stepact; #SET.S.DlyStart.PT := t#200ms; |
|
|
|
Netzwerk 2: Step jump distributor
CASE #SET.S.stepact OF 0: // Waiting for enable #SET.S.stepd := #SET.S.steps;
1: // Query M5_Z axis home HomDone #FLT."3_FAULT_00_15".%X0 := NOT "DI OUT P02".M5_Z.DRV.Support.HomDone; #SET.S.stepd := "DI OUT P02".M5_Z.DRV.Support.HomDone;
2: // Create pulse master move to home position "M05 Init" := #SET.S.DlyStart.Q; #SET.S.stepd := #SET.S.stepd := NOT #SET.S.DlyStart.Q AND "M05 HomPos";
3: // Create puls all slave move to home position "M01 Init" := "M02 Init" := "M03 Init" := "M04 Init" := #SET.S.DlyStart.Q; #SET.S.stepd := NOT #SET.S.DlyStart.Q;
4: // End home position complet machine IF "M00 HomPos" THEN "M00 OM HOME POS" := FALSE; END_IF; END_CASE; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|