<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<RSLogix5000Content SchemaRevision="1.0" SoftwareRevision="33.00" TargetName="Line3_Bottling" TargetType="Controller" ContainsContext="false" ExportDate="Fri Sep 04 07:12:31 2026" ExportOptions="References NoRawData">
<Controller Use="Target" Name="Line3_Bottling" ProcessorType="5069-L330ER" MajorRev="33" MinorRev="11" ProjectCreationDate="Tue Mar 12 09:41:05 2024" LastModifiedDate="Fri Sep 04 07:10:02 2026" ProjectSN="16#60d7_a3c1">
<Description><![CDATA[Bottling Line 3 — 500 ml PET: rinser → 8-head filler → capper → 16-station labeler → case packer. Bottle tracking with BSL shift registers: the reject decision at the discharge photo-eye uses the fill and cap result of THAT bottle. Demo program for the LineKeeper simulator (linekeeper.net/demo).]]></Description>
<DataTypes>
<DataType Name="RECIPE_UDT" Family="NoFamily" Class="User"><Description><![CDATA[One product recipe: speed, fill time and the inspection window]]></Description><Members><Member Name="Speed_bpm" DataType="REAL" Dimension="0" Radix="Float" Hidden="false" ExternalAccess="Read/Write"/><Member Name="Fill_Time_ms" DataType="DINT" Dimension="0" Radix="Decimal" Hidden="false" ExternalAccess="Read/Write"/><Member Name="Fill_Target_ml" DataType="REAL" Dimension="0" Radix="Float" Hidden="false" ExternalAccess="Read/Write"/><Member Name="Fill_Min_ml" DataType="REAL" Dimension="0" Radix="Float" Hidden="false" ExternalAccess="Read/Write"/><Member Name="Fill_Max_ml" DataType="REAL" Dimension="0" Radix="Float" Hidden="false" ExternalAccess="Read/Write"/><Member Name="Cap_Torque_Nm" DataType="REAL" Dimension="0" Radix="Float" Hidden="false" ExternalAccess="Read/Write"/><Member Name="Label_Pos_mm" DataType="REAL" Dimension="0" Radix="Float" Hidden="false" ExternalAccess="Read/Write"/></Members></DataType>
</DataTypes>
<Modules>
<Module Name="Local" CatalogNumber="5069-L330ER" Vendor="1" ProductType="14" ProductCode="192" Major="33" Minor="11" ParentModule="Local" ParentModPortId="1" Inhibited="false" MajorFault="true"/>
<Module Name="Local_1" CatalogNumber="5069-IB16" Vendor="1" ProductType="7" ProductCode="1031" Major="2" Minor="11" ParentModule="Local" ParentModPortId="1" Inhibited="false" MajorFault="false"><Description><![CDATA[16 DI: 0 E-stop OK · 1 guard · 2 Start PB · 3 Stop PB (NC) · 4 Jog PB · 5 filler bottle PE · 6 capper jam PE · 7 labeler cycle PE · 8 air OK · 9 tank low-low (NC) · 10 cap torque OK · 11 discharge PE · 12 pump breaker OK · 13 filler outfeed PE]]></Description></Module>
<Module Name="Local_2" CatalogNumber="5069-OB16" Vendor="1" ProductType="7" ProductCode="1041" Major="2" Minor="11" ParentModule="Local" ParentModPortId="1" Inhibited="false" MajorFault="false"><Description><![CDATA[16 DO: 1 fill valve · 2 capper clutch · 3 fault beacon · 4 run lamp · 5 labeler clutch · 6 glycol valve · 7 horn · 8 supply pump · 9 reject pusher · 10 warning lamp (amber)]]></Description></Module>
<Module Name="Local_3" CatalogNumber="5069-IF8" Vendor="1" ProductType="10" ProductCode="1108" Major="2" Minor="11" ParentModule="Local" ParentModPortId="1" Inhibited="false" MajorFault="false"><Description><![CDATA[Analog in: Ch0 product RTD · Ch1 air pressure · Ch2 tank level · Ch3 filler flowmeter (last dose)]]></Description></Module>
<Module Name="Local_4" CatalogNumber="5069-OF4" Vendor="1" ProductType="10" ProductCode="1112" Major="2" Minor="11" ParentModule="Local" ParentModPortId="1" Inhibited="false" MajorFault="false"><Description><![CDATA[Analog out: Ch0 filler flow-controller setpoint (ml/s × 100)]]></Description></Module>
<Module Name="Conv_VFD" CatalogNumber="25B-D6P0N104" Vendor="1" ProductType="130" ProductCode="1024" Major="7" Minor="1" ParentModule="Local" ParentModPortId="2" Inhibited="false" MajorFault="false"><Description><![CDATA[PowerFlex 525, conveyor drive, EtherNet/IP]]></Description></Module>
</Modules>
<Tags>
<Tag Name="Start_PB" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Line START — pedestal pushbutton, mapped from Local:1:I.2 every scan. The HMI only shows it: the line starts from the machine, not from a screen]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Stop_PB" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Line STOP — pedestal pushbutton, NC contact on Local:1:I.3 inverted in the Inputs routine; 1 = pressed. Read-only for the HMI]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Jog_PB" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Hold-to-run jog — pedestal pushbutton, Local:1:I.4, Manual mode only. Read-only for the HMI]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Fault_Reset_PB" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Fault reset / acknowledge — HMI only, there is no reset button on the pedestal]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Shift_Reset_PB" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Zero the shift counters (HMI)]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Recipe_Load_PB" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Download the active recipe's setpoints (HMI)]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Filler_Enable" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Station enable (HMI): 0 = filler bypassed, bottles pass empty and the fill check is skipped]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="1"/></Data></Tag>
<Tag Name="Capper_Enable" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Station enable (HMI): 0 = capper bypassed, torque check skipped]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="1"/></Data></Tag>
<Tag Name="Labeler_Enable" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Station enable (HMI): 0 = labeler carousel declutched]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="1"/></Data></Tag>
<Tag Name="Reject_Enable" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Station enable (HMI): 0 = bad bottles are still counted at the discharge photo-eye, but the pusher never fires — they stay on the line]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="1"/></Data></Tag>
<Tag Name="Auto_Mode" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[1 = Auto (line runs from Start), 0 = Manual (jog only). Selected on the HMI, retained through power cycles]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="1"/></Data></Tag>
<Tag Name="EStop_OK" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[E-stop string healthy (safety relay feedback, Local:1:I.0)]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="1"/></Data></Tag>
<Tag Name="Guard_Closed" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Guard door closed (Local:1:I.1)]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="1"/></Data></Tag>
<Tag Name="Air_OK" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Plant air above 80 psi (pressure switch, Local:1:I.8)]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="1"/></Data></Tag>
<Tag Name="Safety_OK" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[E-stop and guards healthy]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="1"/></Data></Tag>
<Tag Name="Line_Ready" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[All permissives satisfied — Start is allowed]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Start_Req" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Start requested, horn sounding (latched until the run latch is set). Forcing this bit from a screen starts the horn sequence — on a real line too; that is why the device locks writes to it]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Run_Latch" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Run latch: set when the start-up horn has finished, cleared by Stop, a lost permissive or leaving Auto. Forcing this bit starts the conveyor — on a real line too; that is why the device locks writes to it]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Conveyor_Run" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Main conveyor run command — computed every scan from Run_Latch and the permissives; forcing it lasts one scan]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Conv_Jog" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Manual jog active]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Conv_VFD_Run" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Run command to the conveyor drive (Auto or jog)]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Conv_VFD_Fault" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Drive reports a fault (PowerFlex 525, EtherNet/IP)]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Conv_At_Speed" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Ramp finished and the drive within 4 bpm of the setpoint]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Speed_Err" TagType="Base" DataType="REAL" Radix="Float" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Line speed minus setpoint, bpm]]></Description><Data Format="Decorated"><DataValue DataType="REAL" Radix="Float" Value="0.0"/></Data></Tag>
<Tag Name="Run_Lamp" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Green stack-light segment (Local:2:O.4)]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Conv_Speed_Ref" TagType="Base" DataType="REAL" Radix="Float" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Speed reference to the drive, Hz]]></Description><Data Format="Decorated"><DataValue DataType="REAL" Radix="Float" Value="0.0"/></Data></Tag>
<Tag Name="Line_Speed" TagType="Base" DataType="REAL" Radix="Float" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Line speed, bottles per minute (drive feedback)]]></Description><Data Format="Decorated"><DataValue DataType="REAL" Radix="Float" Value="0.0"/></Data></Tag>
<Tag Name="Line_Speed_SP" TagType="Base" DataType="REAL" Radix="Float" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Line speed setpoint, bpm (HMI / recipe). Clamped 60..200 — 200 bpm is the line limit]]></Description><Data Format="Decorated"><DataValue DataType="REAL" Radix="Float" Value="180.0"/></Data></Tag>
<Tag Name="Fault_Active" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Any line fault latched — clears with Fault_Reset_PB once every cause is gone]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="1"/></Data></Tag>
<Tag Name="Fault_Code" TagType="Base" DataType="DINT" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[First fault: 0 OK · 1 E-stop · 2 guard open · 3 capper jam · 5 drive fault · 7 low air · 12 product temp high · 15 labeler clutch slip · 20 filler supply pump tripped / low level]]></Description><Data Format="Decorated"><DataValue DataType="DINT" Radix="Decimal" Value="3"/></Data></Tag>
<Tag Name="Fault_Beacon" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Red beacon (Local:2:O.3), flashes while faulted]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Warn_Lamp" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Amber stack-light segment (Local:2:O.10): a warning bit is set in Alarm_Word while no fault is latched]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Horn" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Horn (Local:2:O.7): start warning and new-fault alert]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Horn_Ack" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Fault horn acknowledged]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Flasher_1Hz" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[1 Hz flasher bit for lamps]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Alarm_Word" TagType="Base" DataType="DINT" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Alarm bits for the HMI: 0 fault · 1 E-stop · 2 guard · 3 temp>7 °C · 4 air<85 psi · 5 reject lot limit · 6 labeler cycle slow (> 1.25 × nominal) · 7 filler low · 8 supply pump breaker tripped]]></Description><Data Format="Decorated"><DataValue DataType="DINT" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Line_State" TagType="Base" DataType="DINT" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[0 Stopped · 1 Ready · 2 Starting · 3 Running · 4 Faulted]]></Description><Data Format="Decorated"><DataValue DataType="DINT" Radix="Decimal" Value="4"/></Data></Tag>
<Tag Name="Machine_State" TagType="Base" DataType="DINT" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Cycle step for the HMI sequencer: 1 Fill · 2 Cap · 3 Label · 4 Pack · 5 Discharge]]></Description><Data Format="Decorated"><DataValue DataType="DINT" Radix="Decimal" Value="1"/></Data></Tag>
<Tag Name="Filler_Ready" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Filler permissive (product level OK)]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="1"/></Data></Tag>
<Tag Name="Filler_Bottle_PE" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Bottle at the fill station (Local:1:I.5)]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Filler_Fill_Valve" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Fill valve open (Local:2:O.1)]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Filler_Pump" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Product supply pump (Local:2:O.8)]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Filler_Pump_OK" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Supply pump breaker closed — auxiliary contact on Local:1:I.12; 0 = breaker tripped, the pump cannot run]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="1"/></Data></Tag>
<Tag Name="Filler_Level_LL" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Product tank low-low (float switch, Local:1:I.9, NC)]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Fill_Done" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Timed fill finished for the bottle at the station]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Filler_Level" TagType="Base" DataType="REAL" Radix="Float" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Product tank level, % (Local:3:I.Ch2)]]></Description><Data Format="Decorated"><DataValue DataType="REAL" Radix="Float" Value="62.0"/></Data></Tag>
<Tag Name="Fill_Volume_ml" TagType="Base" DataType="REAL" Radix="Float" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Volume of the last bottle filled, ml (flowmeter, Local:3:I.Ch3)]]></Description><Data Format="Decorated"><DataValue DataType="REAL" Radix="Float" Value="500.0"/></Data></Tag>
<Tag Name="Fill_Flow_SP" TagType="Base" DataType="REAL" Radix="Float" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Setpoint to the filler's flow controller, ml/s (Local:4:O.Ch0): 500 ml over the recipe fill time — 250 ml/s at 2.0 s]]></Description><Data Format="Decorated"><DataValue DataType="REAL" Radix="Float" Value="250.0"/></Data></Tag>
<Tag Name="Tank_Temp_C" TagType="Base" DataType="REAL" Radix="Float" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Product temperature, °C (RTD, Local:3:I.Ch0). Glycol-cooled, target 4 °C]]></Description><Data Format="Decorated"><DataValue DataType="REAL" Radix="Float" Value="4.2"/></Data></Tag>
<Tag Name="Tank_Temp_SP" TagType="Base" DataType="REAL" Radix="Float" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Product temperature setpoint, °C (HMI)]]></Description><Data Format="Decorated"><DataValue DataType="REAL" Radix="Float" Value="4.0"/></Data></Tag>
<Tag Name="Temp_On_Th" TagType="Base" DataType="REAL" Radix="Float" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Glycol valve opening threshold (setpoint + 0.5)]]></Description><Data Format="Decorated"><DataValue DataType="REAL" Radix="Float" Value="4.5"/></Data></Tag>
<Tag Name="Glycol_Valve" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Glycol cooling valve open (Local:2:O.6)]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Air_Pressure_psi" TagType="Base" DataType="REAL" Radix="Float" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Plant air pressure, psi (Local:3:I.Ch1)]]></Description><Data Format="Decorated"><DataValue DataType="REAL" Radix="Float" Value="92.0"/></Data></Tag>
<Tag Name="Capper_Ready" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Capper permissive (no jam)]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Capper_Clutch" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Capper clutch engaged (Local:2:O.2)]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Capper_Jam_PE" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Jam photo-eye blocked (Local:1:I.6)]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Capper_Jam" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Capper jam latched]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="1"/></Data></Tag>
<Tag Name="Capper_Torque_OK" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Torque monitor: the cap the capper just closed is within limits (Local:1:I.10) — holds until the next cap]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="1"/></Data></Tag>
<Tag Name="Labeler_Ready" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Labeler permissive (no clutch slip)]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="1"/></Data></Tag>
<Tag Name="Labeler_Clutch" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Labeler carousel clutch engaged (Local:2:O.5)]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Labeler_Cycle_PE" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[One pulse per carousel revolution (Local:1:I.7)]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Labeler_Slip" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Carousel cycle watchdog expired — clutch slipping]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Cycle_Time_ms" TagType="Base" DataType="DINT" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Last carousel cycle, ms]]></Description><Data Format="Decorated"><DataValue DataType="DINT" Radix="Decimal" Value="6200"/></Data></Tag>
<Tag Name="Cycle_Time_s" TagType="Base" DataType="REAL" Radix="Float" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Last carousel cycle, seconds (5.3 s nominal at 180 bpm)]]></Description><Data Format="Decorated"><DataValue DataType="REAL" Radix="Float" Value="6.2"/></Data></Tag>
<Tag Name="Cycle_Nominal_s" TagType="Base" DataType="REAL" Radix="Float" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Nominal carousel cycle at the speed setpoint: 16 stations × 60 / bpm (5.3 s at 180 bpm)]]></Description><Data Format="Decorated"><DataValue DataType="REAL" Radix="Float" Value="5.33"/></Data></Tag>
<Tag Name="Cycle_Warn_s" TagType="Base" DataType="REAL" Radix="Float" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Slow-cycle warning threshold for the HMI: 1.25 × nominal (6.7 s at 180 bpm)]]></Description><Data Format="Decorated"><DataValue DataType="REAL" Radix="Float" Value="6.67"/></Data></Tag>
<Tag Name="Filler_Outfeed_PE" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Bottle leaving the filler carousel (Local:1:I.13) — one pulse per belt pitch; it steps the bottle-tracking registers]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Pitch_Pulse" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[One-scan pulse per bottle leaving the filler = one pitch of the belt]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Fill_Bad" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Fill verdict for the bottle leaving the filler: dose outside the recipe window (the check is skipped with the filler bypassed)]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Cap_Bad" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Cap verdict for the bottle the capper just closed: torque monitor not OK (the check is skipped with the capper bypassed)]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Fill_Track" TagType="Base" DataType="DINT" Dimensions="2" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Bottle tracking (BSL shift register): bit n = fill verdict of the bottle n pitches past the filler — bit 17 is at the discharge photo-eye, bit 18 in front of the reject pusher. 1 = bad]]></Description><Data Format="Decorated"><Array DataType="DINT" Dimensions="2" Radix="Decimal"><Element Index="[0]" Value="0"/><Element Index="[1]" Value="0"/></Array></Data></Tag>
<Tag Name="Cap_Track" TagType="Base" DataType="DINT" Dimensions="2" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Bottle tracking (BSL shift register): bit n = cap verdict of the bottle n pitches past the capper — bit 10 is at the discharge photo-eye, bit 11 in front of the reject pusher. 1 = bad]]></Description><Data Format="Decorated"><Array DataType="DINT" Dimensions="2" Radix="Decimal"><Element Index="[0]" Value="0"/><Element Index="[1]" Value="0"/></Array></Data></Tag>
<Tag Name="Fill_Ctl" TagType="Base" DataType="CONTROL" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[BSL control block for Fill_Track (LEN = 32 bits, UL = the bit shifted out)]]></Description><Data Format="Decorated"><Structure DataType="CONTROL"><DataValueMember Name="LEN" DataType="DINT" Radix="Decimal" Value="32"/><DataValueMember Name="POS" DataType="DINT" Radix="Decimal" Value="0"/><DataValueMember Name="EN" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="EU" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="DN" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="EM" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="ER" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="UL" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="IN" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="FD" DataType="BOOL" Radix="Decimal" Value="0"/></Structure></Data></Tag>
<Tag Name="Cap_Ctl" TagType="Base" DataType="CONTROL" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[BSL control block for Cap_Track (LEN = 32 bits, UL = the bit shifted out)]]></Description><Data Format="Decorated"><Structure DataType="CONTROL"><DataValueMember Name="LEN" DataType="DINT" Radix="Decimal" Value="32"/><DataValueMember Name="POS" DataType="DINT" Radix="Decimal" Value="0"/><DataValueMember Name="EN" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="EU" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="DN" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="EM" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="ER" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="UL" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="IN" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="FD" DataType="BOOL" Radix="Decimal" Value="0"/></Structure></Data></Tag>
<Tag Name="Discharge_PE" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Bottle at the discharge photo-eye, 17 pitches past the filler (Local:1:I.11). The reject decision is made here, one pitch before the pusher]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Bottle_Done" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[One-scan pulse per bottle at the discharge photo-eye]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Bottle_Good" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[The bottle at the discharge photo-eye passed ITS OWN fill and cap checks — read out of the tracking registers, not from the last measurement]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Reject_Req" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Reject pusher requested: a bad bottle has arrived in front of the pusher]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Reject_Pusher" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Reject pusher solenoid (Local:2:O.9)]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Good_Parts" TagType="Base" DataType="DINT" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Good bottles, cumulative (never reset)]]></Description><Data Format="Decorated"><DataValue DataType="DINT" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Reject_Count" TagType="Base" DataType="DINT" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Rejected bottles, cumulative (never reset)]]></Description><Data Format="Decorated"><DataValue DataType="DINT" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Current_Recipe" TagType="Base" DataType="STRING" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Active recipe name]]></Description><Data Format="String" Length="10"><![CDATA['COLA-500ML']]></Data></Tag>
<Tag Name="Recipe_Active" TagType="Base" DataType="RECIPE_UDT" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Active recipe setpoints]]></Description><Data Format="Decorated"><Structure DataType="RECIPE_UDT"><DataValueMember Name="Speed_bpm" DataType="REAL" Radix="Float" Value="180.0"/><DataValueMember Name="Fill_Time_ms" DataType="DINT" Radix="Decimal" Value="2000"/><DataValueMember Name="Fill_Target_ml" DataType="REAL" Radix="Float" Value="500.0"/><DataValueMember Name="Fill_Min_ml" DataType="REAL" Radix="Float" Value="495.0"/><DataValueMember Name="Fill_Max_ml" DataType="REAL" Radix="Float" Value="505.0"/><DataValueMember Name="Cap_Torque_Nm" DataType="REAL" Radix="Float" Value="2.2"/><DataValueMember Name="Label_Pos_mm" DataType="REAL" Radix="Float" Value="12.5"/></Structure></Data></Tag>
<Tag Name="Start_Warn_Tmr" TagType="Base" DataType="TIMER" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Start-up horn, 2 s]]></Description><Data Format="Decorated"><Structure DataType="TIMER"><DataValueMember Name="PRE" DataType="DINT" Radix="Decimal" Value="2000"/><DataValueMember Name="ACC" DataType="DINT" Radix="Decimal" Value="0"/><DataValueMember Name="EN" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="TT" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="DN" DataType="BOOL" Radix="Decimal" Value="0"/></Structure></Data></Tag>
<Tag Name="Conv_Ramp_Tmr" TagType="Base" DataType="TIMER" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Drive ramp-up time]]></Description><Data Format="Decorated"><Structure DataType="TIMER"><DataValueMember Name="PRE" DataType="DINT" Radix="Decimal" Value="4000"/><DataValueMember Name="ACC" DataType="DINT" Radix="Decimal" Value="0"/><DataValueMember Name="EN" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="TT" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="DN" DataType="BOOL" Radix="Decimal" Value="0"/></Structure></Data></Tag>
<Tag Name="Filler_Cycle_Tmr" TagType="Base" DataType="TIMER" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Timed fill — preset follows Recipe_Active.Fill_Time_ms (2.0 s = 500 ml; a bottle has 8 heads / rate = 2.7 s in the carousel at 180 bpm, 2.4 s at the 200 bpm limit)]]></Description><Data Format="Decorated"><Structure DataType="TIMER"><DataValueMember Name="PRE" DataType="DINT" Radix="Decimal" Value="2000"/><DataValueMember Name="ACC" DataType="DINT" Radix="Decimal" Value="0"/><DataValueMember Name="EN" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="TT" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="DN" DataType="BOOL" Radix="Decimal" Value="0"/></Structure></Data></Tag>
<Tag Name="Filler_LL_Tmr" TagType="Base" DataType="TIMER" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Low-low level debounce — 3 s with the station enabled → fault 20]]></Description><Data Format="Decorated"><Structure DataType="TIMER"><DataValueMember Name="PRE" DataType="DINT" Radix="Decimal" Value="3000"/><DataValueMember Name="ACC" DataType="DINT" Radix="Decimal" Value="0"/><DataValueMember Name="EN" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="TT" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="DN" DataType="BOOL" Radix="Decimal" Value="0"/></Structure></Data></Tag>
<Tag Name="Temp_High_Tmr" TagType="Base" DataType="TIMER" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Product > 7 °C for this long → fault 12]]></Description><Data Format="Decorated"><Structure DataType="TIMER"><DataValueMember Name="PRE" DataType="DINT" Radix="Decimal" Value="10000"/><DataValueMember Name="ACC" DataType="DINT" Radix="Decimal" Value="0"/><DataValueMember Name="EN" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="TT" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="DN" DataType="BOOL" Radix="Decimal" Value="0"/></Structure></Data></Tag>
<Tag Name="Air_Low_Tmr" TagType="Base" DataType="TIMER" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Low air debounce]]></Description><Data Format="Decorated"><Structure DataType="TIMER"><DataValueMember Name="PRE" DataType="DINT" Radix="Decimal" Value="2000"/><DataValueMember Name="ACC" DataType="DINT" Radix="Decimal" Value="0"/><DataValueMember Name="EN" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="TT" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="DN" DataType="BOOL" Radix="Decimal" Value="0"/></Structure></Data></Tag>
<Tag Name="Capper_Jam_Tmr" TagType="Base" DataType="TIMER" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Jam photo-eye blocked for this long → jam]]></Description><Data Format="Decorated"><Structure DataType="TIMER"><DataValueMember Name="PRE" DataType="DINT" Radix="Decimal" Value="1500"/><DataValueMember Name="ACC" DataType="DINT" Radix="Decimal" Value="0"/><DataValueMember Name="EN" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="TT" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="DN" DataType="BOOL" Radix="Decimal" Value="0"/></Structure></Data></Tag>
<Tag Name="Labeler_Cycle_Tmr" TagType="Base" DataType="TIMER" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Carousel cycle watchdog — preset follows Line_Speed_SP: 1.4 × nominal cycle (7.5 s at 180 bpm, 11.2 s at 120)]]></Description><Data Format="Decorated"><Structure DataType="TIMER"><DataValueMember Name="PRE" DataType="DINT" Radix="Decimal" Value="7466"/><DataValueMember Name="ACC" DataType="DINT" Radix="Decimal" Value="0"/><DataValueMember Name="EN" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="TT" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="DN" DataType="BOOL" Radix="Decimal" Value="0"/></Structure></Data></Tag>
<Tag Name="Reject_Pusher_Tmr" TagType="Base" DataType="TIMER" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Reject pusher stroke, 200 ms — shorter than one pitch (300 ms at the 200 bpm limit), so consecutive bad bottles each get their own stroke]]></Description><Data Format="Decorated"><Structure DataType="TIMER"><DataValueMember Name="PRE" DataType="DINT" Radix="Decimal" Value="200"/><DataValueMember Name="ACC" DataType="DINT" Radix="Decimal" Value="0"/><DataValueMember Name="EN" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="TT" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="DN" DataType="BOOL" Radix="Decimal" Value="0"/></Structure></Data></Tag>
<Tag Name="Step_Tmr" TagType="Base" DataType="TIMER" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[HMI sequencer step time]]></Description><Data Format="Decorated"><Structure DataType="TIMER"><DataValueMember Name="PRE" DataType="DINT" Radix="Decimal" Value="1000"/><DataValueMember Name="ACC" DataType="DINT" Radix="Decimal" Value="0"/><DataValueMember Name="EN" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="TT" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="DN" DataType="BOOL" Radix="Decimal" Value="0"/></Structure></Data></Tag>
<Tag Name="Good_Ctr" TagType="Base" DataType="COUNTER" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Good bottles this lot]]></Description><Data Format="Decorated"><Structure DataType="COUNTER"><DataValueMember Name="PRE" DataType="DINT" Radix="Decimal" Value="10000"/><DataValueMember Name="ACC" DataType="DINT" Radix="Decimal" Value="0"/><DataValueMember Name="CU" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="CD" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="DN" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="OV" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="UN" DataType="BOOL" Radix="Decimal" Value="0"/></Structure></Data></Tag>
<Tag Name="Reject_Ctr" TagType="Base" DataType="COUNTER" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Rejects this lot — DN raises the lot-limit alarm]]></Description><Data Format="Decorated"><Structure DataType="COUNTER"><DataValueMember Name="PRE" DataType="DINT" Radix="Decimal" Value="100"/><DataValueMember Name="ACC" DataType="DINT" Radix="Decimal" Value="0"/><DataValueMember Name="CU" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="CD" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="DN" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="OV" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="UN" DataType="BOOL" Radix="Decimal" Value="0"/></Structure></Data></Tag>
</Tags>
<Programs>
<Program Name="MainProgram" TestEdits="false" MainRoutineName="MainRoutine" Disabled="false" UseAsFolder="false">
<Tags>
<Tag Name="Flash_Tmr1" TagType="Base" DataType="TIMER" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Flasher half-period]]></Description><Data Format="Decorated"><Structure DataType="TIMER"><DataValueMember Name="PRE" DataType="DINT" Radix="Decimal" Value="500"/><DataValueMember Name="ACC" DataType="DINT" Radix="Decimal" Value="0"/><DataValueMember Name="EN" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="TT" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="DN" DataType="BOOL" Radix="Decimal" Value="0"/></Structure></Data></Tag>
<Tag Name="Flash_Tmr2" TagType="Base" DataType="TIMER" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[Flasher half-period]]></Description><Data Format="Decorated"><Structure DataType="TIMER"><DataValueMember Name="PRE" DataType="DINT" Radix="Decimal" Value="500"/><DataValueMember Name="ACC" DataType="DINT" Radix="Decimal" Value="0"/><DataValueMember Name="EN" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="TT" DataType="BOOL" Radix="Decimal" Value="0"/><DataValueMember Name="DN" DataType="BOOL" Radix="Decimal" Value="0"/></Structure></Data></Tag>
<Tag Name="Reset_ONS" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[One-shot storage: fault reset]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Disch_ONS" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[One-shot storage: discharge photo-eye]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Pitch_ONS" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[One-shot storage: filler outfeed photo-eye (belt pitch)]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Lbl_ONS" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[One-shot storage: labeler cycle]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
<Tag Name="Rcp_ONS" TagType="Base" DataType="BOOL" Radix="Decimal" Constant="false" ExternalAccess="Read/Write"><Description><![CDATA[One-shot storage: recipe load]]></Description><Data Format="Decorated"><DataValue DataType="BOOL" Radix="Decimal" Value="0"/></Data></Tag>
</Tags>
<Routines>
<Routine Name="MainRoutine" Type="RLL"><RLLContent>
<Rung Number="0" Type="N">
<Comment><![CDATA[First scan after power-up: a known state for the sequencer, the run latch and the one-shots — the line never restarts by itself. The bottle-tracking registers are cleared too: bottles already on the belt at power-up are taken as good. Latched faults deliberately survive a power cycle (retentive memory) so an unexplained stop is never silently forgotten.]]></Comment>
<Text><![CDATA[XIC(S:FS)[MOV(1,Machine_State),OTU(Start_Req),OTU(Run_Latch),OTU(Reject_Req),MOV(0,Fill_Track[0]),MOV(0,Cap_Track[0])];]]></Text></Rung>
<Rung Number="1" Type="N">
<Comment><![CDATA[Physical inputs first — every rung below works on named tags.]]></Comment>
<Text><![CDATA[JSR(Inputs,0);]]></Text></Rung>
<Rung Number="2" Type="N">
<Text><![CDATA[JSR(Safety,0);]]></Text></Rung>
<Rung Number="3" Type="N">
<Text><![CDATA[JSR(Conveyor,0);]]></Text></Rung>
<Rung Number="4" Type="N">
<Text><![CDATA[JSR(Filler,0);]]></Text></Rung>
<Rung Number="5" Type="N">
<Text><![CDATA[JSR(Capper,0);]]></Text></Rung>
<Rung Number="6" Type="N">
<Text><![CDATA[JSR(Labeler,0);]]></Text></Rung>
<Rung Number="7" Type="N">
<Text><![CDATA[JSR(Production,0);]]></Text></Rung>
<Rung Number="8" Type="N">
<Comment><![CDATA[Alarms after the machine sections, so every section has already latched its own condition.]]></Comment>
<Text><![CDATA[JSR(Alarms,0);]]></Text></Rung>
<Rung Number="9" Type="N">
<Comment><![CDATA[Classic two-timer flasher: 500 ms on, 500 ms off.]]></Comment>
<Text><![CDATA[XIO(Flash_Tmr2.DN)TON(Flash_Tmr1,?,?);]]></Text></Rung>
<Rung Number="10" Type="N">
<Text><![CDATA[XIC(Flash_Tmr1.DN)TON(Flash_Tmr2,?,?);]]></Text></Rung>
<Rung Number="11" Type="N">
<Text><![CDATA[XIC(Flash_Tmr1.TT)OTE(Flasher_1Hz);]]></Text></Rung>
<Rung Number="12" Type="N">
<Comment><![CDATA[Outputs written last, from the tags the logic just computed.]]></Comment>
<Text><![CDATA[JSR(Outputs,0);]]></Text></Rung>
</RLLContent></Routine>
<Routine Name="Inputs" Type="RLL"><RLLContent>
<Rung Number="0" Type="N">
<Comment><![CDATA[Safety relay output: 1 = both E-stop channels closed and the relay reset. The relay does the real stopping; this bit only tells the logic why.]]></Comment>
<Text><![CDATA[XIC(Local:1:I.Data.0)OTE(EStop_OK);]]></Text></Rung>
<Rung Number="1" Type="N">
<Text><![CDATA[XIC(Local:1:I.Data.1)OTE(Guard_Closed);]]></Text></Rung>
<Rung Number="2" Type="N">
<Comment><![CDATA[Pedestal pushbuttons come in here every scan. Writing Start_PB from an HMI lasts until the next scan — the button is on the machine.]]></Comment>
<Text><![CDATA[XIC(Local:1:I.Data.2)OTE(Start_PB);]]></Text></Rung>
<Rung Number="3" Type="N">
<Comment><![CDATA[STOP is a normally-closed contact: the input drops when pressed (or when the wire breaks), so the logic sees a press either way.]]></Comment>
<Text><![CDATA[XIO(Local:1:I.Data.3)OTE(Stop_PB);]]></Text></Rung>
<Rung Number="4" Type="N">
<Text><![CDATA[XIC(Local:1:I.Data.4)OTE(Jog_PB);]]></Text></Rung>
<Rung Number="5" Type="N">
<Text><![CDATA[XIC(Local:1:I.Data.5)OTE(Filler_Bottle_PE);]]></Text></Rung>
<Rung Number="6" Type="N">
<Text><![CDATA[XIC(Local:1:I.Data.6)OTE(Capper_Jam_PE);]]></Text></Rung>
<Rung Number="7" Type="N">
<Text><![CDATA[XIC(Local:1:I.Data.7)OTE(Labeler_Cycle_PE);]]></Text></Rung>
<Rung Number="8" Type="N">
<Text><![CDATA[XIC(Local:1:I.Data.8)OTE(Air_OK);]]></Text></Rung>
<Rung Number="9" Type="N">
<Comment><![CDATA[The low-low float switch is NC: a broken wire reads as low level — fail-safe.]]></Comment>
<Text><![CDATA[XIO(Local:1:I.Data.9)OTE(Filler_Level_LL);]]></Text></Rung>
<Rung Number="10" Type="N">
<Text><![CDATA[XIC(Local:1:I.Data.10)OTE(Capper_Torque_OK);]]></Text></Rung>
<Rung Number="11" Type="N">
<Text><![CDATA[XIC(Local:1:I.Data.11)OTE(Discharge_PE);]]></Text></Rung>
<Rung Number="12" Type="N">
<Comment><![CDATA[Supply pump breaker auxiliary contact: 1 = closed. A tripped breaker is the usual reason the tank runs dry.]]></Comment>
<Text><![CDATA[XIC(Local:1:I.Data.12)OTE(Filler_Pump_OK);]]></Text></Rung>
<Rung Number="13" Type="N">
<Comment><![CDATA[Filler outfeed photo-eye: one pulse per bottle leaving the carousel — the belt's pitch clock for bottle tracking (Production).]]></Comment>
<Text><![CDATA[XIC(Local:1:I.Data.13)OTE(Filler_Outfeed_PE);]]></Text></Rung>
<Rung Number="14" Type="N">
<Comment><![CDATA[RTD input: 0..20000 counts = 0..50 °C.]]></Comment>
<Text><![CDATA[MUL(Local:3:I.Ch0Data,0.0025,Tank_Temp_C);]]></Text></Rung>
<Rung Number="15" Type="N">
<Text><![CDATA[MUL(Local:3:I.Ch1Data,0.01,Air_Pressure_psi);]]></Text></Rung>
<Rung Number="16" Type="N">
<Text><![CDATA[MUL(Local:3:I.Ch2Data,0.01,Filler_Level);]]></Text></Rung>
<Rung Number="17" Type="N">
<Comment><![CDATA[Filler flowmeter: the last dose in 0.1 ml.]]></Comment>
<Text><![CDATA[MUL(Local:3:I.Ch3Data,0.1,Fill_Volume_ml);]]></Text></Rung>
<Rung Number="18" Type="N">
<Comment><![CDATA[PowerFlex 525 output frequency in 0.01 Hz; 6 bottles/min per Hz on this gearing — 30 Hz = 180 bpm.]]></Comment>
<Text><![CDATA[MUL(Conv_VFD:I.OutputFreq,0.06,Line_Speed);]]></Text></Rung>
<Rung Number="19" Type="N">
<Text><![CDATA[XIC(Conv_VFD:I.Faulted)OTE(Conv_VFD_Fault);]]></Text></Rung>
</RLLContent></Routine>
<Routine Name="Outputs" Type="RLL"><RLLContent>
<Rung Number="0" Type="N">
<Comment><![CDATA[Conveyor drive over EtherNet/IP: start bit and frequency command.]]></Comment>
<Text><![CDATA[XIC(Conv_VFD_Run)OTE(Conv_VFD:O.Start);]]></Text></Rung>
<Rung Number="1" Type="N">
<Text><![CDATA[MUL(Conv_Speed_Ref,100.0,Conv_VFD:O.FreqCommand);]]></Text></Rung>
<Rung Number="2" Type="N">
<Comment><![CDATA[The line reset also clears the drive. The drive answers a scan later, so a drive fault takes two presses: one for the drive, one for the line.]]></Comment>
<Text><![CDATA[XIC(Fault_Reset_PB)OTE(Conv_VFD:O.ClearFault);]]></Text></Rung>
<Rung Number="3" Type="N">
<Text><![CDATA[XIC(Filler_Fill_Valve)OTE(Local:2:O.Data.1);]]></Text></Rung>
<Rung Number="4" Type="N">
<Text><![CDATA[XIC(Capper_Clutch)OTE(Local:2:O.Data.2);]]></Text></Rung>
<Rung Number="5" Type="N">
<Text><![CDATA[XIC(Fault_Beacon)OTE(Local:2:O.Data.3);]]></Text></Rung>
<Rung Number="6" Type="N">
<Text><![CDATA[XIC(Run_Lamp)OTE(Local:2:O.Data.4);]]></Text></Rung>
<Rung Number="7" Type="N">
<Text><![CDATA[XIC(Labeler_Clutch)OTE(Local:2:O.Data.5);]]></Text></Rung>
<Rung Number="8" Type="N">
<Text><![CDATA[XIC(Glycol_Valve)OTE(Local:2:O.Data.6);]]></Text></Rung>
<Rung Number="9" Type="N">
<Text><![CDATA[XIC(Horn)OTE(Local:2:O.Data.7);]]></Text></Rung>
<Rung Number="10" Type="N">
<Text><![CDATA[XIC(Filler_Pump)OTE(Local:2:O.Data.8);]]></Text></Rung>
<Rung Number="11" Type="N">
<Text><![CDATA[XIC(Reject_Pusher)OTE(Local:2:O.Data.9);]]></Text></Rung>
<Rung Number="12" Type="N">
<Text><![CDATA[XIC(Warn_Lamp)OTE(Local:2:O.Data.10);]]></Text></Rung>
<Rung Number="13" Type="N">
<Comment><![CDATA[Filler flow controller: 500 ml over the recipe fill time, in ml/s (250 ml/s at 2.0 s). The recipe time sets the dose; the carousel dwell caps how long the valve can pour.]]></Comment>
<Text><![CDATA[DIV(500000.0,Recipe_Active.Fill_Time_ms,Fill_Flow_SP);]]></Text></Rung>
<Rung Number="14" Type="N">
<Text><![CDATA[MUL(Fill_Flow_SP,100.0,Local:4:O.Ch0Data);]]></Text></Rung>
</RLLContent></Routine>
<Routine Name="Safety" Type="RLL"><RLLContent>
<Rung Number="0" Type="N">
<Text><![CDATA[XIC(EStop_OK)XIC(Guard_Closed)OTE(Safety_OK);]]></Text></Rung>
<Rung Number="1" Type="N">
<Comment><![CDATA[Every permissive in one place. If Start does nothing, this is the rung to read.]]></Comment>
<Text><![CDATA[XIC(Safety_OK)XIC(Air_OK)XIO(Fault_Active)XIC(Filler_Ready)XIC(Capper_Ready)XIC(Labeler_Ready)OTE(Line_Ready);]]></Text></Rung>
</RLLContent></Routine>
<Routine Name="Conveyor" Type="RLL"><RLLContent>
<Rung Number="0" Type="N">
<Comment><![CDATA[Start request from the pedestal button. Nothing moves yet: the horn sounds for 2 s first (start-up warning). The HMI resets faults, selects the mode and sets points — it does not start the line. Forcing Start_Req from a screen skips the button and starts the horn sequence — on a real line too; that is why the device locks writes to it.]]></Comment>
<Text><![CDATA[XIC(Start_PB)XIC(Line_Ready)XIC(Auto_Mode)XIO(Run_Latch)OTL(Start_Req);]]></Text></Rung>
<Rung Number="1" Type="N">
<Text><![CDATA[XIC(Start_Req)TON(Start_Warn_Tmr,?,?);]]></Text></Rung>
<Rung Number="2" Type="N">
<Comment><![CDATA[Horn finished: latch the run. Forcing this bit starts the conveyor — on a real line too; that is why the device locks writes to it.]]></Comment>
<Text><![CDATA[XIC(Start_Req)XIC(Start_Warn_Tmr.DN)OTL(Run_Latch);]]></Text></Rung>
<Rung Number="3" Type="N">
<Comment><![CDATA[Stop, a lost permissive or leaving Auto drops the latch; the run has to be requested again from the pedestal.]]></Comment>
<Text><![CDATA[[XIC(Stop_PB),XIO(Line_Ready),XIO(Auto_Mode)]OTU(Run_Latch);]]></Text></Rung>
<Rung Number="4" Type="N">
<Text><![CDATA[[XIC(Run_Latch),XIC(Stop_PB),XIO(Line_Ready)]OTU(Start_Req);]]></Text></Rung>
<Rung Number="5" Type="N">
<Comment><![CDATA[Run command, computed every scan from the latch and the permissives. Forcing this bit changes nothing: the rung rewrites it next scan, before the drive is written.]]></Comment>
<Text><![CDATA[XIC(Run_Latch)XIO(Stop_PB)XIC(Line_Ready)XIC(Auto_Mode)OTE(Conveyor_Run);]]></Text></Rung>
<Rung Number="6" Type="N">
<Comment><![CDATA[Manual mode: hold-to-run jog at 10 Hz.]]></Comment>
<Text><![CDATA[XIO(Auto_Mode)XIC(Jog_PB)XIC(Safety_OK)XIO(Fault_Active)OTE(Conv_Jog);]]></Text></Rung>
<Rung Number="7" Type="N">
<Text><![CDATA[[XIC(Conveyor_Run),XIC(Conv_Jog)]XIO(Conv_VFD_Fault)OTE(Conv_VFD_Run);]]></Text></Rung>
<Rung Number="8" Type="N">
<Comment><![CDATA[Setpoint clamp — 200 bpm is the line limit; the filler cannot keep up above it.]]></Comment>
<Text><![CDATA[GRT(Line_Speed_SP,200.0)MOV(200.0,Line_Speed_SP);]]></Text></Rung>
<Rung Number="9" Type="N">
<Text><![CDATA[LES(Line_Speed_SP,60.0)MOV(60.0,Line_Speed_SP);]]></Text></Rung>
<Rung Number="10" Type="N">
<Comment><![CDATA[6 bottles/min per Hz on this gearing.]]></Comment>
<Text><![CDATA[XIC(Conveyor_Run)DIV(Line_Speed_SP,6.0,Conv_Speed_Ref);]]></Text></Rung>
<Rung Number="11" Type="N">
<Text><![CDATA[XIC(Conv_Jog)XIO(Conveyor_Run)MOV(10.0,Conv_Speed_Ref);]]></Text></Rung>
<Rung Number="12" Type="N">
<Text><![CDATA[XIO(Conveyor_Run)XIO(Conv_Jog)MOV(0.0,Conv_Speed_Ref);]]></Text></Rung>
<Rung Number="13" Type="N">
<Text><![CDATA[XIC(Conveyor_Run)TON(Conv_Ramp_Tmr,?,?);]]></Text></Rung>
<Rung Number="14" Type="N">
<Text><![CDATA[SUB(Line_Speed,Line_Speed_SP,Speed_Err);]]></Text></Rung>
<Rung Number="15" Type="N">
<Comment><![CDATA[At speed: ramp finished and the drive within 4 bpm of the setpoint. A setpoint change drops it for the ramp, which holds off the labeler watchdog while the carousel catches up.]]></Comment>
<Text><![CDATA[XIC(Conv_Ramp_Tmr.DN)LIM(-4.0,Speed_Err,4.0)OTE(Conv_At_Speed);]]></Text></Rung>
<Rung Number="16" Type="N">
<Comment><![CDATA[Green lamp: steady while running, flashing during the start warning.]]></Comment>
<Text><![CDATA[[XIC(Conveyor_Run),XIC(Start_Req)XIC(Flasher_1Hz)]OTE(Run_Lamp);]]></Text></Rung>
</RLLContent></Routine>
<Routine Name="Filler" Type="RLL"><RLLContent>
<Rung Number="0" Type="N">
<Comment><![CDATA[Supply pump: on below 40 %, off above 85 % — latched hysteresis. It does not need the conveyor: the tank refills while the line is stopped.]]></Comment>
<Text><![CDATA[XIC(Safety_OK)XIC(Filler_Enable)XIC(Filler_Pump_OK)LES(Filler_Level,40.0)OTL(Filler_Pump);]]></Text></Rung>
<Rung Number="1" Type="N">
<Comment><![CDATA[Off above 85 %, on a safety trip, with the station bypassed, or when the breaker feedback is gone.]]></Comment>
<Text><![CDATA[[GRT(Filler_Level,85.0),XIO(Safety_OK),XIO(Filler_Enable),XIO(Filler_Pump_OK)]OTU(Filler_Pump);]]></Text></Rung>
<Rung Number="2" Type="N">
<Comment><![CDATA[Fill valve: station enabled, bottle at the station, fill not finished, enough product in the tank.]]></Comment>
<Text><![CDATA[XIC(Conveyor_Run)XIC(Filler_Enable)XIC(Filler_Bottle_PE)XIO(Fill_Done)XIO(Filler_Level_LL)OTE(Filler_Fill_Valve);]]></Text></Rung>
<Rung Number="3" Type="N">
<Comment><![CDATA[Timed fill. The preset comes from the recipe: a longer time is more product. A bottle spends 8 heads / line rate in the carousel (2.4 s at the 200 bpm limit) — set the fill longer than that and bottles leave short.]]></Comment>
<Text><![CDATA[XIC(Filler_Fill_Valve)TON(Filler_Cycle_Tmr,?,?);]]></Text></Rung>
<Rung Number="4" Type="N">
<Text><![CDATA[XIC(Filler_Cycle_Tmr.DN)OTL(Fill_Done);]]></Text></Rung>
<Rung Number="5" Type="N">
<Comment><![CDATA[The bottle has moved on — arm the next fill.]]></Comment>
<Text><![CDATA[XIO(Filler_Bottle_PE)OTU(Fill_Done);]]></Text></Rung>
<Rung Number="6" Type="N">
<Comment><![CDATA[Recipe fill time clamp: 0.5..5 s.]]></Comment>
<Text><![CDATA[LES(Recipe_Active.Fill_Time_ms,500)MOV(500,Recipe_Active.Fill_Time_ms);]]></Text></Rung>
<Rung Number="7" Type="N">
<Text><![CDATA[GRT(Recipe_Active.Fill_Time_ms,5000)MOV(5000,Recipe_Active.Fill_Time_ms);]]></Text></Rung>
<Rung Number="8" Type="N">
<Comment><![CDATA[Recipe → timer preset, every scan. Change the recipe member, not the preset.]]></Comment>
<Text><![CDATA[MOV(Recipe_Active.Fill_Time_ms,Filler_Cycle_Tmr.PRE);]]></Text></Rung>
<Rung Number="9" Type="N">
<Comment><![CDATA[Low-low for 3 s with the station enabled → fault 20 (Alarms). Usually the supply pump: its breaker feedback is Filler_Pump_OK.]]></Comment>
<Text><![CDATA[XIC(Filler_Enable)XIC(Filler_Level_LL)TON(Filler_LL_Tmr,?,?);]]></Text></Rung>
<Rung Number="10" Type="N">
<Comment><![CDATA[A bypassed station is always ready — its faults cannot hold the line. Low level holds the line only after the debounce, so the fault code is captured first.]]></Comment>
<Text><![CDATA[[XIO(Filler_LL_Tmr.DN),XIO(Filler_Enable)]OTE(Filler_Ready);]]></Text></Rung>
<Rung Number="11" Type="N">
<Comment><![CDATA[Glycol valve hysteresis: opens 0.5 °C above setpoint, closes at setpoint.]]></Comment>
<Text><![CDATA[ADD(Tank_Temp_SP,0.5,Temp_On_Th);]]></Text></Rung>
<Rung Number="12" Type="N">
<Text><![CDATA[GRT(Tank_Temp_C,Temp_On_Th)OTL(Glycol_Valve);]]></Text></Rung>
<Rung Number="13" Type="N">
<Text><![CDATA[LES(Tank_Temp_C,Tank_Temp_SP)OTU(Glycol_Valve);]]></Text></Rung>
<Rung Number="14" Type="N">
<Comment><![CDATA[Product above 7 °C for 10 s → fault 12. Warm product foams and underfills long before that.]]></Comment>
<Text><![CDATA[GRT(Tank_Temp_C,7.0)TON(Temp_High_Tmr,?,?);]]></Text></Rung>
</RLLContent></Routine>
<Routine Name="Capper" Type="RLL"><RLLContent>
<Rung Number="0" Type="N">
<Text><![CDATA[XIC(Conveyor_Run)XIC(Capper_Enable)XIO(Capper_Jam)OTE(Capper_Clutch);]]></Text></Rung>
<Rung Number="1" Type="N">
<Comment><![CDATA[Jam photo-eye blocked for 1.5 s with the clutch engaged → jam.]]></Comment>
<Text><![CDATA[XIC(Capper_Clutch)XIC(Capper_Jam_PE)TON(Capper_Jam_Tmr,?,?);]]></Text></Rung>
<Rung Number="2" Type="N">
<Text><![CDATA[XIC(Capper_Jam_Tmr.DN)OTL(Capper_Jam);]]></Text></Rung>
<Rung Number="3" Type="N">
<Comment><![CDATA[Reset clears the jam only after the blockage is physically removed.]]></Comment>
<Text><![CDATA[XIC(Fault_Reset_PB)XIO(Capper_Jam_PE)OTU(Capper_Jam);]]></Text></Rung>
<Rung Number="4" Type="N">
<Text><![CDATA[[XIO(Capper_Jam),XIO(Capper_Enable)]OTE(Capper_Ready);]]></Text></Rung>
</RLLContent></Routine>
<Routine Name="Labeler" Type="RLL"><RLLContent>
<Rung Number="0" Type="N">
<Text><![CDATA[XIC(Conveyor_Run)XIC(Labeler_Enable)XIO(Labeler_Slip)OTE(Labeler_Clutch);]]></Text></Rung>
<Rung Number="1" Type="N">
<Comment><![CDATA[One revolution of the 16-station carousel at the speed setpoint: 16 × 60 / bpm = 5.3 s at 180 bpm.]]></Comment>
<Text><![CDATA[DIV(960.0,Line_Speed_SP,Cycle_Nominal_s);]]></Text></Rung>
<Rung Number="2" Type="N">
<Comment><![CDATA[Watchdog preset follows the setpoint: 1.4 × nominal (7.5 s at 180 bpm, 11.2 s at 120). Slowing the line down is not a slipping clutch.]]></Comment>
<Text><![CDATA[MUL(Cycle_Nominal_s,1400.0,Labeler_Cycle_Tmr.PRE);]]></Text></Rung>
<Rung Number="3" Type="N">
<Comment><![CDATA[Slow-cycle warning for the HMI (Alarm_Word.6): 1.25 × nominal. A worn clutch warns here long before the watchdog trips.]]></Comment>
<Text><![CDATA[MUL(Cycle_Nominal_s,1.25,Cycle_Warn_s);]]></Text></Rung>
<Rung Number="4" Type="N">
<Comment><![CDATA[Cycle watchdog: at speed, one carousel revolution must finish within the preset. Held off during the drive ramp.]]></Comment>
<Text><![CDATA[XIC(Labeler_Clutch)XIC(Conv_At_Speed)TON(Labeler_Cycle_Tmr,?,?);]]></Text></Rung>
<Rung Number="5" Type="N">
<Comment><![CDATA[Each revolution: capture the cycle time for the HMI, restart the watchdog. A worn clutch shows up here first — as a slowly growing number.]]></Comment>
<Text><![CDATA[XIC(Labeler_Cycle_PE)XIC(Conv_At_Speed)ONS(Lbl_ONS)[MOV(Labeler_Cycle_Tmr.ACC,Cycle_Time_ms),RES(Labeler_Cycle_Tmr)];]]></Text></Rung>
<Rung Number="6" Type="N">
<Text><![CDATA[DIV(Cycle_Time_ms,1000.0,Cycle_Time_s);]]></Text></Rung>
<Rung Number="7" Type="N">
<Comment><![CDATA[Watchdog expired: the clutch is slipping (or the carousel is stuck).]]></Comment>
<Text><![CDATA[XIC(Labeler_Cycle_Tmr.DN)OTL(Labeler_Slip);]]></Text></Rung>
<Rung Number="8" Type="N">
<Text><![CDATA[XIC(Fault_Reset_PB)OTU(Labeler_Slip);]]></Text></Rung>
<Rung Number="9" Type="N">
<Text><![CDATA[[XIO(Labeler_Slip),XIO(Labeler_Enable)]OTE(Labeler_Ready);]]></Text></Rung>
</RLLContent></Routine>
<Routine Name="Production" Type="RLL"><RLLContent>
<Rung Number="0" Type="N">
<Comment><![CDATA[Bottle tracking: every bottle leaving the filler is one pitch of the belt. Both shift registers step here.]]></Comment>
<Text><![CDATA[XIC(Filler_Outfeed_PE)ONS(Pitch_ONS)OTE(Pitch_Pulse);]]></Text></Rung>
<Rung Number="1" Type="N">
<Comment><![CDATA[The dose the flowmeter measured for the bottle now leaving the filler. A bypassed filler skips the check.]]></Comment>
<Text><![CDATA[XIC(Filler_Enable)[LES(Fill_Volume_ml,Recipe_Active.Fill_Min_ml),GRT(Fill_Volume_ml,Recipe_Active.Fill_Max_ml)]OTE(Fill_Bad);]]></Text></Rung>
<Rung Number="2" Type="N">
<Comment><![CDATA[The fill result rides with its bottle: bit n is the bottle n pitches past the filler — 17 at the discharge photo-eye, 18 in front of the reject pusher.]]></Comment>
<Text><![CDATA[XIC(Pitch_Pulse)BSL(Fill_Track[0],Fill_Ctl,Fill_Bad,32);]]></Text></Rung>
<Rung Number="3" Type="N">
<Comment><![CDATA[Torque monitor verdict for the bottle the capper just closed.]]></Comment>
<Text><![CDATA[XIC(Capper_Enable)XIO(Capper_Torque_OK)OTE(Cap_Bad);]]></Text></Rung>
<Rung Number="4" Type="N">
<Comment><![CDATA[The capper sits 7 pitches past the filler, so its verdict reaches the photo-eye at bit 10 and the pusher at bit 11.]]></Comment>
<Text><![CDATA[XIC(Pitch_Pulse)BSL(Cap_Track[0],Cap_Ctl,Cap_Bad,32);]]></Text></Rung>
<Rung Number="5" Type="N">
<Comment><![CDATA[One scan per bottle at the discharge photo-eye.]]></Comment>
<Text><![CDATA[XIC(Discharge_PE)ONS(Disch_ONS)OTE(Bottle_Done);]]></Text></Rung>
<Rung Number="6" Type="N">
<Comment><![CDATA[Good = this bottle's own fill and cap results, read out of the tracking registers.]]></Comment>
<Text><![CDATA[XIC(Bottle_Done)XIO(Fill_Track[0].17)XIO(Cap_Track[0].10)OTE(Bottle_Good);]]></Text></Rung>
<Rung Number="7" Type="N">
<Text><![CDATA[XIC(Bottle_Done)XIC(Bottle_Good)[ADD(Good_Parts,1,Good_Parts),CTU(Good_Ctr,?,?)];]]></Text></Rung>
<Rung Number="8" Type="N">
<Comment><![CDATA[Rejects are always counted at the photo-eye, whatever the reject station does.]]></Comment>
<Text><![CDATA[XIC(Bottle_Done)XIO(Bottle_Good)[ADD(Reject_Count,1,Reject_Count),CTU(Reject_Ctr,?,?)];]]></Text></Rung>
<Rung Number="9" Type="N">
<Comment><![CDATA[The bad bottle has just arrived in front of the pusher. With the reject station disabled it is counted and stays on the line.]]></Comment>
<Text><![CDATA[XIC(Pitch_Pulse)[XIC(Fill_Track[0].18),XIC(Cap_Track[0].11)]XIC(Reject_Enable)OTL(Reject_Req);]]></Text></Rung>
<Rung Number="10" Type="N">
<Comment><![CDATA[One 200 ms stroke per bad bottle — shorter than a pitch, so the arm is back before the next bottle.]]></Comment>
<Text><![CDATA[XIC(Reject_Req)TON(Reject_Pusher_Tmr,?,?)OTE(Reject_Pusher);]]></Text></Rung>
<Rung Number="11" Type="N">
<Text><![CDATA[XIC(Reject_Pusher_Tmr.DN)OTU(Reject_Req);]]></Text></Rung>
<Rung Number="12" Type="N">
<Text><![CDATA[XIC(Shift_Reset_PB)[RES(Good_Ctr),RES(Reject_Ctr)];]]></Text></Rung>
<Rung Number="13" Type="N">
<Comment><![CDATA[Cycle-step sequencer for the HMI: 1 Fill · 2 Cap · 3 Label · 4 Pack · 5 Discharge.]]></Comment>
<Text><![CDATA[XIC(Conveyor_Run)XIO(Step_Tmr.DN)TON(Step_Tmr,?,?);]]></Text></Rung>
<Rung Number="14" Type="N">
<Text><![CDATA[XIC(Step_Tmr.DN)ADD(Machine_State,1,Machine_State);]]></Text></Rung>
<Rung Number="15" Type="N">
<Text><![CDATA[GRT(Machine_State,5)MOV(1,Machine_State);]]></Text></Rung>
<Rung Number="16" Type="N">
<Text><![CDATA[XIO(Conveyor_Run)MOV(1,Machine_State);]]></Text></Rung>
<Rung Number="17" Type="N">
<Comment><![CDATA[Recipe download from the HMI: the speed setpoint. The fill time follows the recipe continuously (Filler rung 6).]]></Comment>
<Text><![CDATA[XIC(Recipe_Load_PB)ONS(Rcp_ONS)MOV(Recipe_Active.Speed_bpm,Line_Speed_SP);]]></Text></Rung>
</RLLContent></Routine>
<Routine Name="Alarms" Type="RLL"><RLLContent>
<Rung Number="0" Type="N">
<Comment><![CDATA[First-fault capture: the code is written only while no fault is latched, so the HMI shows the ROOT cause, not the avalanche that follows.]]></Comment>
<Text><![CDATA[XIO(EStop_OK)XIO(Fault_Active)[MOV(1,Fault_Code),OTL(Fault_Active)];]]></Text></Rung>
<Rung Number="1" Type="N">
<Text><![CDATA[XIO(Guard_Closed)XIO(Fault_Active)[MOV(2,Fault_Code),OTL(Fault_Active)];]]></Text></Rung>
<Rung Number="2" Type="N">
<Text><![CDATA[XIC(Capper_Jam)XIO(Fault_Active)[MOV(3,Fault_Code),OTL(Fault_Active)];]]></Text></Rung>
<Rung Number="3" Type="N">
<Text><![CDATA[XIC(Conv_VFD_Fault)XIO(Fault_Active)[MOV(5,Fault_Code),OTL(Fault_Active)];]]></Text></Rung>
<Rung Number="4" Type="N">
<Text><![CDATA[XIO(Air_OK)TON(Air_Low_Tmr,?,?);]]></Text></Rung>
<Rung Number="5" Type="N">
<Text><![CDATA[XIC(Air_Low_Tmr.DN)XIO(Fault_Active)[MOV(7,Fault_Code),OTL(Fault_Active)];]]></Text></Rung>
<Rung Number="6" Type="N">
<Text><![CDATA[XIC(Temp_High_Tmr.DN)XIO(Fault_Active)[MOV(12,Fault_Code),OTL(Fault_Active)];]]></Text></Rung>
<Rung Number="7" Type="N">
<Text><![CDATA[XIC(Labeler_Slip)XIO(Fault_Active)[MOV(15,Fault_Code),OTL(Fault_Active)];]]></Text></Rung>
<Rung Number="8" Type="N">
<Text><![CDATA[XIC(Filler_LL_Tmr.DN)XIO(Fault_Active)[MOV(20,Fault_Code),OTL(Fault_Active)];]]></Text></Rung>
<Rung Number="9" Type="N">
<Comment><![CDATA[Reset succeeds only when every cause has cleared — otherwise the same code comes straight back. A tripped pump breaker or a dry tank refuses the reset until the breaker is back and the pump has refilled past low-low (or the filler is bypassed).]]></Comment>
<Text><![CDATA[XIC(Fault_Reset_PB)ONS(Reset_ONS)XIC(Safety_OK)XIC(Air_OK)XIO(Capper_Jam)XIO(Labeler_Slip)XIO(Conv_VFD_Fault)XIO(Temp_High_Tmr.DN)XIO(Filler_LL_Tmr.DN)[XIC(Filler_Pump_OK),XIO(Filler_Enable)][OTU(Fault_Active),MOV(0,Fault_Code)];]]></Text></Rung>
<Rung Number="10" Type="N">
<Text><![CDATA[XIC(Fault_Active)XIC(Flasher_1Hz)OTE(Fault_Beacon);]]></Text></Rung>
<Rung Number="11" Type="N">
<Comment><![CDATA[Horn: start warning, and a new fault until someone acknowledges it.]]></Comment>
<Text><![CDATA[[XIC(Start_Req)XIO(Start_Warn_Tmr.DN),XIC(Fault_Active)XIO(Horn_Ack)]OTE(Horn);]]></Text></Rung>
<Rung Number="12" Type="N">
<Text><![CDATA[XIC(Fault_Reset_PB)OTL(Horn_Ack);]]></Text></Rung>
<Rung Number="13" Type="N">
<Text><![CDATA[XIO(Fault_Active)OTU(Horn_Ack);]]></Text></Rung>
<Rung Number="14" Type="N">
<Comment><![CDATA[Alarm word for the HMI banner — one bit per message.]]></Comment>
<Text><![CDATA[XIC(Fault_Active)OTE(Alarm_Word.0);]]></Text></Rung>
<Rung Number="15" Type="N">
<Text><![CDATA[XIO(EStop_OK)OTE(Alarm_Word.1);]]></Text></Rung>
<Rung Number="16" Type="N">
<Text><![CDATA[XIO(Guard_Closed)OTE(Alarm_Word.2);]]></Text></Rung>
<Rung Number="17" Type="N">
<Text><![CDATA[GRT(Tank_Temp_C,7.0)OTE(Alarm_Word.3);]]></Text></Rung>
<Rung Number="18" Type="N">
<Text><![CDATA[LES(Air_Pressure_psi,85.0)OTE(Alarm_Word.4);]]></Text></Rung>
<Rung Number="19" Type="N">
<Text><![CDATA[XIC(Reject_Ctr.DN)OTE(Alarm_Word.5);]]></Text></Rung>
<Rung Number="20" Type="N">
<Comment><![CDATA[Labeler cycle slower than 1.25 × nominal at the current setpoint — the clutch is wearing.]]></Comment>
<Text><![CDATA[GRT(Cycle_Time_s,Cycle_Warn_s)OTE(Alarm_Word.6);]]></Text></Rung>
<Rung Number="21" Type="N">
<Text><![CDATA[XIC(Filler_Level_LL)OTE(Alarm_Word.7);]]></Text></Rung>
<Rung Number="22" Type="N">
<Comment><![CDATA[Supply pump breaker tripped: a warning the moment it happens, a fault once the tank actually runs dry.]]></Comment>
<Text><![CDATA[XIC(Filler_Enable)XIO(Filler_Pump_OK)OTE(Alarm_Word.8);]]></Text></Rung>
<Rung Number="23" Type="N">
<Comment><![CDATA[Amber stack light: any warning while no fault is latched. Faulted, the red beacon takes over.]]></Comment>
<Text><![CDATA[XIO(Fault_Active)[XIC(Alarm_Word.3),XIC(Alarm_Word.4),XIC(Alarm_Word.5),XIC(Alarm_Word.6),XIC(Alarm_Word.7),XIC(Alarm_Word.8)]OTE(Warn_Lamp);]]></Text></Rung>
<Rung Number="24" Type="N">
<Comment><![CDATA[Line state for the HMI: 0 Stopped · 1 Ready · 2 Starting · 3 Running · 4 Faulted.]]></Comment>
<Text><![CDATA[XIC(Fault_Active)MOV(4,Line_State);]]></Text></Rung>
<Rung Number="25" Type="N">
<Text><![CDATA[XIO(Fault_Active)XIO(Line_Ready)MOV(0,Line_State);]]></Text></Rung>
<Rung Number="26" Type="N">
<Text><![CDATA[XIC(Line_Ready)XIO(Conveyor_Run)XIO(Start_Req)MOV(1,Line_State);]]></Text></Rung>
<Rung Number="27" Type="N">
<Text><![CDATA[XIC(Start_Req)XIO(Conveyor_Run)MOV(2,Line_State);]]></Text></Rung>
<Rung Number="28" Type="N">
<Text><![CDATA[XIC(Conveyor_Run)MOV(3,Line_State);]]></Text></Rung>
</RLLContent></Routine>
</Routines>
</Program>
</Programs>
<Tasks>
<Task Name="MainTask" Type="CONTINUOUS" Priority="10" Watchdog="500" DisableUpdateOutputs="false" InhibitTask="false"><ScheduledPrograms><ScheduledProgram Name="MainProgram"/></ScheduledPrograms></Task>
</Tasks>
</Controller>
</RSLogix5000Content>
