Related to the NEXT2 addition that was asked by Lenin last week, the scope of the work is this? - Receive from Malisko the NEXT2 data on the Spare : Data_From_EbConvey[0-9]. We need to check if this area is free for all the lines. - Tunnel this dato to the Supervisor OPC and retransform to String as it is done actually on the BatchNext.BatchNumber e BatchActual.BatchNumber - The test will be made first on the 40,41 & 42 (TL25/TL26/TL27) and then on the other lines? L41 4 days TL25--------L41 L43/42 counters ### Line index: | 0 | Fill_TL21_L23 | | --- | ------------- | | 1 | Fill_TL22_L25 | | 2 | Fill_TL23_L43 | | 3 | Fill_TL25_L41 | | 4 | Fill_TL26_L42 | | 5 | Fill_TL27_L40 | ![[Pasted image 20250201161523.png]] ```pascal DINT diAppo FOR #i := 0 TO 49 DO #atFromHenkel[#i] := "FromHenkel".di[#i]; CASE #i OF 0, 10, 20, 35..40, 44..49: #diAppo.%B3 := #atFromHenkel[#i].%B2; #diAppo.%B2 := #atFromHenkel[#i].%B3; #diAppo.%B1 := #atFromHenkel[#i].%B0; #diAppo.%B0 := #atFromHenkel[#i].%B1; #atFromHenkel[#i] := #diAppo; ELSE #diAppo.%W0 := #atFromHenkel[#i].%W1; #diAppo.%W1 := #atFromHenkel[#i].%W0; #atFromHenkel[#i] := #diAppo; END_CASE; END_FOR; "ComSV".TL25_WriteToSv.FromHenkel := #FromHenkel; ``` Already in use: *** ### Identifier Explanations | Prefix | Meaning | Usage | | ------ | ------------------ | ---------------------------------------- | | AB | Actual Batch | Current production batch being processed | | NB | Next Batch | Next scheduled production batch | | IDH | Internal Henkel ID | Unique identifier used by HENKEL | | BTL | Bottle | Relates to bottle specifications | | CON | Container | Relates to container specifications | | PO | Production Order | Order number for batch tracking | PO_NUMBER : Batch IDH_CON ( 12 char ) IDH_BTL : Article Number ( 12 char ) | | | ACTUAL | NEXT | NEXT + 1 | | | | --------- | -------------------- | ------ | ----- | -------- | --- | --- | | PO_NUMBER | Batch IDH_CON | 44-46 | 47-49 | 1-3 | | | | IDH_BTL | Batch Article Number | 35-37 | 38-40 | 7-9 | | | | IDH_CON | | | | 4-6 | | | #### Process to obtain the ActualSku from AB_IDH_BTL: "FromHenkel".di -> AB_IDH_BTL -> ReqActualCustomProdNum -> Search( AlplaSkuList ) -> ActualSku -> ProdFamily -> PLC Recipe # HENKEL Communication Data Analysis ## Data Array Structure (di[0] to di[49]) ### Control Words and Status (di[0] - di[1]) | Position | Data Type | Description | Processing | |----------|-----------|-------------|------------| | di[0] | DWORD | Status Word (STW) | 4-byte swap required | | di[1] | DWORD | Control Word (CTW) | 2-byte word swap | ### Batch Information Fields | Field | Array Positions | Description | Processing Type | |-------|----------------|-------------|-----------------| | PO_NUMBER | di[33]-di[44] | Current Production Order Number | Character conversion, zero-padding | | AB_IDH_BTL | Direct mapping | Actual Batch Bottle ID | Space/null replaced with '0' | | AB_IDH_CON | Not directly visible | Actual Batch Container ID | Space/null replaced with '0' | | PO_NUMBER_NEXT | Mapped after PO_NUMBER | Next Production Order | Character conversion, zero-padding | | NB_IDH_BTL | Direct mapping | Next Batch Bottle ID | Space/null replaced with '0' | | NB_IDH_CON | Not directly visible | Next Batch Container ID | Space/null replaced with '0' | | PO_NUMBER_NEXT2 | di[1]-di[3] | Second Next Production Order | Direct transfer, no processing | | IDH_BTL_NEXT2 | di[7]-di[9] | Second Next Batch Bottle ID | Direct transfer, no processing | | IDH_CON_NEXT2 | di[4]-di[6] | Second Next Batch Container ID | Direct transfer, no processing | ### Data Processing Requirements | Data Type | Processing Steps | Purpose | |-----------|-----------------|----------| | Status Words | 4-byte swap for positions 0,10,20,35-40,44-49 | Align byte order for system compatibility | | Word Data | 2-byte swap for other positions | Standardize data format | | Character Data | Replace spaces/nulls with '0' | Ensure consistent string handling | | Numeric Data | Conversion to appropriate format | Enable mathematical operations | ## NEXT2 Implementation Considerations The addition of NEXT2 fields will utilize previously spare array positions: 1. New Data Fields and Positions - PO_NUMBER_NEXT2: di[1]-di[3] - IDH_BTL_NEXT2: di[7]-di[9] - IDH_CON_NEXT2: di[4]-di[6] ## CustomProdNum: Client Side (From HENKEL to Server): In "Client - FC COM Data - QE1 from to Henkel.txt": The process begins with data reception from HENKEL through an array of 50 positions (0 to 49). The script implements specific byte-swapping operations based on array positions: For positions 0, 10, 20, 35-40, and 44-49, it performs a four-byte swap where: ### In "Client - FormatManagementQE1_G.txt": *** The script manages the format change cycle and processes the data through several states: - Monitors the calculated bottles remaining - Tracks format change status - Manages batch transitions - Handles communication with Henkel regarding line status ### Server Side (Processing and SKU Management): *** In "Server - 10.01_SkuManage_G.txt": The server implements an indexing system for managing SKU requests: - Maintains a cycling index (0 to 5) for line management - Processes both actual and next batch requests simultaneously - Implements search functionality through the AlplaSkuList database The search process includes: - Comparing requested CustomProdNum against stored values - Updating search flags for tracking purposes - Managing both current and next SKU searches independently In "Server - TL25_ComAlpa_G.txt": This script handles the communication interface between systems: - Processes status words and counters - Manages batch information transmission - Handles character conversion for batch numbers - Implements communication monitoring with timeout detection The server references the "10_FromAlplaSkuList_D" database which contains: - Article Version (Av) - Article Description (AvDesc) - Product Family ID (ProdFamily) - CustomArticleNum (12-character identifier) Return Data Flow: When a match is found in the AlplaSkuList, the server: - Returns the complete SKU information - Provides the corresponding product family number - Updates the line status accordingly - Sets appropriate flags for format change management The system maintains data integrity through: - Regular communication checks - Status word verification - Error flag management - Timeout monitoring This software architecture ensures reliable data translation between HENKEL's batch information and ALPLA's product family system, with proper error handling and status tracking throughout the process. # Data_To_EbConvey Array Structure Documentation ## Machine Status Words | Position | Data Type | Processing | Description | |----------|-----------|------------|-------------| | di[0] | DINT | 4-byte swap | Main Status Word (STW) - Contains Life Bit (bit 31) and overall machine status | | di[10] | DINT | 4-byte swap | Labeler Status Word - Machine status and running conditions | | di[20] | DINT | 4-byte swap | Filler Status Word - Contains filler machine ready and running conditions | ## Machine Operating Parameters | Position | Data Type | Processing | Description | | ------------- | --------- | ---------------- | ------------------------------------------ | | di[11] | DINT | 2-byte word swap | Labeler Infeed Speed | | di[12] | DINT | 2-byte word swap | Labeler Machine Speed | | di[13] | DINT | 2-byte word swap | Master Filler Speed Command to Merge Slave | | di[14]-di[15] | DINT | 2-byte word swap | Duplicate Labeler Speed Values | | di[16] | DINT | 2-byte word swap | Spare | | di[21] | DINT | 2-byte word swap | Filler Infeed Belt Speed | | di[22] | DINT | 2-byte word swap | Processed Quantity | | di[23] | DINT | 2-byte word swap | Calculated Bottles Remaining to Fill | ## Current and Next Batch Information | Position | Data Type | Processing | Description | | ------------- | --------- | -------------------- | --------------------------------------------------- | | di[33]-di[38] | CHAR | Character conversion | Current Batch Production Order Number (PO_NUMBER) | | di[39]-di[44] | CHAR | Character conversion | Next Batch Production Order Number (PO_NUMBER_NEXT) | | di[17]-di[19] | SINT | 2-byte word swap | SAP/SKU Data for Current IDH_CUP | | di[24]-di[26] | SINT | 2-byte word swap | SAP/SKU Data for Current IDH_SPOUT | | di[27]-di[32] | SINT | 2-byte word swap | SAP/SKU Data for Current IDH_CUP | ## NEXT2 Batch Information (New Implementation) | Position | Data Type | Processing | Description | |----------|-----------|------------|-------------| | di[1]-di[3] | SINT | Direct transfer | Production Order Number for second next batch (PO_NUMBER_NEXT2) | | di[4]-di[6] | SINT | Direct transfer | Container ID for second next batch (IDH_CON_NEXT2) | | di[7]-di[9] | SINT | Direct transfer | Bottle ID for second next batch (IDH_BTL_NEXT2) | ## System Control and Reserved Fields | Position | Data Type | Processing | Description | |----------|-----------|------------|-------------| | di[45]-di[49] | DINT | 4-byte swap | Reserved for system control words | ### With AUTEFA there is communication with the Next + 1 *** ![[Pasted image 20250204094751.png|800]] DB2019 / FB 2014 ![[Pasted image 20250204095414.png|800]] | | | | | | |:----------------------:|:------------------------------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------------------------:| ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | | HENKEL | Alpla | Vetromeccanica | AUTEFA | | | Before Changeover | Sends IDH_BTL_NEXT number to be validated | | | | | _Data_To_EbConvey[38]_ | | | | | | | Validates IDH_BTL_NEXT is valid number and send acknowledge | | | | | | _Data_From_EbConvey[0].2_ | | | | | Step 1 | Operator manually selects "Line Clearance" (?) and send signal "0" on "CalculatedBottlesRemainingToFill". | | | | | | _Data_To_EbConvey[23]_ | | | | | Step 2 | | Stops taking bottles out of trays and sends what is already on the tables and conveyors. | Emptying Merger and Line | Stops taking bottles out of trays and sends what is already on the tables and conveyors. | | | | _N/A_ | _TG10 Send 0 in Bottles for Actual Batch_ | | | Step 3 | Operator verifies line is empty and sends "changeover request" signal after last bottle goes thorugh filler. | | | | | | _Data_To_EbConvey[0].0_ | | | | | Step 4 | | Operator verifies line is empty and sends "line is busy with changeover", confirming on Popup screen | | | | | | _Data_From_EbConvey[0].0_ | | | | Step 5 | | | Starts changeover | Starts changeover | | | | | _Data_From_EbConvey[0].0_ | _Data_From_EbConvey[0].0_ | | Step 6 | | | Ends changeover. Sends signal "Changeover is finished and ready. | Ends changeover. Sends signal "Changeover is finished and ready. | | | | | _Data_From_EbConvey[0].1_ | _Data_From_EbConvey[0].1_ | | | | | | | | | | | | | | Step 7 | Send Reset counters signal | | Reset Counters | | | | _Data_To_EbConvey[0].1_ | | | | | Step 8 | Send new value on "CalculatedBottlesRemainingToFill". | | | | | | _Data_To_EbConvey[23]_ | | | | | Step 9 | Send Changeover Complete. To be considered "Production Ready" | Starts conveying bottles. | Finish Chanover Cycle | | | | _Data_To_EbConvey[0].2_ | | | |