> For the complete documentation index, see [llms.txt](https://infosys.selmotech.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://infosys.selmotech.com/selmo-solution/selmo-solution-en/selmo-structure-and-standard/selmo-technical-standard-and-structure/description-selmo-plc-code/hardware-zone-control/less-than-hwzone_name-greater-than/less-than-hwzone_name-greater-than_control/t.c.m.z-fault.md).

# T.C.M.Z fault

The T.C.M.Z. fault output is activated when a severe fault or a Gate/Fortress fault exists.

```
// TCMZ Fault Detect
   {region "Description TCMZ Fault Detect"}
   (*
   The TCMZ Fault output is activated when a Fatal Fault or Gate/Fortress Fault Exists. 
   *)
   {endregion}
    
   GVL_<HwZone_name>.stHwzIf.xTcmzFault := GVL_<HwZone_name>.stHwzIf.xFatalFault OR GVL_<HwZone_name>.stHwzIf.xGateFortressFault;
```

<\*\*\*>Variable name, comment and data type are automatically taken from the Studio

**TCMZ**

***

A Total constantly monitored Zone (TCMZ) in hardware zones refers to a specific area in the industrial plant that is continuously monitored to ensure the machine or system is functioning correctly. This can be done using sensors or other monitoring technologies installed in the area that collect data about the machine's operation. Monitoring the TCMZ can help detect and resolve potential issues early before they lead to failures or damage, thereby increasing the operational safety and reliability of the machine.

Each TCMZ is divided into 3 defined areas: Fatal Fault, Gate/Fortress Fault and Warning Fault.

**2.2.1.7.7.1. \<HwZone\_name>\_TCMZ**

***

```
PROGRAM HwZone1_TCMZ
VAR
   {attribute 'symbol' := 'none'}
   fbFatalFault: FB_CMZFault;
   aFatalFault: ARRAY[0..1] OF BOOL;
   {attribute 'symbol' := 'none'}
   fbGateFortressFault: FB_CMZFault;
   aGateFortressFault: ARRAY[0..2] OF BOOL;
   {attribute 'symbol' := 'none'}
   fbWarningFault: FB_CMZFault;
   aWarningFault: ARRAY[0..3] OF BOOL;
   {attribute 'symbol' := 'none'}
   fbFatalFaultCtrl1: FB_ErrorSetCtrl;
   {attribute 'symbol' := 'none'}
   fbGateFortressFaultCtrl1: FB_ErrorSetCtrl;
   {attribute 'symbol' := 'none'}
   fbGateFortressFaultCtrl2: FB_ErrorSetCtrl;
   {attribute 'symbol' := 'none'}
   fbWarningFaultCtrl1: FB_ErrorSetCtrl;
   {attribute 'symbol' := 'none'}
   fbWarningFaultCtrl2: FB_ErrorSetCtrl;
   {attribute 'symbol' := 'none'}
   fbWarningFaultCtrl3: FB_ErrorSetCtrl;
END_VAR
```

**Fatal Fault** The Fatal Fault flag is a PLC output that monitors the status of the severe fault area in the TCMZ matrix of the hardware zone, such that any bit for severe faults leads to activation of the output. This flag is used in all step-sequence error matrices to trigger a CMZ fault and to prevent automatic/manual release in each sequence within the hardware zone. A standard index in each sequence fault matrix is reserved for this fault. The fatal fault must be rectified before an automatic or manual release is possible. Fatal faults cannot be overridden.

```
// ###################### Fatal Faults ######################

   // Global Fatal Fault
   aFatalFault[0] := GVL_Global.stGlobalIf.xFatalFault;

   // TCMZ: xCMZ_1 | CMZ 1
   aFatalFault[1] := fbFatalFaultCtrl1.M_ErrorSet(xError := GVL_<HwZone_name>_FatalFaults.<xCMZ_name>, xReset:= GVL_Global.stGlobalIf.xFaultReset);

   // TCMZ call
   fbFatalFault(aFaultMatrix := aFatalFault, xFaultActive => GVL_<HwZone_name>.stHwzIf.xFatalFault);
```

<\*\*\*> Variable name or comment is automatically taken from the studio

**Gate/Fortress Fault** The Gate/Fortress Fault flag is a PLC output that monitors the status of the Gate/Fortress Fault area of the TCMZ matrix of the hardware zone, such that any activated Gate/Fortress Fault bit leads to activation of the Gate/Fortress Fault flag output. This flag is used in all step sequence error matrices to cause a CMZ fault and to prevent automatic/manual release in each sequence within the hardware zone.

```
// ###################### Gate / Fortress Faults ######################

   // Global Gate Fortress Fault
   aGateFortressFault[0] := GVL_Global.stGlobalIf.xGateFortressFault;

   // TCMZ: xCMZ_1 | CMZ 1
   aGateFortressFault[1] := fbGateFortressFaultCtrl1.M_ErrorSet(xError := GVL_<HwZone_name>_GateFortressFaults.<xCMZ_name>, xReset:= GVL_Global.stGlobalIf.xFaultReset);

   // TCMZ: xCMZ_2 | CMZ 2
   aGateFortressFault[2] := fbGateFortressFaultCtrl2.M_ErrorSet(xError := GVL_<HwZone_name>_GateFortressFaults.<xCMZ_name>, xReset:= GVL_Global.stGlobalIf.xFaultReset);

   // TCMZ call
   fbGateFortressFault(aFaultMatrix := aGateFortressFault, xFaultActive => GVL_<HwZone_name>.stHwzIf.xGateFortressFault);
```

<\*\*\*> Variable name or comment is automatically taken from the studio

**Warning Fault** For each hardware zone there is an associated Warning Fault matrix. The Warning Faults have no impact on machine operation. However, the status of the Warning Fault matrix is continuously monitored by the HMI, which displays all active warnings.

```
// ###################### Warning Faults ######################

   // Global Warning Fault
   aWarningFault[0] := GVL_Global.stGlobalIf.xWarningFault;

   // TCMZ: xCMZ_1 | CMZ 1
   fbWarningFaultCtrl1.P_xAutoReset := TRUE;
   aWarningFault[1] := fbWarningFaultCtrl1.M_ErrorSet(xError := GVL_<HwZone_name>_WarningFaults.<xCMZ_1, xReset:= GVL_Global.stGlobalIf.xFaultReset);

   // TCMZ: xCMZ_2 | CMZ 2
   fbWarningFaultCtrl2.P_xAutoReset := TRUE;
   aWarningFault[2] := fbWarningFaultCtrl2.M_ErrorSet(xError := GVL_<HwZone_name>_WarningFaults.<xCMZ_2, xReset:= GVL_Global.stGlobalIf.xFaultReset);

   // TCMZ: xCMZ_3 | CMZ 3
   fbWarningFaultCtrl3.P_xAutoReset := TRUE;
   aWarningFault[3] := fbWarningFaultCtrl3.M_ErrorSet(xError := GVL_<HwZone_name>_WarningFaults.<xCMZ_3, xReset:= GVL_Global.stGlobalIf.xFaultReset);

   // TCMZ call
   fbWarningFault(aFaultMatrix := aWarningFault, xFaultActive => GVL_<HwZone_name>.stHwzIf.xWarningFault);
```

<\*\*\*> Variable name or comment is automatically taken from the studio


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://infosys.selmotech.com/selmo-solution/selmo-solution-en/selmo-structure-and-standard/selmo-technical-standard-and-structure/description-selmo-plc-code/hardware-zone-control/less-than-hwzone_name-greater-than/less-than-hwzone_name-greater-than_control/t.c.m.z-fault.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
