Merged PR 28044: RE-Order - Consolidation of Lot Events for Fabtime.

1. Moved the call to add an ARRIVAL event to within the MoveOutLot function. After the move out is performed to allow for arrival at the next operation.
2. Create a IsLastOperation function to determine if the current operation is the last operation of the lot.
3. Added a call to function IsLastOperation from the MoveOutLot function. If IsLastOperation returns true then instead of an ARRIVAL, it creates a CLOSE event to and sets the CLOSE flag by calling CloseLot function.
4. Modified the AutoCloseTestWaferLot routine to be more generic. Renamed to AutoCloseLot routine.
5. Modified two calls in the from the RDS modules to call the AutoCloseLot function rather than use redundant calls to Move In and Move Out repeatedly until the lot reach it's last operation.
This commit is contained in:
Ouellette Jonathan (CSC FI SPS MESLEO)
2025-10-10 00:18:39 +00:00
parent 52504272f9
commit 8604a83966
3 changed files with 92 additions and 81 deletions

View File

@ -326,7 +326,7 @@ Service CreateNewLot(LotType, ProdName, LotQty, VendorPartNo, VendorLotNo, Vendo
Lot_Services('OpenLot', CreatedLotNumber)
if Error_Services('NoError') then
// Move lot in
Lot_Services('MoveInLot', CreatedLotNumber, Username)
Lot_Services('StartLot', CreatedLotNumber, 'SYSTEM')
if Error_Services('NoError') then
If PrinterID NE 'WEB' then
// If PrinterID is set to WEB this means the request comes from OI_Wizard and the client is going to handle printing.
@ -792,6 +792,33 @@ Service IsLotMovedIn(LotId)
end service
Service IsLastOperation(LotId, LotOperationId)
ErrorMsg = ''
Response = False$
If LotId NE '' then
If LotOperationId NE '' then
AllOpsInSeq = Lot_Services('GetLotOperationSequence', LotId)
if Error_Services('NoError') then
LastLotOperation = AllOpsInSeq[-1, "B":@FM]
If LotOperationId EQ LastLotOperation then Response = True$
end else
ErrorMsg = Error_Services('GetMessage')
end
end else
ErrorMsg = 'LotOperationId was null.'
end
end else
ErrorMsg = 'LotId was null.'
end
If ErrorMsg NE '' then
Error_Services('Add', ErrorMsg)
end
end service
Service IsOperationCompleted(LotOperationId)
@ -819,8 +846,14 @@ Service StartLot(LotId, Operator)
If RowExists('LOT', LotId) then
Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'LOT_START', 'Lot started.', '', Operator)
If Error_Services('NoError') then
Lot_Services('MoveInLot', LotId, Operator)
If Error_Services('HasError') then ErrorMessage = Error_Services('GetMessage')
CurrOperation = Lot_Services('GetLotCurrOperationName', LotId)
Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'ARRIVAL', 'Lot arrived at operation ' : CurrOperation : '.', '', Operator)
if Error_Services('NoError') then
Lot_Services('MoveInLot', LotId, Operator)
If Error_Services('HasError') then ErrorMessage = Error_Services('GetMessage')
end else
ErrorMessage = Error_Services('GetMessage')
end
end else
ErrorMessage = Error_Services('GetMessage')
end
@ -958,12 +991,7 @@ Service MoveInLot(LotID, Operator)
CurrOperation = XLATE('LOT_OPERATION', ThisLotCurrOperationID, LOT_OPERATION_OPERATION_ID$, 'X')
If Error_Services('NoError') then
Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'MOVE_IN', 'Lot moved into operation ' : CurrOperation : '.', '', Operator)
If Error_Services('NoError') then
Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'ARRIVAL', 'Lot arrived at operation ' : CurrOperation : '.', '', Operator)
If Error_Services('HasError') then ErrorMessage = Error_Services('GetMessage')
end else
ErrorMessage = Error_Services('GetMessage')
end
If Error_Services('HasError') then ErrorMessage = Error_Services('GetMessage')
end else
ErrorMessage = 'Error in Move In process for Lot id ' : LotId : '. ' : Error_Services('GetMessage')
end
@ -1018,6 +1046,7 @@ Service MoveOutLot(LotID, Operator)
WaferQty = ThisLotRec<LOT_WAFER_QTY$>
If Error_Services('NoError') then
ThisLotCurrOperationID = Lot_Services('GetLotCurrOperationId', LotId)
ThisLotCurrOperationName = XLATE('LOT_OPERATION', ThisLotCurrOperationID, LOT_OPERATION_OPERATION_ID$, 'X')
If ThisLotCurrOperationID NE '' then
If Lot_Services('IsLotMovedIn', LotId) then
ThisLotCurrOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', ThisLotCurrOperationID)
@ -1029,7 +1058,23 @@ Service MoveOutLot(LotID, Operator)
LotType = XLATE('LOT', LotId, LOT_TYPE$, 'X')
CurrOperation = XLATE('LOT_OPERATION', ThisLotCurrOperationID, LOT_OPERATION_OPERATION_ID$, 'X')
If Error_Services('NoError') then
Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'MOVE_OUT', 'Lot moved out of operation ' : CurrOperation : '.', '', Operator)
IsLastLotOp = Lot_Services('IsLastOperation', LotId, ThisLotCurrOperationID)
if Error_Services('NoError') then
Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'MOVE_OUT', 'Lot moved out of operation ' : ThisLotCurrOperationName : '.', '', Operator)
If Error_Services('NoError') then
If Not(IsLastLotOp) then
NewCurrOperation = Lot_Services('GetLotCurrOperationName', LotId)
Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'ARRIVAL', 'Lot arrived at operation ' : NewCurrOperation : '.', '', Operator)
end else
Lot_Services('CloseLot', LotId)
if Error_Services('HasError') then
ErrorMessage = Error_Services('GetMessage')
end
end
end
end else
ErrorMessage = Error_Services('GetMessage')
end
end else
ErrorMessage = 'Error in Move In process for Lot id ' : LotId : '. ' : Error_Services('GetMessage')
end
@ -1229,9 +1274,7 @@ Service OpenLot(LotId)
LotRec = Database_Services('ReadDataRow', 'LOT', LotId, True$, 0, False$)
LotRec<LOT_OPEN$> = True$
Database_Services('WriteDataRow', 'LOT', LotId, LotRec, True$, False$, False$)
If Error_Services('NoError') then
Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'LOT_START', 'Lot created.', '', 'SYSTEM')
end else
If Error_Services('HasError') then
ErrorMessage = 'Error setting lot ' : LotId : ' to open.' : Error_Services('GetMessage')
end
end else
@ -1272,51 +1315,39 @@ Service CloseLot(LotId)
end service
Service AutoCloseTestWaferLot(LotId, CloseUserId)
Service AutoCloseLot(LotId, CloseUserId)
AutoCloseTime = Datetime()
ErrorMessage = ''
If MemberOf(CloseUserId, 'LEAD') OR MemberOf(CloseUserId, 'SUPERVISOR') OR CloseUserId EQ 'SYSTEM' then
LotOperations = Lot_Services('GetLotOperationSequence', LotId)
for LotOperationIndex = 1 to DCount(LotOperations, @FM)
Until ErrorMessage NE ''
ThisLotOperationId = LotOperations<LotOperationIndex>
ThisOperationCompleted = Lot_Services('IsOperationCompleted', ThisLotOperationId)
If Error_Services('NoError') then
if Not(ThisOperationCompleted) then
ThisLotOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', ThisLotOperationId)
if Error_Services('NoError') then
CurrLotQty = Database_Services('ReadDataColumn', 'LOT', LotId, LOT_WAFER_QTY$, True$, 0, False$)
If ThisLotOperationRec<LOT_OPERATION_DATETIME_IN$> EQ '' then
ThisLotOperationRec<LOT_OPERATION_DATETIME_IN$> = AutoCloseTime
end
If ThisLotOperationRec<LOT_OPERATION_DATETIME_OUT$> EQ '' then
ThisLotOperationRec<LOT_OPERATION_DATETIME_OUT$> = AutoCloseTime
end
if ThisLotOperationRec<LOT_OPERATION_OPERATOR_IN_ID$> EQ '' then
ThisLotOperationRec<LOT_OPERATION_OPERATOR_IN_ID$> = CloseUserId
end
if ThisLotOperationRec<LOT_OPERATION_OPERATOR_OUT_ID$> EQ '' then
ThisLotOperationRec<LOT_OPERATION_OPERATOR_OUT_ID$> = CloseUserId
end
if ThisLotOperationRec<LOT_OPERATION_DATETIME_START$> EQ '' then
ThisLotOperationRec<LOT_OPERATION_DATETIME_START$> = AutoCloseTime
end
if ThisLotOperationRec<LOT_OPERATION_DATETIME_STOP$> EQ '' then
ThisLotOperationRec<LOT_OPERATION_DATETIME_STOP$> = AutoCloseTime
end
If ThisLotOperationRec<LOT_OPERATION_WAFER_IN_QTY$> EQ '' then
ThisLotOperationRec<LOT_OPERATION_WAFER_IN_QTY$> = CurrLotQty
end
If ThisLotOperationRec<LOT_OPERATION_WAFER_OUT_QTY$> EQ '' then
ThisLotOperationRec<LOT_OPERATION_WAFER_OUT_QTY$> = CurrLotQty
end
Database_Services('WriteDataRow', 'LOT_OPERATION', ThisLotOperationId, ThisLotOperationRec, True$, False$, False$)
If Error_Services('HasError') then
ErrorMessage = Error_Services('GetMessage')
end
end else
ErrorMessage = Error_Services('GetMessage')
end
MovedIn = Lot_Services('IsLotMovedIn', LotId)
If MovedIn then
Lot_Services('MoveOutLot', LotId, CloseUserId)
If Error_Services('HasError') then
ErrorMessage = Error_Services('GetMessage')
end else
ErrorMessage = Error_Services('GetMessage')
end
end else
Lot_Services('MoveInLot', LotId, CloseUserId)
If Error_Services('NoError') then
If Lot_Services('IsLastOperation', LotId, ThisLotOperationId) then
Lot_Services('MoveOutLot', LotId, CloseUserId)
If Error_Services('HasError') then
ErrorMessage = Error_Services('GetMessage')
end
end
end else
ErrorMessage = Error_Services('GetMessage')
end
end
end
end else
ErrorMessage = Error_Services('GetMessage')
@ -1326,31 +1357,12 @@ Service AutoCloseTestWaferLot(LotId, CloseUserId)
ErrorMessage = CloseUserId : ' does not have permission to close this lot.'
end
If ErrorMessage EQ '' then
// Close Lot as there were no validation failures.
Lot_Services('CloseLot', LotId)
If Error_Services('NoError') then
LogData = ''
LogData<1> = LoggingDTM
LogData<2> = LotId
LogData<3> = CloseUserId
LogData<4> = 'Successfully marked lot as closed.'
Logging_Services('AppendLog', objLotClosureLog, LogData, @RM, @FM, False$)
end else
ErrorMessage = Error_Services('GetMessage')
LogData = ''
LogData<1> = LoggingDTM
LogData<2> = LotId
LogData<3> = CloseUserId
LogData<4> = 'Error marking lot as closed.' : ErrorMessage
Logging_Services('AppendLog', objLotClosureLog, LogData, @RM, @FM, False$)
// Send a message to FI
Recipients = Xlate('NOTIFICATION', 'FI_SUPPORT', NOTIFICATION_USER_ID$, 'X')
SentFrom = 'SYSTEM'
Subject = 'TEST WAFER LOT AUTO-CLOSURE FAILURE'
Message = 'Error in ' : service : ' with lot id ' : LotId : ' attempting to set CLOSE flag on lot. ' : ErrorMessage
Obj_Notes('Create',Recipients:@RM:SentFrom:@RM:Subject:@RM:Message)
Error_Services('Add', 'Error in ' : service : ' with lot ' : LotId : ':' : ErrorMessage)
end
LogData = ''
LogData<1> = LoggingDTM
LogData<2> = LotId
LogData<3> = CloseUserId
LogData<4> = 'Successfully marked lot as closed.'
Logging_Services('AppendLog', objLotClosureLog, LogData, @RM, @FM, False$)
end else
ErrorMessage = 'Error in ' : service : ' with lot ' : LotId : ':' : ErrorMessage
LogData = ''
@ -1413,7 +1425,7 @@ Service ReduceLotWaferCount(LotId, ReductionQty, OperatorId)
// Write Lot Event
Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'REDUCE_WAFER_QTY', 'Reduced wafer count by ' : ReductionQty, '', OperatorId, False$, '')
if LotNewWfrQty EQ 0 AND LotType EQ 'TW' then
ServiceParms = 'AutoCloseTestWaferLot' : SD$ : LotId : SD$ : 'SYSTEM'
ServiceParms = 'AutoCloseLot' : SD$ : LotId : SD$ : 'SYSTEM'
Service_Services('PostProcedure', 'LOT_SERVICES', ServiceParms)
If Error_Services('HasError') then
Recipients = Xlate('NOTIFICATION', 'FI_SUPPORT', NOTIFICATION_USER_ID$, 'X')
@ -1619,3 +1631,4 @@ end service
//----------------------------------------------------------------------------------------------------------------------

