diff --git a/PLC/Simulations/PMM/OIP/PMM.tscn b/PLC/Simulations/PMM/OIP/PMM.tscn
new file mode 100644
index 0000000..0bdde8a
--- /dev/null
+++ b/PLC/Simulations/PMM/OIP/PMM.tscn
@@ -0,0 +1,41 @@
+[gd_scene load_steps=5 format=3 uid="uid://bhnwyarxir4o0"]
+
+[ext_resource type="PackedScene" uid="uid://dyhvoundu2kqc" path="res://parts/Building.tscn" id="1_tqyai"]
+[ext_resource type="Script" uid="uid://b0216dkga4vul" path="res://parts/building.gd" id="2_8wa8j"]
+[ext_resource type="PackedScene" uid="uid://dm55h6ap605bw" path="res://parts/BeltConveyor.tscn" id="3_48vkq"]
+[ext_resource type="PackedScene" uid="uid://gddgyvex6gdj" path="res://parts/PushButton.tscn" id="4_12w4o"]
+
+[node name="Simulation" type="Node3D"]
+
+[node name="Building" type="Node3D" parent="." instance=ExtResource("1_tqyai")]
+script = ExtResource("2_8wa8j")
+metadata/_edit_lock_ = true
+metadata/_edit_group_ = true
+
+[node name="Conveyor" parent="." instance=ExtResource("3_48vkq")]
+transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -9.16007, -1.4999893, -0.7803073)
+speed = 3.0
+enable_comms = true
+speed_tag_name = "Total_Power_OIP"
+
+[node name="Conveyor2" parent="." instance=ExtResource("3_48vkq")]
+transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.131729, -1.4999893, -0.4024701)
+speed = 5.0
+enable_comms = true
+speed_tag_name = "kWh_Consumed_OIP"
+
+[node name="Conveyor3" parent="." instance=ExtResource("3_48vkq")]
+transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.95107317, -1.4999893, -0.79108953)
+speed = 10.0
+enable_comms = true
+speed_tag_name = "Max_Total_Power_OIP"
+
+[node name="PushButton" parent="." instance=ExtResource("4_12w4o")]
+transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.560737, -1.7876109, 1.959259)
+text = "Communication_Fault"
+toggle = true
+pressed = true
+enable_comms = true
+pushbutton_tag_group_name = "TagGroup0"
+pushbutton_tag_name = "Communication_Faulted_OIP"
+lamp_tag_group_name = "TagGroup0"
diff --git a/PLC/Simulations/PMM/PLC/AOI/AOI_PMM.L5X b/PLC/Simulations/PMM/PLC/AOI/AOI_PMM.L5X
new file mode 100644
index 0000000..97abed1
--- /dev/null
+++ b/PLC/Simulations/PMM/PLC/AOI/AOI_PMM.L5X
@@ -0,0 +1,1259 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ — ” ) and pushes it into the MCM control log. The log word CTRL.CMD.Log carries the message, while CTRL.CMD.Log_Quantity increments the running count. The MCM mirrors both values to CTRL.STS.Log and CTRL.STS.Log_Quantity so the operator panel can display them.
+At the same time, the MCM keeps an internal Acknowledge latch: each AOI pulses Un-acknowledge so that any new or persisting fault keeps resurfacing until the operator cycles through and acknowledges it. This ensures that fresh problems never scroll off the list unnoticed.
+
+The module asserts System_Started whenever a start command is present and all interlocks—Stop command, every E-Stop, and the fire relay—are healthy; both coils drop the instant any interlock fails.
+
+Indicator lamps behave as follows:
+• Motor_Fault_Reset_PB_LT_O flashes while CTRL.CMD.VFD_Faulted is active and turns solid once the fault clears but Motor_Was_Faulted is still set.
+• Jam_Restart_PB_LT_O is solid during a jam fault and flashes when an encoder fault is present.
+• EStop_Actuated_LT_O flashes during a live remote E-Stop and stays solid until EStop_Was_Actuated is cleared.
+• Low_Air_Pressure_Reset_PB_LT_O flashes for a live low-air fault and remains solid while Low_Air_Pressure_Fault_Was_Present is true.
+• Power_Branch_Fault_Reset_PB_LT_O flashes during an active branch fault and remains solid while Power_Branch_Was_Faulted is set.
+
+Each push-button transmits a four-state value to the HMI: state 1 idle/dark, state 2 lit, state 3 pressed-lit, and state 4 pressed-dark.
+Start_PB_LT_O lights whenever the system is running.
+
+HMI.STATE cascade – the lower move wins:
+• System_Started true writes 9.
+• System_Started false writes 0.
+• Motor_Was_Faulted writes 1.
+• Power_Branch_Was_Faulted writes 2.
+• Low_Air_Pressure_Fault_Was_Present writes 3.
+• Encoder_Fault writes 4.
+• Jam_Fault writes 5.
+• Communication_Faulted writes 6.
+• EStop_Was_Actuated writes 7.
+• EStopped_Locally writes 8 and has the highest priority.
+
+When HMI.Setup_Motor_Speeds is asserted, the module broadcasts the configured speed set-points to every drive in the system.
+
+A housekeeping section clears the command word each scan and unlatches all momentary HMI bits, making every press a clean one-shot.
+
+Command bits
+The module receives CTRL.CMD.Log.
+The module receives CTRL.CMD.Log_Quantity.
+The module receives CTRL.CMD.Acknowledge_Log.
+The module receives CTRL.CMD.Unacknowledge_All_Logs.
+The module receives CTRL.CMD.VFD_Was_Faulted.
+The module receives CTRL.CMD.Power_Branch_Was_Faulted.
+The module receives CTRL.CMD.Low_Air_Pressure_Fault_Was_Present.
+The module receives CTRL.CMD.Encoder_Fault.
+The module receives CTRL.CMD.Jam_Fault.
+The module receives CTRL.CMD.Communication_Faulted.
+The module receives CTRL.CMD.EStop_Was_Actuated.
+The module receives CTRL.CMD.VFD_Faulted.
+The module receives CTRL.CMD.EStop_Actuated.
+The module receives CTRL.CMD.Low_Air_Pressure_Fault.
+The module receives CTRL.CMD.Power_Branch_Fault.
+
+Status bits
+The module sets CTRL.STS.Log.
+The module sets CTRL.STS.Log_Quantity.
+The module sets CTRL.STS.Acknowledge_Log.
+The module sets CTRL.STS.Unacknowledge_All_Logs.
+The module sets CTRL.STS.Communication_Faulted.
+The module sets CTRL.STS.System_Started.
+The module sets CTRL.STS.System_Start_Requested.
+The module sets CTRL.STS.Setup_Motor_Speeds.
+The module sets CTRL.STS.VFD_Fault_Reset_Requested.
+The module sets CTRL.STS.Power_Branch_Fault_Reset_Requested.
+The module sets CTRL.STS.Low_Air_Pressure_Fault_Reset_Requested.
+The module sets CTRL.STS.Jam_Reset_Requested.
+
+HMI bits
+The HMI exchanges HMI.Start_PB.
+The HMI exchanges HMI.Stop_PB.
+The HMI exchanges HMI.Setup_Motor_Speeds.
+The HMI exchanges HMI.Motor_Fault_Reset_PB.
+The HMI exchanges HMI.Power_Branch_Fault_Reset_PB.
+The HMI exchanges HMI.Low_Air_Pressure_Reset_PB.
+The HMI exchanges HMI.Jam_Restart_PB.
+The HMI displays HMI.STATE.
+The HMI displays HMI.Start_PB_STATE.
+The HMI displays HMI.Motor_Fault_Reset_PB_STATE.
+The HMI displays HMI.Power_Branch_Fault_Reset_PB_STATE.
+The HMI displays HMI.Low_Air_Pressure_Reset_PB_STATE.
+The HMI displays HMI.Jam_Restart_PB_STATE.
+The HMI displays HMI.EStop_Actuated_LT.
+The HMI displays HMI.Local_Estop_LT.
+
+Alarm bits
+The system raises HMI.Alarm.Start_PB_Pressed.
+The system raises HMI.Alarm.Stop_PB_Pressed.
+The system raises HMI.Alarm.Motor_Fault_Reset_PB_Pressed.
+The system raises HMI.Alarm.Jam_Restart_PB_Pressed.
+The system raises HMI.Alarm.Low_Air_Pressure_Reset_PB_Pressed.
+The system raises HMI.Alarm.Power_Branch_Fault_Reset_PB_Pressed.
+The system raises HMI.Alarm.UPS_Battery_Fault.
+The system raises HMI.Alarm.On_UPS_Battery.
+The system raises HMI.Alarm.UPS_Battery_Low.
+The system raises HMI.Alarm.NAT_Switch_Fault.
+The system raises HMI.Alarm.Fire_Relay_De_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X
@@ -0,0 +1,1885 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Rockwell Automation/Allen-Bradley1756-EN2T4325481
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+021420-V2-ENT
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Rockwell Automation/Allen-BradleyPowerFlex 525-EENET3615.1.1.458200PF525_A115201<DataTypes><DataType Name="AB:PowerFlex525V_E_142E84CE:I:0" Class="IO"><Members><Member Name="pad" DataType="DINT" Hidden="1" /><Member Name="DriveStatus" DataType="INT" Radix="Binary" /><Member Name="Ready" DataType="BIT" BitNumber="0" Target="DriveStatus"></Member><Member Name="Active" DataType="BIT" BitNumber="1" Target="DriveStatus"></Member><Member Name="CommandDir" DataType="BIT" BitNumber="2" Target="DriveStatus"></Member><Member Name="ActualDir" DataType="BIT" BitNumber="3" Target="DriveStatus"></Member><Member Name="Accelerating" DataType="BIT" BitNumber="4" Target="DriveStatus"></Member><Member Name="Decelerating" DataType="BIT" BitNumber="5" Target="DriveStatus"></Member><Member Name="Faulted" DataType="BIT" BitNumber="7" Target="DriveStatus"></Member><Member Name="AtReference" DataType="BIT" BitNumber="8" Target="DriveStatus"></Member><Member Name="CommFreqCnt" DataType="BIT" BitNumber="9" Target="DriveStatus"></Member><Member Name="CommLogicCnt" DataType="BIT" BitNumber="10" Target="DriveStatus"></Member><Member Name="ParmsLocked" DataType="BIT" BitNumber="11" Target="DriveStatus"></Member><Member Name="DigIn1Active" DataType="BIT" BitNumber="12" Target="DriveStatus"></Member><Member Name="DigIn2Active" DataType="BIT" BitNumber="13" Target="DriveStatus"></Member><Member Name="DigIn3Active" DataType="BIT" BitNumber="14" Target="DriveStatus"></Member><Member Name="DigIn4Active" DataType="BIT" BitNumber="15" Target="DriveStatus"></Member><Member Name="OutputFreq" DataType="INT" Radix="Decimal" /><Member Name="Fault1Code" DataType="INT" Radix="Decimal" /><Member Name="DriveStatus_param" DataType="INT" Radix="Binary" /><Member Name="DriveStatus_param_Running" DataType="BIT" BitNumber="0" Target="DriveStatus_param"></Member><Member Name="DriveStatus_param_Forward" DataType="BIT" BitNumber="1" Target="DriveStatus_param"></Member><Member Name="DriveStatus_param_Accelerating" DataType="BIT" BitNumber="2" Target="DriveStatus_param"></Member><Member Name="DriveStatus_param_Decelerating" DataType="BIT" BitNumber="3" Target="DriveStatus_param"></Member><Member Name="DriveStatus_param_SafetyActive" DataType="BIT" BitNumber="4" Target="DriveStatus_param"></Member><Member Name="OutputCurrent" DataType="INT" Radix="Decimal" /><Member Name="OutputVoltage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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ — ” ) and pushes it into the MCM control log. The log word CTRL.CMD.Log carries the message, while CTRL.CMD.Log_Quantity increments the running count. The MCM mirrors both values to CTRL.STS.Log and CTRL.STS.Log_Quantity so the operator panel can display them.
+At the same time, the MCM keeps an internal Acknowledge latch: each AOI pulses Un-acknowledge so that any new or persisting fault keeps resurfacing until the operator cycles through and acknowledges it. This ensures that fresh problems never scroll off the list unnoticed.
+
+The module asserts System_Started whenever a start command is present and all interlocks—Stop command, every E-Stop, and the fire relay—are healthy; both coils drop the instant any interlock fails.
+
+Indicator lamps behave as follows:
+• Motor_Fault_Reset_PB_LT_O flashes while CTRL.CMD.VFD_Faulted is active and turns solid once the fault clears but Motor_Was_Faulted is still set.
+• Jam_Restart_PB_LT_O is solid during a jam fault and flashes when an encoder fault is present.
+• EStop_Actuated_LT_O flashes during a live remote E-Stop and stays solid until EStop_Was_Actuated is cleared.
+• Low_Air_Pressure_Reset_PB_LT_O flashes for a live low-air fault and remains solid while Low_Air_Pressure_Fault_Was_Present is true.
+• Power_Branch_Fault_Reset_PB_LT_O flashes during an active branch fault and remains solid while Power_Branch_Was_Faulted is set.
+
+Each push-button transmits a four-state value to the HMI: state 1 idle/dark, state 2 lit, state 3 pressed-lit, and state 4 pressed-dark.
+Start_PB_LT_O lights whenever the system is running.
+
+HMI.STATE cascade – the lower move wins:
+• System_Started true writes 9.
+• System_Started false writes 0.
+• Motor_Was_Faulted writes 1.
+• Power_Branch_Was_Faulted writes 2.
+• Low_Air_Pressure_Fault_Was_Present writes 3.
+• Encoder_Fault writes 4.
+• Jam_Fault writes 5.
+• Communication_Faulted writes 6.
+• EStop_Was_Actuated writes 7.
+• EStopped_Locally writes 8 and has the highest priority.
+
+When HMI.Setup_Motor_Speeds is asserted, the module broadcasts the configured speed set-points to every drive in the system.
+
+A housekeeping section clears the command word each scan and unlatches all momentary HMI bits, making every press a clean one-shot.
+
+Command bits
+The module receives CTRL.CMD.Log.
+The module receives CTRL.CMD.Log_Quantity.
+The module receives CTRL.CMD.Acknowledge_Log.
+The module receives CTRL.CMD.Unacknowledge_All_Logs.
+The module receives CTRL.CMD.VFD_Was_Faulted.
+The module receives CTRL.CMD.Power_Branch_Was_Faulted.
+The module receives CTRL.CMD.Low_Air_Pressure_Fault_Was_Present.
+The module receives CTRL.CMD.Encoder_Fault.
+The module receives CTRL.CMD.Jam_Fault.
+The module receives CTRL.CMD.Communication_Faulted.
+The module receives CTRL.CMD.EStop_Was_Actuated.
+The module receives CTRL.CMD.VFD_Faulted.
+The module receives CTRL.CMD.EStop_Actuated.
+The module receives CTRL.CMD.Low_Air_Pressure_Fault.
+The module receives CTRL.CMD.Power_Branch_Fault.
+
+Status bits
+The module sets CTRL.STS.Log.
+The module sets CTRL.STS.Log_Quantity.
+The module sets CTRL.STS.Acknowledge_Log.
+The module sets CTRL.STS.Unacknowledge_All_Logs.
+The module sets CTRL.STS.Communication_Faulted.
+The module sets CTRL.STS.System_Started.
+The module sets CTRL.STS.System_Start_Requested.
+The module sets CTRL.STS.Setup_Motor_Speeds.
+The module sets CTRL.STS.VFD_Fault_Reset_Requested.
+The module sets CTRL.STS.Power_Branch_Fault_Reset_Requested.
+The module sets CTRL.STS.Low_Air_Pressure_Fault_Reset_Requested.
+The module sets CTRL.STS.Jam_Reset_Requested.
+
+HMI bits
+The HMI exchanges HMI.Start_PB.
+The HMI exchanges HMI.Stop_PB.
+The HMI exchanges HMI.Setup_Motor_Speeds.
+The HMI exchanges HMI.Motor_Fault_Reset_PB.
+The HMI exchanges HMI.Power_Branch_Fault_Reset_PB.
+The HMI exchanges HMI.Low_Air_Pressure_Reset_PB.
+The HMI exchanges HMI.Jam_Restart_PB.
+The HMI displays HMI.STATE.
+The HMI displays HMI.Start_PB_STATE.
+The HMI displays HMI.Motor_Fault_Reset_PB_STATE.
+The HMI displays HMI.Power_Branch_Fault_Reset_PB_STATE.
+The HMI displays HMI.Low_Air_Pressure_Reset_PB_STATE.
+The HMI displays HMI.Jam_Restart_PB_STATE.
+The HMI displays HMI.EStop_Actuated_LT.
+The HMI displays HMI.Local_Estop_LT.
+
+Alarm bits
+The system raises HMI.Alarm.Start_PB_Pressed.
+The system raises HMI.Alarm.Stop_PB_Pressed.
+The system raises HMI.Alarm.Motor_Fault_Reset_PB_Pressed.
+The system raises HMI.Alarm.Jam_Restart_PB_Pressed.
+The system raises HMI.Alarm.Low_Air_Pressure_Reset_PB_Pressed.
+The system raises HMI.Alarm.Power_Branch_Fault_Reset_PB_Pressed.
+The system raises HMI.Alarm.UPS_Battery_Fault.
+The system raises HMI.Alarm.On_UPS_Battery.
+The system raises HMI.Alarm.UPS_Battery_Low.
+The system raises HMI.Alarm.NAT_Switch_Fault.
+The system raises HMI.Alarm.Fire_Relay_De_Energized.
+The system raises HMI.Alarm.EStopped_Locally.
+]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ — ” ) and pushes it into the MCM control log. The log word CTRL.CMD.Log carries the message, while CTRL.CMD.Log_Quantity increments the running count. The MCM mirrors both values to CTRL.STS.Log and CTRL.STS.Log_Quantity so the operator panel can display them.
+At the same time, the MCM keeps an internal Acknowledge latch: each AOI pulses Un-acknowledge so that any new or persisting fault keeps resurfacing until the operator cycles through and acknowledges it. This ensures that fresh problems never scroll off the list unnoticed.
+
+The module asserts System_Started whenever a start command is present and all interlocks—Stop command, every E-Stop, and the fire relay—are healthy; both coils drop the instant any interlock fails.
+
+Indicator lamps behave as follows:
+• Motor_Fault_Reset_PB_LT_O flashes while CTRL.CMD.VFD_Faulted is active and turns solid once the fault clears but Motor_Was_Faulted is still set.
+• Jam_Restart_PB_LT_O is solid during a jam fault and flashes when an encoder fault is present.
+• EStop_Actuated_LT_O flashes during a live remote E-Stop and stays solid until EStop_Was_Actuated is cleared.
+• Low_Air_Pressure_Reset_PB_LT_O flashes for a live low-air fault and remains solid while Low_Air_Pressure_Fault_Was_Present is true.
+• Power_Branch_Fault_Reset_PB_LT_O flashes during an active branch fault and remains solid while Power_Branch_Was_Faulted is set.
+
+Each push-button transmits a four-state value to the HMI: state 1 idle/dark, state 2 lit, state 3 pressed-lit, and state 4 pressed-dark.
+Start_PB_LT_O lights whenever the system is running.
+
+HMI.STATE cascade – the lower move wins:
+• System_Started true writes 9.
+• System_Started false writes 0.
+• Motor_Was_Faulted writes 1.
+• Power_Branch_Was_Faulted writes 2.
+• Low_Air_Pressure_Fault_Was_Present writes 3.
+• Encoder_Fault writes 4.
+• Jam_Fault writes 5.
+• Communication_Faulted writes 6.
+• EStop_Was_Actuated writes 7.
+• EStopped_Locally writes 8 and has the highest priority.
+
+When HMI.Setup_Motor_Speeds is asserted, the module broadcasts the configured speed set-points to every drive in the system.
+
+A housekeeping section clears the command word each scan and unlatches all momentary HMI bits, making every press a clean one-shot.
+
+Command bits
+The module receives CTRL.CMD.Log.
+The module receives CTRL.CMD.Log_Quantity.
+The module receives CTRL.CMD.Acknowledge_Log.
+The module receives CTRL.CMD.Unacknowledge_All_Logs.
+The module receives CTRL.CMD.VFD_Was_Faulted.
+The module receives CTRL.CMD.Power_Branch_Was_Faulted.
+The module receives CTRL.CMD.Low_Air_Pressure_Fault_Was_Present.
+The module receives CTRL.CMD.Encoder_Fault.
+The module receives CTRL.CMD.Jam_Fault.
+The module receives CTRL.CMD.Communication_Faulted.
+The module receives CTRL.CMD.EStop_Was_Actuated.
+The module receives CTRL.CMD.VFD_Faulted.
+The module receives CTRL.CMD.EStop_Actuated.
+The module receives CTRL.CMD.Low_Air_Pressure_Fault.
+The module receives CTRL.CMD.Power_Branch_Fault.
+
+Status bits
+The module sets CTRL.STS.Log.
+The module sets CTRL.STS.Log_Quantity.
+The module sets CTRL.STS.Acknowledge_Log.
+The module sets CTRL.STS.Unacknowledge_All_Logs.
+The module sets CTRL.STS.Communication_Faulted.
+The module sets CTRL.STS.System_Started.
+The module sets CTRL.STS.System_Start_Requested.
+The module sets CTRL.STS.Setup_Motor_Speeds.
+The module sets CTRL.STS.VFD_Fault_Reset_Requested.
+The module sets CTRL.STS.Power_Branch_Fault_Reset_Requested.
+The module sets CTRL.STS.Low_Air_Pressure_Fault_Reset_Requested.
+The module sets CTRL.STS.Jam_Reset_Requested.
+
+HMI bits
+The HMI exchanges HMI.Start_PB.
+The HMI exchanges HMI.Stop_PB.
+The HMI exchanges HMI.Setup_Motor_Speeds.
+The HMI exchanges HMI.Motor_Fault_Reset_PB.
+The HMI exchanges HMI.Power_Branch_Fault_Reset_PB.
+The HMI exchanges HMI.Low_Air_Pressure_Reset_PB.
+The HMI exchanges HMI.Jam_Restart_PB.
+The HMI displays HMI.STATE.
+The HMI displays HMI.Start_PB_STATE.
+The HMI displays HMI.Motor_Fault_Reset_PB_STATE.
+The HMI displays HMI.Power_Branch_Fault_Reset_PB_STATE.
+The HMI displays HMI.Low_Air_Pressure_Reset_PB_STATE.
+The HMI displays HMI.Jam_Restart_PB_STATE.
+The HMI displays HMI.EStop_Actuated_LT.
+The HMI displays HMI.Local_Estop_LT.
+
+Alarm bits
+The system raises HMI.Alarm.Start_PB_Pressed.
+The system raises HMI.Alarm.Stop_PB_Pressed.
+The system raises HMI.Alarm.Motor_Fault_Reset_PB_Pressed.
+The system raises HMI.Alarm.Jam_Restart_PB_Pressed.
+The system raises HMI.Alarm.Low_Air_Pressure_Reset_PB_Pressed.
+The system raises HMI.Alarm.Power_Branch_Fault_Reset_PB_Pressed.
+The system raises HMI.Alarm.UPS_Battery_Fault.
+The system raises HMI.Alarm.On_UPS_Battery.
+The system raises HMI.Alarm.UPS_Battery_Low.
+The system raises HMI.Alarm.NAT_Switch_Fault.
+The system raises HMI.Alarm.Fire_Relay_De_Energized.
+The system raises HMI.Alarm.EStopped_Locally.
+]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+