Inbound Initialize
Introduction
InboundInitializeActivity is a MES-specific inbound initialization node used to initialize various state variables and verify the validity of the product code when a product enters the station. This node is the starting point of the inbound flow, responsible for setting key information such as inbound results and work types, and initializing the recipe applied to the current process.
Configuration Items
This node is configured and outputs via flow context variables, no direct property configuration is needed.
Input Variables
| Variable Name | Constant | Type | Description |
|---|---|---|---|
| SerialNumber | FlowItemCollection.SerialNumber | string | Product Serial Number/Product Code |
| TrayCodeAssociationDescriptionValue | FlowItemCollection.TrayCodeAssociationDescriptionValue | string | Tray Code Association Query Description |
| MaterialCodeAssociationDescriptionValue | FlowItemCollection.MaterialCodeAssociationDescriptionValue | string | Material Code Association Query Description |
Output Variables
| Variable Name | Constant | Type | Description |
|---|---|---|---|
| Inbound_ResultVariable_Value | FlowItemCollection.InboundResultValue | string | Inbound Result |
| Inbound_Description_Value | FlowItemCollection.InboundDescriptionValue | string | Inbound Exception Description |
| Inbound_WorkType_Value | FlowItemCollection.InboundWorkTypeValue | int | Work Type |
| Inbound_Completed_Signal | FlowItemCollection.InboundCompletedSignal | int | Inbound Completed Signal |
| FormulaApplyModel | FlowItemCollection.FormulaApplyModel | FormulaApplyModel | Recipe Applied to Current Process |
Business Logic
Execution Flow
┌─────────────────────────────────────────────────────────────┐
│ InboundInitializeActivity │
├─────────────────────────────────────────────────────────────┤
│ EnterAsync - Initialization Phase │
│ ├─ Init Tray Code Association Desc = "Not Initialized" │
│ ├─ Init Material Code Association Desc = "Not Initialized" │
│ ├─ Clear Inbound Description │
│ ├─ Set Inbound Result = "Not Initialized" │
│ ├─ Set Work Type = Reset │
│ └─ Set Inbound Completed Signal = 1 │
├─────────────────────────────────────────────────────────────┤
│ ProcessAsync - Processing Phase │
│ ├─ Check if product code is empty │
│ │ ├─ Tray code association failed → Set corresponding error│
│ │ ├─ Material code association failed → Set corresponding error│
│ │ └─ No product code → Set no product entry error │
│ ├─ Set Inbound Result = OK │
│ └─ Initialize Recipe Application Info (based on config) │
└─────── ──────────────────────────────────────────────────────┘
Product Code Verification
When the product code is empty, the system determines the error type based on the association description:
| Condition | Inbound Result | Description |
|---|---|---|
| Tray code association desc initialized | TrayCodeNotBoundProductCode | Tray code not bound to product code |
| Material code association desc initialized | MaterialCodeNotBoundProductCode | Material code not bound to product code |
| Other cases | NoProductEntry | No product entry |
Recipe Initialization
Decides whether to initialize the recipe based on system configuration:
| Configuration Condition | Behavior |
|---|---|
| FormulaDistributionMode = 2 | Distribute recipe when process identifies product, requires initialization |
| PluginState = 0 | Order management plugin disabled, requires initialization |
| Other cases | Do not initialize recipe in this node |
Usage Example
Typical Inbound Flow
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ Scan/Read Code │────▶│InboundInitialize │────▶│DuplicateCodeDetection│
│ │ │ Inbound Init │ │ Duplicate Check │
└──────────────────┘ └──────────────────┘ └──────────────────┘
Inbound Result Configuration
| Result Name | Constant | Description |
|---|---|---|
| OK | EntryResultConfig.OK | Inbound Success |
| NoProductEntry | EntryResultConfig.NoProductEntry | No Product Entry |
| TrayCodeNotBoundProductCode | EntryResultConfig.TrayCodeNotBoundProductCode | Tray Code Not Bound to Product Code |
| MaterialCodeNotBoundProductCode | EntryResultConfig.MaterialCodeNotBoundProductCode | Material Code Not Bound to Product Code |
| NG | EntryResultConfig.NG | Inbound Failed (Recipe not found, etc.) |
Notes
- Flow Start: This node is usually the first business node in the inbound flow.
- Product Code Required: If product code is empty, an error result is set, subsequent nodes should check the inbound result.
- Recipe Initialization: Decides whether to initialize recipe here based on system configuration.
- State Reset: Resets relevant state variables on every inbound.