View File

@ -772,9 +772,7 @@ IF NOT(UnloadFailed) THEN
end else
LotId = Lot_Services('GetLotIdByLegacyLotIdAndType', RDSNo, 'RDS')
If Error_Services('NoError') then
Lot_Services('MoveOutLot', LotId, @User4) ; // Move out of POST_EPI operation
Lot_Services('MoveInLot', LotId, @User4) ; // Move into RDS_CLOSE operation
Lot_Services('CloseLot', LotId)
Lot_Services('AutoCloseLot', LotId, 'SYSTEM')
end
end
@ -1683,3 +1681,4 @@ RETURN

View File

@ -3122,9 +3122,7 @@ Service SignUnloadStage(RDSNo, Username, ScanEntry)
Lot_Services('MoveInLot', LotId, Username) ; // Move into POST_EPI operation
// If no production wafers in this run, then move out of POST_EPI and close the lot.
If Rds_Services('IsEpiProTestRun', RDSNo) then
Lot_Services('MoveOutLot', LotId, Username) ; // Move out of POST_EPI operation
Lot_Services('MoveInLot', LotId, Username) ; // Move into RDS_CLOSE operation
Lot_Services('CloseLot', LotId)
Lot_Services('AutoCloseLot', LotId, 'SYSTEM')
end
end
end
@ -3844,3 +3842,4 @@ return