added logic to RDS_ACTIONS to restore load signatures if erased unexpectedly
refactored solution to leverage the LOT and LOT_EVENT tables minor fix
This commit is contained in:
@ -28,7 +28,7 @@ LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' L
|
||||
Headers = 'Logging DTM' : @FM : 'Lot Id' : @FM : 'Event Type' : @FM : 'Operator' : @FM : 'Begin Wafer Qty' : @FM : 'End Wafer Qty' : @FM : 'Bonus Wafer Qty' : @FM : 'Reduce Wafer Qty' : @FM : 'Message'
|
||||
objLotEventLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, ',', Headers, '', False$, False$)
|
||||
|
||||
Options EVENT_TYPES = 'MOVE_IN', 'MOVE_OUT', 'HOLD_ON', 'HOLD_OFF', 'REDUCE_WAFER_QTY', 'BONUS_WAFER_QTY', 'COMMENT', 'LOCATION'
|
||||
Options EVENT_TYPES = 'MOVE_IN', 'MOVE_OUT', 'HOLD_ON', 'HOLD_OFF', 'REDUCE_WAFER_QTY', 'BONUS_WAFER_QTY', 'COMMENT', 'LOCATION', 'LOAD', 'UNSIGN_LOAD'
|
||||
Options LOT_TYPES = 'TW', 'RDS', 'WM_OUT', 'WM_IN'
|
||||
|
||||
GoToService
|
||||
@ -78,6 +78,145 @@ Service GenerateNewLotId(LotType)
|
||||
Response = NewLotID
|
||||
end service
|
||||
|
||||
|
||||
Service CreateNewLot(LotType, ProdName, LotQty, VendorPartNo, VendorLotNo, VendorCode, Username, PrinterID, LotId)
|
||||
; //649491 , 03M6241, 814474, SP
|
||||
CreatedLotNumber = ''
|
||||
ErrorMessage = ''
|
||||
Begin Case
|
||||
Case LotType EQ 'RDS'
|
||||
NewLotId = LotId
|
||||
If NewLotId NE '' then
|
||||
If RowExists('LOT', NewLotId) EQ False$ then
|
||||
LotRec = ''
|
||||
LotRec<LOT_TYPE$> = LotType
|
||||
LotRec<LOT_PROD_ID$> = ''
|
||||
LotRec<LOT_ORIG_WAFER_QTY$> = LotQty
|
||||
LotRec<LOT_WAFER_QTY$> = LotQty
|
||||
LotRec<LOT_VENDOR_PART_NO$> = VendorPartNo
|
||||
LotRec<LOT_VENDOR_LOT_NO$> = VendorLotNo
|
||||
LotRec<LOT_VENDOR_CODE$> = VendorCode
|
||||
Database_Services('WriteDataRow', 'LOT', NewLotId, LotRec)
|
||||
If Error_Services('HasError') then
|
||||
ErrorMessage = 'Error in ':Service:' service. ':Error_Services('GetMessage')
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in ':Service:' service. LOT record "':NewLotId:'" already exists.'
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in ':Service:' service. No lot ID passed in.'
|
||||
end
|
||||
Case LotType EQ 'TW'
|
||||
If ProdName NE '' then
|
||||
TWProdID = Test_Wafer_Prod_Services('GetTestWaferProdIDsByPartName', ProdName)
|
||||
If TWProdID NE '' then
|
||||
If DCount(TWProdID, @VM) EQ 1 then
|
||||
NewLotId = Lot_Services('GenerateNewLotId', 'TW');//Don't use this
|
||||
If NewLotId NE '' then
|
||||
If RowExists('LOT', NewLotId) then
|
||||
LotRec = Database_Services('ReadDataRow', 'LOT', NewLotId)
|
||||
//Ensure the lot record is empty
|
||||
If LotRec<LOT_TYPE$> EQ '' AND LotRec<LOT_PROD_ID$> EQ '' AND LotRec<LOT_ORIG_WAFER_QTY$> EQ '' AND LotRec<LOT_WAFER_QTY$> EQ '' then
|
||||
LotRec<LOT_TYPE$> = LotType
|
||||
LotRec<LOT_PROD_ID$> = TWProdID
|
||||
LotRec<LOT_ORIG_WAFER_QTY$> = LotQty
|
||||
LotRec<LOT_WAFER_QTY$> = LotQty
|
||||
LotRec<LOT_VENDOR_PART_NO$> = VendorPartNo
|
||||
LotRec<LOT_VENDOR_LOT_NO$> = VendorLotNo
|
||||
LotRec<LOT_VENDOR_CODE$> = VendorCode
|
||||
Database_Services('WriteDataRow', 'LOT', NewLotId, LotRec)
|
||||
//Now Ensure that the written lot matches what was just written
|
||||
LotRecCheck = Database_Services('ReadDataRow', 'LOT', NewLotId)
|
||||
If LotRecCheck EQ LotRec then
|
||||
//Lot Created successfully
|
||||
CreatedLotNumber = NewLotId
|
||||
If RowExists('LOT', CreatedLotNumber) then
|
||||
Lot_Services('CreateInitialLotOperationRecords', CreatedLotNumber)
|
||||
If Error_Services('NoError') then
|
||||
//Check in at first operation
|
||||
//Get Curr Operation(Should be first one in sequence)
|
||||
ThisLotCurrOpId = Lot_Services('GetLotCurrOperation', CreatedLotNumber)
|
||||
If ThisLotCurrOpId NE '' then
|
||||
Lot_Services('MoveInLot', NewLotId, LotQty, Username)
|
||||
if Error_Services('NoError') then
|
||||
//Set lot to open
|
||||
Lot_Services('OpenLot', CreatedLotNumber)
|
||||
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.
|
||||
Labeling_Services('PrintTestWaferLotLabel', CreatedLotNumber, Username, PrinterID)
|
||||
If Error_Services('HasError') then
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : CreatedLotNumber : ' , ' : Error_Services('GetMessage')
|
||||
end
|
||||
end
|
||||
Lot_Services('MoveOutLot', NewLotId, LotQty, Username)
|
||||
If Error_Services('NoError') then
|
||||
Lot_Services('MoveInLot', NewLotId, LotQty, Username)
|
||||
If Error_Services('HasError') then
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage')
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage')
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage')
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage')
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, error getting current operation for lot: ' : NewLotId
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage')
|
||||
end
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, Lot attributes did not write correctly for lot: ' : NewLotId
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, Lot already had data, lot: ' : NewLotId
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, Created lot: ' : NewLotId : ' not found in LOT table.'
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, no lot id returned.'
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, ambiguous product passed to routine OR no matching products found.'
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, product(':ProdName:') passed to routine not found.'
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Null value passed in for ProdID'
|
||||
end
|
||||
Case Otherwise$
|
||||
ErrorMessage = 'Error in ':Service:' service. Lot Type "':LotType:'" is not currently supported.'
|
||||
End Case
|
||||
|
||||
If ErrorMessage EQ '' then
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDTM
|
||||
LogData<2> = ProdName
|
||||
LogData<3> = Username
|
||||
LogData<4> = 'Successfully created lot id ' : CreatedLotNumber : ' of product type ' : ProdName '.'
|
||||
Logging_Services('AppendLog', objTWCreationLog, LogData, @RM, @FM, False$)
|
||||
end else
|
||||
Error_Services('Add', ErrorMessage)
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDTM
|
||||
LogData<2> = ProdName
|
||||
LogData<3> = Username
|
||||
LogData<4> = ErrorMessage
|
||||
Logging_Services('AppendLog', objTWCreationLog, LogData, @RM, @FM, False$)
|
||||
end
|
||||
Response = CreatedLotNumber
|
||||
|
||||
End Service
|
||||
|
||||
|
||||
Service CreateNewTestWaferLot(LotType, ProdName, LotQty, VendorPartNo, VendorLotNo, VendorCode, Username, PrinterID)
|
||||
CreatedLotNumber = ''
|
||||
ErrorMessage = ''
|
||||
@ -511,6 +650,7 @@ Service MoveOutLot(LotID, WaferQty, Operator)
|
||||
end service
|
||||
|
||||
Service CreateLotEvent(LotId, LotType=LOT_TYPES, EventDatetime, EventType=EVENT_TYPES, EventNote, EventEquipmentId, ReduceWaferQty, BonusWaferQty, OperationId, OperatorId)
|
||||
|
||||
ErrorMessage = ''
|
||||
BeginWaferQty = ''
|
||||
EndWaferQty = ''
|
||||
@ -574,7 +714,55 @@ Service CreateLotEvent(LotId, LotType=LOT_TYPES, EventDatetime, EventType=EVENT_
|
||||
ErrorMessage = 'Error in Create Lot Event routine, Missing event type or Operator ID.'
|
||||
end
|
||||
Case LotType EQ 'RDS'
|
||||
ErrorMessage = 'Error in Create Lot Event routine, Lot type RDS was passed to routine and this is currently not supported.'
|
||||
If EventType NE '' AND OperatorId NE '' then
|
||||
If RowExists('LOT', LotId) then
|
||||
ValidId = False$
|
||||
NewEventId = ''
|
||||
Loop
|
||||
NewEventId = RTI_CreateGUID()
|
||||
If Not(RowExists('LOT_EVENT', NewEventId)) then
|
||||
ValidId = True$
|
||||
end
|
||||
Until ValidId EQ True$
|
||||
Repeat
|
||||
BeginWaferQty = Xlate('LOT', LotId, LOT_WAFER_QTY$, 'X')
|
||||
If ReduceWaferQty NE '' then
|
||||
If Num(ReduceWaferQty) then
|
||||
EndWaferQty = BeginWaferQty - ReduceWaferQty
|
||||
end
|
||||
end
|
||||
If BonusWaferQty NE '' then
|
||||
If Num(BonusWaferQty) then
|
||||
EndWaferQty = BeginWaferQty + BonusWaferQty
|
||||
end
|
||||
end
|
||||
If Not(Num(EventDatetime)) then EventDatetime = IConv(EventDatetime, 'DT')
|
||||
NewEventRec = ''
|
||||
NewEventRec<LOT_EVENT_LOT_ID$> = LotId
|
||||
NewEventRec<LOT_EVENT_LOT_EVENT_TYPE$> = EventType
|
||||
NewEventRec<LOT_EVENT_EVENT_DATETIME$> = EventDatetime
|
||||
NewEventRec<LOT_EVENT_EVENT_NOTE$> = EventNote
|
||||
NewEventRec<LOT_EVENT_EQUIPMENT_ID$> = EventEquipmentId
|
||||
NewEventRec<LOT_EVENT_EVENT_REDUCE_WAFER_QTY$> = ReduceWaferQty
|
||||
NewEventRec<LOT_EVENT_EVENT_BONUS_WAFER_QTY$> = BonusWaferQty
|
||||
NewEventRec<LOT_EVENT_EVENT_BEGIN_WAFER_QTY$> = BeginWaferQty
|
||||
NewEventRec<LOT_EVENT_EVENT_END_WAFER_QTY$> = EndWaferQty
|
||||
NewEventRec<LOT_EVENT_EVENT_OPERATION_ID$> = OperationId
|
||||
NewEventRec<LOT_EVENT_EVENT_OPERATOR_ID$> = OperatorId
|
||||
NewEventSequence = Lot_Services('GetLotEventNextSequence', LotId)
|
||||
NewEventRec<LOT_EVENT_SEQUENCE$> = NewEventSequence
|
||||
|
||||
Database_Services('WriteDataRow', 'LOT_EVENT', NewEventId, NewEventRec)
|
||||
if Error_Services('HasError') then
|
||||
ErrorMessage = 'Error in Create Lot Event routine, Error writing Lot Event record, ' : Error_Services('GetMessage')
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Create Lot Event routine, Lot Id passed to routine was not found in LOT table.'
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Create Lot Event routine, Missing event type or Operator ID.'
|
||||
end
|
||||
|
||||
Case LotType EQ 'WM_OUT'
|
||||
ErrorMessage = 'Error in Create Lot Event routine, Lot type WM_OUT was passed to routine and this is currently not supported.'
|
||||
Case LotType EQ 'WM_IN'
|
||||
@ -799,3 +987,4 @@ end service
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user