LMES Inbound Processing Logic Detailed Explanation
1. Overview
Inbound Processing (Inbound) is the operation performed when a product arrives at a workstation and is ready for processing. It validates the product's eligibility for the current station and prepares the execution environment.
2. Logical Flow
2.1 Trigger Method
- Scan Trigger: Worker scans the product barcode.
- RFID Trigger: RFID reader detects the product tag.
- PLC Trigger: Equipment sensor detects product arrival.
2.2 Processing Steps
- Identification: Parse the input code to identify the product (Product ID) or Tray (Tray ID).
- Route Validation:
- Check if the product has completed the previous process.
- Check if the product is skipped or routed to this station correctly.
- Verify if the current station matches the next required process in the route.
- Status Check: Ensure product is not "Scrapped" or "Hold".
- Resource Check:
- Check if required materials/tools are loaded and valid on the station.
- Check if the machine is in "Ready" state.
- Action:
- Pass: Update status to "Processing", record Inbound time (
StartTime). - Fail: Alert user with specific error message (e.g., "Wrong Route", "Material Depleted").
- Pass: Update status to "Processing", record Inbound time (
3. Key Considerations
- Re-entrant Inbound: If a product is scanned again at the same station while "Processing", the system should typically ignore or prompt "Already Inbound", rather than erroring out or resetting.
- Bypass Logic: Support special bypass logic for rework or fast-track products.
4. Code Snippet
public async Task ProcessInboundAsync(InboundInput input)
{
var product = await _productManager.GetByIdAsync(input.Barcode);
// Validate Route
var nextStation = await _routeService.GetNextStationAsync(product.Id);
if (nextStation.Id != input.CurrentStationId)
{
throw new BusinessException("Product is at wrong station. Expected: " + nextStation.Name);
}
// Update Status
product.Status = ProductStatus.Processing;
product.CurrentStationId = input.CurrentStationId;
product.StartTime = DateTime.Now;
await _repository.UpdateAsync(product);
}