// Block Name (Original): BlenderCtrl__Main // Block Number: 2000 // Original Language: LAD FUNCTION_BLOCK "BlenderCtrl__Main" { S7_Optimized_Access := 'TRUE' } VERSION : 0.1 VAR_INPUT END_VAR VAR_OUTPUT END_VAR VAR_IN_OUT END_VAR VAR_TEMP All_Auto_RETVAL : Int; Reset_SP_Word_RETVAL : Int; mResetWaterTot : Bool; mResetSyrupTot : Bool; mResetCO2Tot : Bool; mResetProductTot : Bool; Block_Move_Err : Int; END_VAR BEGIN // Network 1: Clock Generation Clock Signal(); // Network 2: Machine Init BlenderCtrl_MachineInit(); // Network 3: Filler Head // RLO: "AUX FALSE" // Network 4: Emergency Pressed // RLO: "gIN_VoltageOk" // Network 5: Air and CO2 pressure ok and auxiliary ok // RLO: "gIN_LinePressCO2Ok" // RLO: "gWorkshopTest" // RLO: "gWorkshopTest" AND "gWorkshop_Co2_Presence" // RLO: ("gWorkshopTest" AND "gWorkshop_Co2_Presence") AND "gWorkshop_CIP_Signals" // RLO: ("gIN_LinePressCO2Ok" OR (("gWorkshopTest" AND "gWorkshop_Co2_Presence") AND "gWorkshop_CIP_Signals")) AND "HMI_Digital"."_PAL_S11"."Filtered" // RLO: "Disable_Bit" // RLO: ((("gIN_LinePressCO2Ok" OR (("gWorkshopTest" AND "gWorkshop_Co2_Presence") AND "gWorkshop_CIP_Signals")) AND "HMI_Digital"."_PAL_S11"."Filtered") OR "Disable_Bit") AND "gIN_VoltageOk" "gBlenderSuppliesOk" := ((("gIN_LinePressCO2Ok" OR (("gWorkshopTest" AND "gWorkshop_Co2_Presence") AND "gWorkshop_CIP_Signals")) AND "HMI_Digital"."_PAL_S11"."Filtered") OR "Disable_Bit") AND "gIN_VoltageOk"; // Network 6: Blender State Num "HMI_Variables_Status"."Procedures"."BlenderStateNum" := 0; // Network 7: Delay Power On // RLO: "FirstScan" // Network 8: Production Mode // RLO: "HMI_Variables_Status"."System"."Blender_Prod_CIP" "gBlenderProdMode" := "HMI_Variables_Status"."System"."Blender_Prod_CIP"; // Network 9: CIp Mode // RLO: "HMI_Variables_Status"."System"."Blender_Prod_CIP" "gBlenderCIPMode" := "HMI_Variables_Status"."System"."Blender_Prod_CIP"; IF "HMI_Variables_Status"."System"."Blender_Prod_CIP" THEN "HMI_Variables_Status"."Procedures"."BlenderStateNum" := 19; END_IF; // Network 10: Error Faults // RLO: "AUX FALSE" // Network 11: Filler Bottle Count Used to push Product // RLO: "System_RunOut_Variables"."ProdPipeRunOutWaterCount" "System_RunOut_Variables"."ProdPipeRunOutFillerBott" := "System_RunOut_Variables"."ProdPipeRunOutWaterCount"; // Network 12: Water Bypass Enable // RLO: "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_StillWaterByPass" // RLO: "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_ByPassDeair" // RLO: "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_ByPassDeair" AND "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Deaireation" // RLO: ("HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_StillWaterByPass" OR ("HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_ByPassDeair" AND "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Deaireation")) AND "Blender_Variables_Pers"."gWaterRecipe" // RLO: (("HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_StillWaterByPass" OR ("HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_ByPassDeair" AND "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Deaireation")) AND "Blender_Variables_Pers"."gWaterRecipe") AND "Blender_Variables_Pers"."gCarboStillRecipe" "gStillWaterByPassEn" := (("HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_StillWaterByPass" OR ("HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_ByPassDeair" AND "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Deaireation")) AND "Blender_Variables_Pers"."gWaterRecipe") AND "Blender_Variables_Pers"."gCarboStillRecipe"; // Network 13: Still Water Bypass // RLO: "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_BlendFillSystem" // RLO: "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_BlendFillSystem" AND "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_StillWaterByPass" // RLO: ("HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_BlendFillSystem" AND "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_StillWaterByPass") AND "Blender_Variables_Pers"."gWaterRecipe" // RLO: (("HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_BlendFillSystem" AND "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_StillWaterByPass") AND "Blender_Variables_Pers"."gWaterRecipe") AND "Blender_Variables_Pers"."gCarboStillRecipe" "gBlendFiStillWaterByPass" := (("HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_BlendFillSystem" AND "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_StillWaterByPass") AND "Blender_Variables_Pers"."gWaterRecipe") AND "Blender_Variables_Pers"."gCarboStillRecipe"; // Network 14: Manual Syrup Drain Valve Open - Operator Alarm // RLO: "gSyrupRoomEn" // RLO: "gSyrupRoomEn" AND "gIN_HVP301_Aux" // RLO: ("gSyrupRoomEn" AND "gIN_HVP301_Aux") AND "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_FastChangeOverEnabled" // RLO: (("gSyrupRoomEn" AND "gIN_HVP301_Aux") AND "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_FastChangeOverEnabled") AND "Procedure_Variables"."FTP302Line_Preparation"."Done" // RLO: ((("gSyrupRoomEn" AND "gIN_HVP301_Aux") AND "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_FastChangeOverEnabled") AND "Procedure_Variables"."FTP302Line_Preparation"."Done") AND "Procedure_Variables"."Syr_RunOut"."Done" // RLO: "gBlenderCIPMode" // RLO: "gBlenderCIPMode" AND "gIN_CIP_CIPRunning" // RLO: ("gBlenderCIPMode" AND "gIN_CIP_CIPRunning") AND "Procedure_Variables"."Blender_Run"."Running" "gHVP301_Open" := (((("gSyrupRoomEn" AND "gIN_HVP301_Aux") AND "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_FastChangeOverEnabled") AND "Procedure_Variables"."FTP302Line_Preparation"."Done") AND "Procedure_Variables"."Syr_RunOut"."Done") OR (("gBlenderCIPMode" AND "gIN_CIP_CIPRunning") AND "Procedure_Variables"."Blender_Run"."Running"); // Network 15: Manual Syrup Drain Valve Open - Operator Alarm // RLO: "gIN_HVM302_Aux" // Network 16: Maselli Control // RLO: "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_BrixMeter" // Cond: "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_MeterType" = 6 IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_MeterType" = 6 THEN Maselli_PA_Control(); END_IF; // Network 17: mPDS Control // RLO: "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_BrixMeter" // Cond: "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_MeterType" = 5 IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_MeterType" = 5 THEN mPDS_PA_Control(); END_IF; // Network 18: mPDS Syrup Control // RLO: "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_SyrBrixMeter" IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_SyrBrixMeter" THEN mPDS_SYR_PA_Control(); END_IF; // Network 19: Co2 Analog Input // GetProdBrixCO2_FromAnalogIn // CALL "GetProdBrixCO2_FromAn" // NOP 0 // RLO: "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_BrixMeter" // Cond: "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_MeterType" = 3 IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_MeterType" = 3 THEN GetProdBrixCO2_Anal_Inpt(); END_IF; // Network 20: Quality ProductQuality(); // Network 21: Input Data // ERROR: Call a bloque no soportado: Input // Network 22: Sel Brix Source Check SelCheckBrixSource(); // Network 23: Check Water Cooling System Temperature // RLO: "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_InverterRecirPumpPPM306" IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_InverterRecirPumpPPM306" THEN CTRLCoolingSystem(); END_IF; // Network 24: Tank Level TankLevel(); // Network 25: Production ONS // RLO: "gBlenderProdMode" // PBox 26 - Passing bit: "M19001" // RLO: "M19001" AND "mDelayPowerOnTmr" "gProductionONS" := "M19001" AND "mDelayPowerOnTmr"; // Network 26: Blender Prod Mode Init // RLO: "gProductionONS" // RLO: "Procedure_Variables"."Blender_Rinse"."ONS_Done" // RLO: ("gProductionONS" OR "Procedure_Variables"."Blender_Rinse"."ONS_Done") AND "Blender_Variables_Pers"."gBlenderStarted" IF ("gProductionONS" OR "Procedure_Variables"."Blender_Rinse"."ONS_Done") AND "Blender_Variables_Pers"."gBlenderStarted" THEN BlenderCtrl_ProdModeInit(); END_IF; // Network 27: Rinse ONS // RLO: "HMI_Variables_Status"."System"."Blender_Prod_CIP" // PBox 26 - Passing bit: "M19002" // RLO: "M19002" AND "mDelayPowerOnTmr" "gRinseONS" := "M19002" AND "mDelayPowerOnTmr"; // Network 28: CIP ONS // RLO: "gBlenderCIPMode" // PBox 26 - Passing bit: "M19003" // RLO: "M19003" AND "mDelayPowerOnTmr" "gCIPONS" := "M19003" AND "mDelayPowerOnTmr"; // Network 29: CIp Mode Init // RLO: "gCIPONS" IF "gCIPONS" THEN BlenderCtrl_CIPModeInit(); END_IF; // Network 30: Reset SPWords BlenderCtrl_ResetSPWord(); // Network 31: Blender Run Control BlenderRun__Control(); // Network 32: Tank Pressure Control Prod Tank PressCtrl(); // Network 33: Balaiage Baialage(); // Network 34: First Production // ERROR: Call a bloque no soportado: ProcedureFirstProduction // Network 35: CIP MAIN Calling CIPMain(); // Network 36: Blender Rinse BlenderRinse(); // Network 37: Safeties Safeties(); // Network 38: Instrument Scanner Instrument_Scanner(); // Network 39: Vacuum Control VacuumCtrl(); // Network 40: Syrup Room Control SyrupRoomCtrl(); // Network 41: Blend Procedure Data // RLO: "mDelayPowerOnTmr" IF "mDelayPowerOnTmr" THEN // ERROR: Call a bloque no soportado: Procedure END_IF; // Network 42: Pneumatic Valve Control Pneumatic Valve Ctrl(); // Network 43: Pumps Control PumpsControl(); // Network 44: Prod Report Manager // RLO: "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Report" IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Report" THEN ProdReportManager(); END_IF; // Network 45: Outputs Output(); // Network 46: SLIM BLOCK SLIM_Block(); // Network 47: Interlocking Panel 1 Interlocking_Panel_1(); // Network 48: Filler Control FillerControl(); // Network 49: Blender Ctrl Update PWORD BlenderCtrl_UpdatePWord(); // Network 50: ResetTotalizer // RLO: "gBlendResetTotalizer" // Network 51: ResetWaterTot // RLO: "gFTN301_ResetTot" // RLO: "mResetTotalizerTmr" // Network 52: Water VFM Reset Totalizer // RLO: "gFTN301_ResetTot" // Network 53: ResetCO2Tot // RLO: "gFTP302_ResetTot" // RLO: "mResetTotalizerTmr" // Network 54: Syrup MFM Reset Totalizer // RLO: "gFTP302_ResetTot" // Network 55: ResetProductTot // RLO: "gFTM303_ResetTot" // RLO: "mResetTotalizerTmr" // Network 56: CO2 MFM Reset Tot // RLO: "gFTM303_ResetTot" // Network 57: ResetCO2Tot // RLO: "gProductMFMResetTot" // RLO: "mResetTotalizerTmr" // Network 58: Reset Totalizer // RLO: "gProductMFMResetTot" // Network 59: Reset Totalizer // RLO: "gBlendResetTotalizer" // Network 60: Blender Ctrl Command // RLO: "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Simulation" IF "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_Simulation" THEN BlenderCtrl_MFM Command(); END_IF; // Network 61: DP Global Diag CPU_DP Global Diag(); // Network 62: Profibus Profibus Network(); // Network 63: Valve Fault ModValveFault(); // Network 64: All Auto // RLO: "HMI_Variables_Cmd"."Commands_From_HMI"."F7_DeviceControl"."Command" // RLO: "HMI_Variables_Cmd"."Commands_From_HMI"."F7_DeviceControl"."Command" AND "HMI_Variables_Cmd"."Commands_From_HMI"."F7_DeviceControl"."Enable" // Network 65: Ctrl HMI Manual Active BlenderCtrl_ManualActive(); // Network 66: Mod Copy Recipe // RLO: "HMI_Variables_Cmd"."Recipe"."Main_Page" // RLO: "HMI_Variables_Cmd"."Recipe"."Main_Page" AND "mFP_Recip_Main_Page" "mAux_FP_M700_1" := "HMI_Variables_Cmd"."Recipe"."Main_Page" AND "mFP_Recip_Main_Page"; // RLO: "HMI_Variables_Cmd"."Recipe"."Main_Page" // RLO: "HMI_Variables_Cmd"."Recipe"."Main_Page" AND "HMI_Variables_Cmd"."Recipe"."Edit" // RLO: "mAux_FP_M700_1" // Network 67: to HMI - Recipe Management // RLO: "AUX TRUE" IF "AUX TRUE" THEN // ERROR: Call a bloque no soportado: RecipeManagement - Prod END_IF; // Network 68: Recipe Calculation RecipeCalculation(); END_FUNCTION_BLOCK