--- alias: tutorials-sampling-pattern-step-application title: Applying a Sampling Pattern in a Step description: "Apply a sampling pattern to a step and execute in-step sampling" --- # Applying a Sampling Pattern in a Step ## Scenario In a semiconductor fab, a **Sampling Pattern** is used during a **Metrology** step to check for overlay accuracy. When a lot of 10 **Wafers** enters the step, Critical Manufacturing MES automatically selects wafers in positions `2`, `6`, and `10` for [[user-guide-manage-sampling|In-Step Sampling]] before the lot continues. This targeted pattern ensures representative wafers across the lot are measured without inspecting all wafers, helping detect process drift early while maintaining high throughput. ## Configuration * Create the necessary Critical Manufacturing MES entities to support the scenario, such as **Steps**, **Flows**, **Resources**, and **Services**. * Create the **Sampling Pattern** to select positions `2`, `6`, and `10` of the associated **Container** (`SP_OverlayAccuracy`). ![Screenshot showing a Sampling Pattern configured for positions 2, 6, and 10.](../images/sampling_36.png) * In the smart table [[stepsamplingpatterncontext-st]], associate the **Sampling Pattern** with the step **In-Step Overlay & Focus Metrology**. ![Screenshot showing the StepSamplingPatternContext association for the step.](../images/sampling_37.png) ## Execution When a **Sampling Pattern** is used in isolation, the system processes all **Material** lots in the defined **Sampling Step**, but it processes only the **Sub-Materials** in the nominated positions. In this case, `2`, `6`, and `10` are processed and all others are skipped. At the **In-Step Overlay & Focus Metrology** step, perform **Dispatch & Track-In** on a **Material** lot with a **Container** containing the identified positions for its **Sub-Materials**. For details on the transaction itself, see [[user-guide-track-in-material]]. ![Screenshot showing the lot before track-in at the sampling step.](../images/sampling_38.png) A second wizard step named **Sampling** appears, showing the selected container positions to be processed. After the **Track-In** transaction is complete, the **Material** lot state changes to `In Process`, but only the three **Sub-Materials** in container positions `2`, `6`, and `10` are `In Process`. All other **Sub-Materials** skip processing. For the **Track-In** to change **Sub-Materials** state to `In Process`, you must set **Enable Sub-Material Tracking** to false in the attached **Resource**. For more information on **Sub-Material** processing, see [[user-guide-create-resource#step-2-additional-information]]. ![Screenshot showing the Sampling wizard step with the selected positions.](../images/sampling_39.png) ![Screenshot showing the resulting in-process sub-materials after sampling track-in.](../images/sampling_40.png) !!! note An empty Sub-Material in position `2`, `6`, or `10` causes an error. Use Evaluation Type System or Rule for these more complex scenarios.Use Evaluation Type System or Rule for these more complex scenarios. Combine Sampling Plan and Sampling Pattern to guarantee that only Material lots selected by the Sampling Plan will arrive at the step where the Sampling Pattern is configured. You can see a demonstration of this tutorial in the following video: {% set video_id = '2773de1c6f6e3b6fb8c0c4d2bf6ab18d' %} {% include-markdown 'includes/cloudflare_stream.md' %}