Updated WM_OUT_ACTIONS trigger and GetAvailableMakeupWafers to exclude WMI wafers from EpiPro cassettes. Removed deprecated code from GetAvailableMakeupWafers.

This commit is contained in:
Infineon\StieberD 2025-02-06 10:17:31 -07:00
parent b31452bff7
commit 843e5cade4
2 changed files with 110 additions and 231 deletions

View File

@ -65,9 +65,6 @@ Declare subroutine Material_Services, Memory_Services, Database_Services, SRP_A
Declare subroutine SRP_Stopwatch, Set_Status, RList, Work_Order_Services, SQL_Services, obj_WO_Mat, obj_Notes Declare subroutine SRP_Stopwatch, Set_Status, RList, Work_Order_Services, SQL_Services, obj_WO_Mat, obj_Notes
Declare subroutine SRP_Rotate_Array, SRP_DateTime, obj_WO_Log, Hold_Services Declare subroutine SRP_Rotate_Array, SRP_DateTime, obj_WO_Log, Hold_Services
UseMakeupWafersTable = Database_Services('ReadDataRow', 'APP_INFO', 'USE_MAKEUP_WAFERS_TABLE')
If UseMakeupWafersTable EQ '' then UseMakeupWafersTable = False$
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\MUBox' LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\MUBox'
LogDate = Oconv(Date(), 'D4/') LogDate = Oconv(Date(), 'D4/')
LogTime = Oconv(Time(), 'MTS') LogTime = Oconv(Time(), 'MTS')
@ -616,251 +613,135 @@ Service GetAvailableMakeupWafers(WorkOrderNo, KeysOnly=BOOLEAN)
AvailableMakeupWafers = '' AvailableMakeupWafers = ''
If UseMakeupWafersTable EQ False$ then If WorkOrderNo NE '' then
If WorkOrderNo NE '' then WorkOrderNo = WorkOrderNo[1, '*'] ; // This might be formatted as a WO_MAT Key ID, so strip off the Cassette No.
WorkOrderNo = WorkOrderNo[1, '*'] ; // This might be formatted as a WO_MAT Key ID, so strip off the Cassette No. WOLogRow = Database_Services('ReadDataRow', 'WO_LOG', WorkOrderNo)
WOLogRow = Database_Services('ReadDataRow', 'WO_LOG', WorkOrderNo) If Error_Services('NoError') then
WOStepKeys = WOLogRow<WO_LOG_WO_STEP_KEY$>
WOMatKeys = WOLogRow<WO_LOG_WO_MAT_KEY$>
FirstWOMatKey = WOMatKeys<0, 1>
WOMatRow = Database_Services('ReadDataRow', 'WO_MAT', FirstWOMatKey)
If Error_Services('NoError') then If Error_Services('NoError') then
WOStepKeys = WOLogRow<WO_LOG_WO_STEP_KEY$> PartNo = WOMatRow<WO_MAT_CUST_PART_NO$>
WOMatKeys = WOLogRow<WO_LOG_WO_MAT_KEY$> LastWOStepKey = WOStepKeys[-1, 'B' : @VM]
FirstWOMatKey = WOMatKeys<0, 1> WOStepRow = Database_Services('ReadDataRow', 'WO_STEP', LastWOStepKey)
WOMatRow = Database_Services('ReadDataRow', 'WO_MAT', FirstWOMatKey)
If Error_Services('NoError') then If Error_Services('NoError') then
PartNo = WOMatRow<WO_MAT_CUST_PART_NO$> WOStepPSN = WOStepRow<WO_STEP_PROD_SPEC_ID$>
LastWOStepKey = WOStepKeys[-1, 'B' : @VM] WOStepRDSNos = WOStepRow<WO_STEP_RDS_KEY$>
WOStepRow = Database_Services('ReadDataRow', 'WO_STEP', LastWOStepKey) WOStepWMOutNos = WOStepRow<WO_STEP_WM_OUT_KEYS$>
ProdSpecRow = Database_Services('ReadDataRow', 'PROD_SPEC', WOStepPSN)
If Error_Services('NoError') then If Error_Services('NoError') then
WOStepPSN = WOStepRow<WO_STEP_PROD_SPEC_ID$> ReactorType = ProdSpecRow<PROD_SPEC_REACTOR_TYPE$>
WOStepRDSNos = WOStepRow<WO_STEP_RDS_KEY$> SearchString = ''
WOStepWMOutNos = WOStepRow<WO_STEP_WM_OUT_KEYS$> SearchTable = 'MAKEUP_WAFERS'
ProdSpecRow = Database_Services('ReadDataRow', 'PROD_SPEC', WOStepPSN) If ReactorType EQ 'EPP' then
SearchString := 'EPI_PART_NO' : @VM : PartNo : @FM : 'REACT_TYPE' : @VM : 'EPP' : @FM
end else
SearchString := 'EPI_PART_NO' : @VM : PartNo : @FM : 'REACT_TYPE' : @VM : '#EPP' : @FM
end
hDictSearchTable = Database_Services('GetTableHandle', 'DICT.' : SearchTable)
If Error_Services('NoError') then If Error_Services('NoError') then
ReactorType = ProdSpecRow<PROD_SPEC_REACTOR_TYPE$> rv = Set_Status(0)
SearchString = '' MakeupBoxes = ''
If (ReactorType EQ 'EPP') OR (ReactorType EQ 'P') then Flag = ''
SearchTable = 'WM_OUT' StatusCode = ''
SearchString := 'MU_PART_NO' : @VM : PartNo : @FM Btree.Extract(SearchString, SearchTable, hDictSearchTable, MakeupBoxes, '', Flag)
If Get_Status(StatusCode) then
Error_Services('Add', 'Error calling Btree.Extract in the ' : Service : ' service. StatusCode: ' : StatusCode)
end else end else
SearchTable = 'WO_MAT' If MakeupBoxes NE '' then
SearchString := 'MAKEUP_BOX' : @VM : 1 : @FM // One or more makeup was found that matches the customer's part and has the status of 'Ready to Use'.
SearchString := 'CUST_PART_NO' : @VM : PartNo : @FM // Now loop through to find out which ones have the RDS final signature or not.
end NumMakeupBoxes = DCount(MakeupBoxes, @VM)
hDictSearchTable = Database_Services('GetTableHandle', 'DICT.' : SearchTable) For Each MakeupBoxID in MakeupBoxes using @VM
If Error_Services('NoError') then WOMatKeyID = MakeupBoxID
rv = Set_Status(0) CurrStatus = Xlate('MAKEUP_WAFERS', MakeupBoxID, 'CURR_STATUS_STATIC', 'X')
MakeupBoxes = '' // DPC 7/21/20 added HOLD as excluded status type
Flag = '' Locate CurrStatus in 'MT,VOID,SHIP,REJ,HOLD' using ',' setting cPos else
StatusCode = ''
Btree.Extract(SearchString, SearchTable, hDictSearchTable, MakeupBoxes, '', Flag)
If Get_Status(StatusCode) then
Error_Services('Add', 'Error calling Btree.Extract in the ' : Service : ' service. StatusCode: ' : StatusCode)
end else
If MakeupBoxes NE '' then
// One or more makeup was found that matches the customer's part and has the status of 'Ready to Use'.
// Now loop through to find out which ones have the RDS final signature or not.
NumMakeupBoxes = DCount(MakeupBoxes, @VM)
For Each MakeupBoxID in MakeupBoxes using @VM
SRP_Stopwatch('Start', 'CurrStatus')
If (ReactorType EQ 'EPP') OR (ReactorType EQ 'P') then If (ReactorType EQ 'EPP') OR (ReactorType EQ 'P') then
WOMatKeyID = Field(MakeupBoxID, '*', 1) : '*' : Field(MakeupBoxID, '*', 3) CurrWaferCount = obj_WO_Mat('CurrWaferCnt', WOMatKeyID:@RM:'':@RM:True$)
CurrStatus = obj_WM_Out('CurrStatus', MakeupBoxID)
end else end else
WOMatKeyID = MakeupBoxID
CurrStatus = obj_WO_Mat('CurrStatus', WOMatKeyID)
end
// DPC 7/21/20 added HOLD as excluded status type
Locate CurrStatus in 'MT,VOID,SHIP,REJ,HOLD' using ',' setting cPos else
CurrWaferCount = obj_WO_Mat('CurrWaferCnt', WOMatKeyID) CurrWaferCount = obj_WO_Mat('CurrWaferCnt', WOMatKeyID)
If CurrWaferCount GT 0 then end
WOMatRow = Database_Services('ReadDataRow', 'WO_MAT', WOMatKeyID) If CurrWaferCount GT 0 then
RDSKeyIDs = WOMatRow<WO_MAT_RDS_NO$> WOMatRow = Database_Services('ReadDataRow', 'WO_MAT', WOMatKeyID)
SAPBatchNo = WOMatRow<WO_MAT_SAP_BATCH_NO$> RDSKeyIDs = WOMatRow<WO_MAT_RDS_NO$>
FirstRDSKeyID = RDSKeyIDs[1, @VM] SAPBatchNo = WOMatRow<WO_MAT_SAP_BATCH_NO$>
RDSRow = Database_Services('ReadDataRow', 'RDS', FirstRDSKeyID) FirstRDSKeyID = RDSKeyIDs[1, @VM]
ThisWorkOrderNo = WOMatKeyID[1, '*'] RDSRow = Database_Services('ReadDataRow', 'RDS', FirstRDSKeyID)
ThisCassetteNo = WOMatKeyID[Col2() + 1, '*'] WMOKey = WOMatRow<WO_MAT_WMO_KEY$>
ThisWOLogRow = Database_Services('ReadDataRow', 'WO_LOG', ThisWorkOrderNo) If WMOKey NE '' then
ThisWOStepKeyID = ThisWOLogRow<WO_LOG_WO_STEP_KEY$>[-1, 'B' : @VM] WMOFQASig = Xlate('WM_OUT', WMOKey, 'SUP_VER_SIG', 'X')
ThisWOStepRow = Database_Services('ReadDataRow', 'WO_STEP', ThisWOStepKeyID) end else
WOStepRDSNos = ThisWoStepRow<WO_STEP_RDS_KEY$> WMOFQASig = ''
MakeupBoxDet = ThisWorkOrderNo : @SVM end
MakeupBoxDet := ThisCassetteNo : @SVM ThisWorkOrderNo = WOMatKeyID[1, '*']
MakeupBoxDet := WOMatRow<WO_MAT_SAP_BATCH_NO$> : @SVM ThisCassetteNo = WOMatKeyID[Col2() + 1, '*']
MakeupBoxDet := ThisWOStepRow<WO_STEP_PROD_SPEC_ID$> : @SVM ThisWOLogRow = Database_Services('ReadDataRow', 'WO_LOG', ThisWorkOrderNo)
MakeupBoxDet := PartNo : @SVM ThisWOStepKeyID = ThisWOLogRow<WO_LOG_WO_STEP_KEY$>[-1, 'B' : @VM]
MakeupBoxDet := CurrWaferCount : @SVM ThisWOStepRow = Database_Services('ReadDataRow', 'WO_STEP', ThisWOStepKeyID)
MakeupBoxDet := FirstRDSKeyID WOStepRDSNos = ThisWoStepRow<WO_STEP_RDS_KEY$>
// JRO Added PROD_SPEC PARAMETERS 5/8/2020 MakeupBoxDet = ThisWorkOrderNo : @SVM
If (ReactorType EQ 'EPP') OR (ReactorType EQ 'P') then MakeupBoxDet := ThisCassetteNo : @SVM
ProdSpecID = Xlate('RDS', WOStepRDSNos<1, 1>, 114, 'X') MakeupBoxDet := WOMatRow<WO_MAT_SAP_BATCH_NO$> : @SVM
end else MakeupBoxDet := ThisWOStepRow<WO_STEP_PROD_SPEC_ID$> : @SVM
ProdSpecID = Xlate('RDS', RDSKeyIDs, 114, 'X') MakeupBoxDet := PartNo : @SVM
end MakeupBoxDet := CurrWaferCount : @SVM
ActiveStatus = XLATE('PROD_SPEC', ProdSpecID, 9, 'X') MakeupBoxDet := FirstRDSKeyID
// JRO Added the extra condition for Active Status 5/8/2020 // JRO Added PROD_SPEC PARAMETERS 5/8/2020
If ActiveStatus EQ 'A' then If (ReactorType EQ 'EPP') OR (ReactorType EQ 'P') then
If (RDSRow<RDS_SUP_VER_SIG$> NE '') OR ((ReactorType EQ 'EPP') OR (ReactorType EQ 'P')) then ProdSpecID = Xlate('RDS', WOStepRDSNos<1, 1>, RDS_PROD_SPEC_ID$, 'X')
// Has a RDS final signature. end else
If KeysOnly EQ True$ then ProdSpecID = Xlate('RDS', RDSKeyIDs, RDS_PROD_SPEC_ID$, 'X')
If (ReactorType EQ 'EPP') OR (ReactorType EQ 'P') then end
AvailableMakeupWafers = Insert(AvailableMakeupWafers, 1, -1, 0, MakeupBoxID) ActiveStatus = XLATE('PROD_SPEC', ProdSpecID, PROD_SPEC_STATUS$, 'X')
end else // JRO Added the extra condition for Active Status 5/8/2020
AvailableMakeupWafers = Insert(AvailableMakeupWafers, 1, -1, 0, WOMatKeyID) If ActiveStatus EQ 'A' then
end Begin Case
end else
AvailableMakeupWafers = Insert(AvailableMakeupWafers, 1, -1, 0, MakeupBoxDet) Case SAPBatchNo EQ ''
end // Cassette has not received a batch number from SAP, so it is not yet eligible to be used.
FieldPos = 3
Case ( (ReactorType NE 'EPP') and (RDSRow<RDS_SUP_VER_SIG$> NE '') ) OR ( (ReactorType EQ 'EPP') and (WMOFQASig NE '') )
// Cassette has a final signature, so it is eligible to be used.
FieldPos = 1
Case ( (ReactorType NE 'EPP') and (RDSRow<RDS_SUP_VER_SIG$> EQ '') ) OR ( (ReactorType EQ 'EPP') and (WMOFQASig EQ '') )
// Cassette does not yet have a final signature, so it is not yet eligible to be used.
FieldPos = 2
Case Otherwise$
// Log these cassettes as we should never end up here.
Null
End Case
If KeysOnly EQ True$ then
If (ReactorType EQ 'EPP') OR (ReactorType EQ 'P') then
WMOFormat = Field(MakeupBoxID, '*', 1):'*1*':Field(MakeupBoxID, '*', 2)
AvailableMakeupWafers = Insert(AvailableMakeupWafers, FieldPos, -1, 0, WMOFormat)
end else end else
// Does not have a RDS final signature. AvailableMakeupWafers = Insert(AvailableMakeupWafers, FieldPos, -1, 0, WOMatKeyID)
If KeysOnly EQ True$ then
AvailableMakeupWafers = Insert(AvailableMakeupWafers, 2, -1, 0, WOMatKeyID)
end else
AvailableMakeupWafers = Insert(AvailableMakeupWafers, 2, -1, 0, MakeupBoxDet)
end
end end
end else
AvailableMakeupWafers = Insert(AvailableMakeupWafers, FieldPos, -1, 0, MakeupBoxDet)
end end
end end
end end
Next MakeupBoxID end
end Next MakeupBoxID
end end
end end
end end
end end
end end
end end
end else
Error_Services('Add', 'WorkOrderNo argument was missing from the ' : Service : ' service.')
end end
end else end else
Error_Services('Add', 'WorkOrderNo argument was missing from the ' : Service : ' service.')
If WorkOrderNo NE '' then
WorkOrderNo = WorkOrderNo[1, '*'] ; // This might be formatted as a WO_MAT Key ID, so strip off the Cassette No.
WOLogRow = Database_Services('ReadDataRow', 'WO_LOG', WorkOrderNo)
If Error_Services('NoError') then
WOStepKeys = WOLogRow<WO_LOG_WO_STEP_KEY$>
WOMatKeys = WOLogRow<WO_LOG_WO_MAT_KEY$>
FirstWOMatKey = WOMatKeys<0, 1>
WOMatRow = Database_Services('ReadDataRow', 'WO_MAT', FirstWOMatKey)
If Error_Services('NoError') then
PartNo = WOMatRow<WO_MAT_CUST_PART_NO$>
LastWOStepKey = WOStepKeys[-1, 'B' : @VM]
WOStepRow = Database_Services('ReadDataRow', 'WO_STEP', LastWOStepKey)
If Error_Services('NoError') then
WOStepPSN = WOStepRow<WO_STEP_PROD_SPEC_ID$>
WOStepRDSNos = WOStepRow<WO_STEP_RDS_KEY$>
WOStepWMOutNos = WOStepRow<WO_STEP_WM_OUT_KEYS$>
ProdSpecRow = Database_Services('ReadDataRow', 'PROD_SPEC', WOStepPSN)
If Error_Services('NoError') then
ReactorType = ProdSpecRow<PROD_SPEC_REACTOR_TYPE$>
SearchString = ''
SearchTable = 'MAKEUP_WAFERS'
If ReactorType EQ 'EPP' then
SearchString := 'EPI_PART_NO' : @VM : PartNo : @FM : 'REACT_TYPE' : @VM : 'EPP' : @FM
end else
SearchString := 'EPI_PART_NO' : @VM : PartNo : @FM : 'REACT_TYPE' : @VM : '#EPP' : @FM
end
hDictSearchTable = Database_Services('GetTableHandle', 'DICT.' : SearchTable)
If Error_Services('NoError') then
rv = Set_Status(0)
MakeupBoxes = ''
Flag = ''
StatusCode = ''
Btree.Extract(SearchString, SearchTable, hDictSearchTable, MakeupBoxes, '', Flag)
If Get_Status(StatusCode) then
Error_Services('Add', 'Error calling Btree.Extract in the ' : Service : ' service. StatusCode: ' : StatusCode)
end else
If MakeupBoxes NE '' then
// One or more makeup was found that matches the customer's part and has the status of 'Ready to Use'.
// Now loop through to find out which ones have the RDS final signature or not.
NumMakeupBoxes = DCount(MakeupBoxes, @VM)
For Each MakeupBoxID in MakeupBoxes using @VM
WOMatKeyID = MakeupBoxID
CurrStatus = Xlate('MAKEUP_WAFERS', MakeupBoxID, 'CURR_STATUS_STATIC', 'X')
// DPC 7/21/20 added HOLD as excluded status type
Locate CurrStatus in 'MT,VOID,SHIP,REJ,HOLD' using ',' setting cPos else
CurrWaferCount = obj_WO_Mat('CurrWaferCnt', WOMatKeyID)
If CurrWaferCount GT 0 then
WOMatRow = Database_Services('ReadDataRow', 'WO_MAT', WOMatKeyID)
RDSKeyIDs = WOMatRow<WO_MAT_RDS_NO$>
SAPBatchNo = WOMatRow<WO_MAT_SAP_BATCH_NO$>
FirstRDSKeyID = RDSKeyIDs[1, @VM]
RDSRow = Database_Services('ReadDataRow', 'RDS', FirstRDSKeyID)
WMOKey = WOMatRow<WO_MAT_WMO_KEY$>
If WMOKey NE '' then
WMOFQASig = Xlate('WM_OUT', WMOKey, 'SUP_VER_SIG', 'X')
end else
WMOFQASig = ''
end
ThisWorkOrderNo = WOMatKeyID[1, '*']
ThisCassetteNo = WOMatKeyID[Col2() + 1, '*']
ThisWOLogRow = Database_Services('ReadDataRow', 'WO_LOG', ThisWorkOrderNo)
ThisWOStepKeyID = ThisWOLogRow<WO_LOG_WO_STEP_KEY$>[-1, 'B' : @VM]
ThisWOStepRow = Database_Services('ReadDataRow', 'WO_STEP', ThisWOStepKeyID)
WOStepRDSNos = ThisWoStepRow<WO_STEP_RDS_KEY$>
MakeupBoxDet = ThisWorkOrderNo : @SVM
MakeupBoxDet := ThisCassetteNo : @SVM
MakeupBoxDet := WOMatRow<WO_MAT_SAP_BATCH_NO$> : @SVM
MakeupBoxDet := ThisWOStepRow<WO_STEP_PROD_SPEC_ID$> : @SVM
MakeupBoxDet := PartNo : @SVM
MakeupBoxDet := CurrWaferCount : @SVM
MakeupBoxDet := FirstRDSKeyID
// JRO Added PROD_SPEC PARAMETERS 5/8/2020
If (ReactorType EQ 'EPP') OR (ReactorType EQ 'P') then
ProdSpecID = Xlate('RDS', WOStepRDSNos<1, 1>, RDS_PROD_SPEC_ID$, 'X')
end else
ProdSpecID = Xlate('RDS', RDSKeyIDs, RDS_PROD_SPEC_ID$, 'X')
end
ActiveStatus = XLATE('PROD_SPEC', ProdSpecID, PROD_SPEC_STATUS$, 'X')
// JRO Added the extra condition for Active Status 5/8/2020
If ActiveStatus EQ 'A' then
Begin Case
Case SAPBatchNo EQ ''
// Cassette has not received a batch number from SAP, so it is not yet eligible to be used.
FieldPos = 3
Case ( (ReactorType NE 'EPP') and (RDSRow<RDS_SUP_VER_SIG$> NE '') ) OR ( (ReactorType EQ 'EPP') and (WMOFQASig NE '') )
// Cassette has a final signature, so it is eligible to be used.
FieldPos = 1
Case ( (ReactorType NE 'EPP') and (RDSRow<RDS_SUP_VER_SIG$> EQ '') ) OR ( (ReactorType EQ 'EPP') and (WMOFQASig EQ '') )
// Cassette does not yet have a final signature, so it is not yet eligible to be used.
FieldPos = 2
Case Otherwise$
// Log these cassettes as we should never end up here.
Null
End Case
If KeysOnly EQ True$ then
If (ReactorType EQ 'EPP') OR (ReactorType EQ 'P') then
WMOFormat = Field(MakeupBoxID, '*', 1):'*1*':Field(MakeupBoxID, '*', 2)
AvailableMakeupWafers = Insert(AvailableMakeupWafers, FieldPos, -1, 0, WMOFormat)
end else
AvailableMakeupWafers = Insert(AvailableMakeupWafers, FieldPos, -1, 0, WOMatKeyID)
end
end else
AvailableMakeupWafers = Insert(AvailableMakeupWafers, FieldPos, -1, 0, MakeupBoxDet)
end
end
end
end
Next MakeupBoxID
end
end
end
end
end
end
end
end else
Error_Services('Add', 'WorkOrderNo argument was missing from the ' : Service : ' service.')
end
end end
Response = AvailableMakeupWafers Response = AvailableMakeupWafers
@ -1589,5 +1470,3 @@ ClearCursors:
return return

View File

@ -338,7 +338,7 @@ WRITE_RECORD:
WOMatKey = {WO_MAT_KEY} WOMatKey = {WO_MAT_KEY}
If MakeupBox then If MakeupBox then
CurrWaferCount = obj_WO_Mat('CurrWaferCnt', WOMatKey) CurrWaferCount = obj_WO_Mat('CurrWaferCnt', WOMatKey:@RM:'':@RM:True$)
If CurrWaferCount GT 0 then If CurrWaferCount GT 0 then
// Populate MAKEUP_WAFERS table // Populate MAKEUP_WAFERS table
// Add/update cassette data to the MAKEUP_WAFERS table // Add/update cassette data to the MAKEUP_WAFERS table