```pascal // Block Type: FB // Block Name (Original): ProcedureBlendFill StartUp // Block Number: 1814 // Original Network Languages: LAD FUNCTION_BLOCK "ProcedureBlendFill_StartUp" { S7_Optimized_Access := 'TRUE' } VERSION : 0.1 VAR_STAT mTransition : Bool; mFillerLoadAgain_ONS : Bool; mFillerFirstLoadTmrON : Bool; mFillerLoadAgain : Bool; mFillerLoadAfterDrain : Bool; mStepNum : Int; mTimeStep : Int; mFillerFirstLoadTmr : "TON_TIME:v1.0"; END_VAR VAR_TEMP mFillerProdLoading : Real; END_VAR #_1M : Bool; // Auto-generated temporary #TON_INSTANCE_28 : Bool; // Auto-generated temporary BEGIN // Network 1: Qualifier (Original Language: LAD) "Procedure_Variables"."BlendFill_StartUp"."Qualifier" := ("gBlenderProdMode" AND "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_BlendFillSystem" AND "gBlenderSuppliesOk" AND "Procedure_Variables"."TN301_StartUp"."Done" AND "Procedure_Variables"."CarboWaterLine"."Done" AND "Procedure_Variables"."FTP302Line_Preparation"."Done") OR ("gBlenderProdMode" AND "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_BlendFillSystem" AND "gBlenderSuppliesOk" AND "Procedure_Variables"."TN301_StartUp"."Done" AND "Procedure_Variables"."CarboWaterLine"."Done" AND "Blender_Variables_Pers"."gWaterRecipe") OR ("gBlenderProdMode" AND "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_BlendFillSystem" AND "gBlenderSuppliesOk" AND "Procedure_Variables"."TN301_StartUp"."Done" AND "Blender_Variables_Pers"."gCarboStillProduct" AND "Procedure_Variables"."FTP302Line_Preparation"."Done") OR ("gBlenderProdMode" AND "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_BlendFillSystem" AND "gBlenderSuppliesOk" AND "Procedure_Variables"."TN301_StartUp"."Done" AND "Blender_Variables_Pers"."gCarboStillProduct" AND "Blender_Variables_Pers"."gWaterRecipe"); // Network 2: Request (Original Language: LAD) "Procedure_Variables"."BlendFill_StartUp"."Request" := ("Procedure_Variables"."Blender_Run"."Latch" AND "Procedure_Variables"."BlendFill_StartUp"."Qualifier") OR ("Procedure_Variables"."TM301_RunOut"."Latch" AND "Procedure_Variables"."BlendFill_StartUp"."Qualifier"); // Network 3: Load Again (Original Language: LAD) // PBox SymPy processed, logic in consumer "mFillerLoadAgain_ONS" := "Procedure_Variables"."BlendFill_StartUp"."Done" AND "gIN_FillerEndTankFilling"; // P_TRIG("Procedure_Variables"."BlendFill_StartUp"."Done" AND "gIN_FillerEndTankFilling") - Mem: "mFillerLoadAgain_ONS" IF "Procedure_Variables"."BlendFill_StartUp"."Done" AND "gIN_FillerEndTankFilling" AND NOT "mFillerLoadAgain_ONS" THEN "mFillerLoadAgain" := TRUE; END_IF; // Network 4: Wait (Original Language: LAD) "Procedure_Variables"."BlendFill_StartUp"."Wait" := "gIN_FillerProdReady" OR ("gIN_Filler_AVM362_En" AND "gP_FillerProdLoad") OR ("gIN_PPM303_FCReady" AND "gP_FillerProdLoad"); // Network 5: Reset (Original Language: LAD) "Procedure_Variables"."BlendFill_StartUp"."Reset" := "gBlenderCIPMode" OR "gBlenderRinseMode"; // Network 6: Reset (Original Language: LAD) IF "Procedure_Variables"."BlendFill_StartUp"."Reset" THEN "mStepNum" := 0; "mTimeStep" := 0; END_IF; IF "gIN_FillerCIPDrainSelect" AND "Procedure_Variables"."BlendFill_StartUp"."Reset" THEN "mFillerLoadAgain" := FALSE; END_IF; IF "gIN_FillerCIPDrainSelect" AND "Procedure_Variables"."BlendFill_StartUp"."Reset" AND "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_FastChangeOverEnabled" THEN "mStepNum" := 4; END_IF; IF "gIN_FillerCIPDrainSelect" AND "Procedure_Variables"."BlendFill_StartUp"."Reset" AND "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_FastChangeOverEnabled" THEN "mFillerLoadAfterDrain" := TRUE; END_IF; IF "Procedure_Variables"."BlendFill_StartUp"."Reset" THEN "Procedure_Variables"."BlendFill_StartUp"."Done" := FALSE; END_IF; // Network 7: Step 4 if Load Again (Original Language: LAD) IF "mFillerLoadAgain_ONS" THEN "mStepNum" := 4; END_IF; // Network 8: Latch (Original Language: LAD) "Procedure_Variables"."BlendFill_StartUp"."Latch" := ("Procedure_Variables"."BlendFill_StartUp"."Done" AND "Procedure_Variables"."BlendFill_StartUp"."Latch" AND "Procedure_Variables"."BlendFill_StartUp"."Reset") OR ("Procedure_Variables"."BlendFill_StartUp"."Done" AND "Procedure_Variables"."BlendFill_StartUp"."Reset" AND "Procedure_Variables"."BlendFill_StartUp"."Request"); IF ("Procedure_Variables"."BlendFill_StartUp"."Done" AND "Procedure_Variables"."BlendFill_StartUp"."Latch" AND "Procedure_Variables"."BlendFill_StartUp"."Reset") OR ("Procedure_Variables"."BlendFill_StartUp"."Done" AND "Procedure_Variables"."BlendFill_StartUp"."Reset" AND "Procedure_Variables"."BlendFill_StartUp"."Request") THEN "HMI_Variables_Status"."Procedures"."BlenderStateNum" := 9; END_IF; // Network 9: Running (Original Language: LAD) "HMI_Variables_Status"."Procedures"."BlendFillSysStartUpRun" := "Procedure_Variables"."BlendFill_StartUp"."Latch" AND "Procedure_Variables"."BlendFill_StartUp"."Wait"; "Procedure_Variables"."BlendFill_StartUp"."Running" := "Procedure_Variables"."BlendFill_StartUp"."Latch" AND "Procedure_Variables"."BlendFill_StartUp"."Wait"; // Network 10: Sequence (Original Language: LAD) IF "Procedure_Variables"."BlendFill_StartUp"."Latch" THEN BlendFill_StartUp_Seq(mFillerLoadAfterDrain := "mFillerLoadAfterDrain", mFillerLoadAgain := "mFillerLoadAgain", mFillerProdLoadedInit := "mFillerProdLoadedInit", mFillerProdLoading := "mFillerProdLoading", mStep := "mStepNum", mTimer := "mTimeStep", mTransition := "mTransition"); END_IF; // Network 11: Status (Original Language: LAD) "HMI_Alarms"."gH_Status" := Eq("mStepNum", 4); // Network 12: Status (Original Language: LAD) "HMI_Alarms"."gH_Status" := "Procedure_Variables"."BlendFill_StartUp"."Latch" AND "Procedure_Variables"."TM301_Pressure"."Latch"; "HMI_Variables_Status"."Procedures"."BlendFillSysPressRun" := "Procedure_Variables"."BlendFill_StartUp"."Latch" AND "Procedure_Variables"."TM301_Pressure"."Latch"; // Network 13: Status (Original Language: LAD) "HMI_Alarms"."gH_Status" := "gP_FillerProdLoad" AND "Procedure_Variables"."BlendFill_StartUp"."Latch"; "HMI_Variables_Status"."Procedures"."BlendFillSysProdLoadRun" := "gP_FillerProdLoad" AND "Procedure_Variables"."BlendFill_StartUp"."Latch"; // Network 14: Send Run (Original Language: LAD) "HMI_Variables_Status"."Procedures"."BlendFillSysProdSendRun" := "Procedure_Variables"."BlendFill_StartUp"."Done" AND "gOUT_FillerProductAvail" AND "HMI_PID"."PPM303"."ManualControl"."PidEnable"; // Network 15: Blend Fill System Start Up To Do (Original Language: LAD) "HMI_Alarms"."gH_Message" := "Procedure_Variables"."BlendFill_StartUp"."Done" AND "gBlenderCIPMode" AND "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_BlendFillSystem" AND "gBlenderRinseMode" AND "Procedure_Variables"."BlendFill_StartUp"."Latch"; // Network 16: Blend Fill System Start Up Wait Filler Ready (Original Language: LAD) "HMI_Alarms"."gH_Message" := "Procedure_Variables"."BlendFill_StartUp"."Done" AND "gIN_Filler_AVM362_En" AND "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_BlendFillSystem" AND "Procedure_Variables"."BlendFill_StartUp"."Latch"; // Network 17: Wait filler flushing completed (Original Language: LAD) "HMI_Alarms"."gH_Message" := Eq("mStepNum", 2); // Network 18: Wait filler loading completed (Original Language: LAD) "HMI_Alarms"."gH_Message" := "gIN_FillerEndTankFilling" AND "gP_FillerProdLoad" AND "HMI_Blender_Parameters"."Processor_Options"."Blender_OPT"."_BlendFillSystem" AND "Procedure_Variables"."BlendFill_StartUp"."Latch"; // Network 19: TimeOut (Original Language: LAD) #TON_INSTANCE_28(IN := Eq("mStepNum", 5), PT := T#1M); // TODO: Declarar #TON_INSTANCE_28 : TON; "mFillerFirstLoadTimeOut" := #TON_INSTANCE_28.Q; END_FUNCTION_BLOCK ```