# Load and Unload Solder Paste from the Solder Paste Printer ## Overview This feature enables the load and unload of solder paste consumable materials on Solder Paste Printer machines, triggered by Fuji Nexim equipment events. ### Relevant Artifacts | Name | Type | Is Mandatory | Data Type | Description | | :--------------------------------------------------------------------------- | :--------- | :----------: | :-------- | :------------------------------------------------------------------------------------------------------- | | IoTMetadataDefinition | SmartTable | Yes | | Metadata configuration used to enable or bypass the solder handling feature per resource. | | [IoTFujiNeximHandleSolder](../../artifacts/dees.md#iotfujineximhandlesolder) | DEE | Yes | | Attaches or detaches solder paste material from the target consumable feeder on a specified MES resource.| | `/IoT/FUJI/SolderPasteFeederType/` | Config | Yes | | Determines the target consumable feeder. | ## How It Works When a `LOADSOLDER` or `UNLOADSOLDER` event is received from the Fuji Nexim equipment, the following steps are executed: ### Area Feature Checks - Resolves the MES Sub-Resource Name using the pattern: `FUJI_LineNameMachineName_{EquipmentLineName}_{EquipmentMachineName}`. ### Resource Feature Checks - Checks whether the `UseFujiToHandleSolder` feature is enabled for the resolved MES Resource in the `IoTMetadataDefinition` Smart Table. ### MES Operations If the feature is enabled, the Automation Controller calls the DEE [IoTFujiNeximHandleSolder](../../artifacts/dees.md#iotfujineximhandlesolder), which performs the following: - Validates the solder material identified by `SolderID` and confirms its Product matches `SolderName`. - Determines the target consumable feeder using the configuration key `/IoT/FUJI/SolderPasteFeederType/`. - Performs the operation based on the `Operation` input: **Load:** - If the material is already attached to the correct feeder on the correct resource, no action is performed. - If the material is attached to a different feeder, it is detached first. - If the target feeder already has a different material attached, it is detached first. - The solder material is then attached to the target feeder. - If the material does not exist in MES, an error is thrown. **Unload:** - If the material is not attached, no action is performed. - If the target feeder does not belong to the resource, no action is performed. - Otherwise, the solder material is detached from the target feeder. - Sends a `LOADSOLDER_ACK` or `UNLOADSOLDER_ACK` message back to the equipment with: - A result (`0` = Ok, `1` = NOk) for the operation. **Error Handling** If any step fails during the DEE operation (e.g. material not found, feeder not found, configuration missing), the operation is considered failed and an error is returned to the equipment. **Bypass Condition** If `UseFujiToHandleSolder` is set to `False` or is not defined in `IoTMetadataDefinition`, the DEE call is bypassed entirely and no MES operation is performed. ### Assumptions The `IoTMetadataDefinition` Smart Table must be configured with the following entry for each station: | Resource | ResourceType | Area | Name | Value | | --------------------------- | ------------ | -------------- | --------------------- | ----- | | | | Fuji Line Area | FUJI_LineNameMachineName_{EquipmentLineName}_{EquipmentMachineName} | MES ResourceName | | MES Fuji Station X Resource | | | UseFujiToHandleSolder | True |