Various bug fixes with scanner, form validation within the adjust lot qty form, and added scroll bars on the view lot form

This commit is contained in:
Infineon\Ouellette 2025-02-11 15:25:57 -07:00
parent 76915aff9a
commit 5e00026748
7 changed files with 320 additions and 195 deletions

View File

@ -1372,9 +1372,39 @@
"<8,18,1,14>": "", "<8,18,1,14>": "",
"<8,18,1,15>": "COMMEVT", "<8,18,1,15>": "COMMEVT",
"<8,18,1,16>": "0" "<8,18,1,16>": "0"
},
"<8,18,2>": {
"<8,18,2,1>": "X",
"<8,18,2,2>": "EXECUTE",
"<8,18,2,3>": "@WINDOW_EVENTS",
"<8,18,2,4>": {
"<8,18,2,4,1>": "@SELF",
"<8,18,2,4,2>": "@EVENT",
"<8,18,2,4,3>": "@PARAM1",
"<8,18,2,4,4>": "@PARAM2",
"<8,18,2,4,5>": "@PARAM3",
"<8,18,2,4,6>": "@PARAM4",
"<8,18,2,4,7>": "@PARAM5",
"<8,18,2,4,8>": "@PARAM6"
},
"<8,18,2,5>": "",
"<8,18,2,6>": "",
"<8,18,2,7>": "",
"<8,18,2,8>": "",
"<8,18,2,9>": "",
"<8,18,2,10>": "",
"<8,18,2,11>": "",
"<8,18,2,12>": "",
"<8,18,2,13>": "",
"<8,18,2,14>": "",
"<8,18,2,15>": "COMMEVT",
"<8,18,2,16>": "0"
} }
}, },
"<8,19>": "CHANGED", "<8,19>": {
"<8,19,1>": "CHANGED",
"<8,19,2>": "LOSTFOCUS"
},
"<8,20>": "", "<8,20>": "",
"<8,21>": "", "<8,21>": "",
"<8,22>": "", "<8,22>": "",

View File

@ -3859,7 +3859,8 @@
"<1,52,16>": "", "<1,52,16>": "",
"<1,52,17>": "", "<1,52,17>": "",
"<1,52,18>": "", "<1,52,18>": "",
"<1,52,19>": "" "<1,52,19>": "",
"<1,52,20>": ""
}, },
"<1,53>": { "<1,53>": {
"<1,53,1>": "ITEM", "<1,53,1>": "ITEM",
@ -9173,7 +9174,7 @@
"<2,2,39,2>": "EXECUTE", "<2,2,39,2>": "EXECUTE",
"<2,2,39,3>": "LSL2*OIWINEXE**NDW_ADJUST_LOT_QTY", "<2,2,39,3>": "LSL2*OIWINEXE**NDW_ADJUST_LOT_QTY",
"<2,2,39,4>": { "<2,2,39,4>": {
"<2,2,39,4,1>": "CreateParam", "<2,2,39,4,1>": "",
"<2,2,39,4,2>": "@WINDOW" "<2,2,39,4,2>": "@WINDOW"
}, },
"<2,2,39,5>": "", "<2,2,39,5>": "",

View File

@ -522,7 +522,7 @@
}, },
"<3,11>": { "<3,11>": {
"<3,11,1>": "0x60000", "<3,11,1>": "0x60000",
"<3,11,2>": "0x80000000" "<3,11,2>": "0x80000002"
}, },
"<3,12>": "8", "<3,12>": "8",
"<3,13>": { "<3,13>": {
@ -1221,7 +1221,7 @@
}, },
"<4,11>": { "<4,11>": {
"<4,11,1>": "0x60000", "<4,11,1>": "0x60000",
"<4,11,2>": "0x80000000" "<4,11,2>": "0x80000002"
}, },
"<4,12>": "7", "<4,12>": "7",
"<4,13>": { "<4,13>": {

View File

@ -42,6 +42,7 @@ Event WINDOW.CREATE(CreateParam)
Set_Property(@Window : '.PUB_SEARCH_LOT', 'VISIBLE', True$) Set_Property(@Window : '.PUB_SEARCH_LOT', 'VISIBLE', True$)
end end
end else end else
msg(@Window, 'Only Lead, Supervisors, or engineering may adjust lot quantities')
Result = '' Result = ''
Result<1> = False$ Result<1> = False$
End_Dialog(@Window, Result) End_Dialog(@Window, Result)
@ -58,27 +59,44 @@ end event
Event EDL_NEW_LOT_WFR_QTY.CHANGED(NewLotQty) Event EDL_NEW_LOT_WFR_QTY.CHANGED(NewLotQty)
NewLotQty = Get_Property(@Window : '.EDL_NEW_LOT_WFR_QTY', 'TEXT') NewLotQty = Get_Property(@Window : '.EDL_NEW_LOT_WFR_QTY', 'TEXT')
If Num(NewLotQty) then If NewLotQty NE '' then
If NewLotQty LE 25 AND NewLotQty GE 0 then If Num(NewLotQty) then
Set_Property(@Window : '.PUB_SUBMIT', 'ENABLED', True$) If NewLotQty LE 25 AND NewLotQty GE 0 then
Set_Property(@Window : '.PUB_SUBMIT', 'ENABLED', True$)
end else
msg(@Window, 'New wafer quantity value must be a number between 0 and 25.')
Set_Property(@Window : '.EDL_NEW_LOT_WFR_QTY', 'TEXT', '')
end
end else end else
msg(@Window, 'New wafer quantity value must be a number between 0 and 25.') If NewLotQty NE '' then
end msg(@Window, 'New wafer quantity value must be a number between 0 and 25.')
end else end
If NewLotQty NE '' then end
msg(@Window, 'New wafer quantity value must be a number between 0 and 25.')
end
end end
end event end event
Event EDL_LOT_NO.CHANGED(LotNo) Event EDL_LOT_NO.CHANGED(LotNo)
LotIdString = Get_Property(@Window : '.EDL_LOT_NO', 'TEXT')
Begin Case LotNo = Get_Property(@Window : '.EDL_LOT_NO', 'TEXT')
Case LotIdString[1, 4] EQ '1TTW' If LotNo[1, 4] EQ '1T' then
Set_Property(@Window : '.EDL_LOT_NO', 'TEXT', LotIdString[3, 999]) LotNo = LotNo[3, 999]
Case LotIdString[1, 2] EQ '1T' Set_Property(@Window : '.EDL_LOT_NO', 'TEXT', LotNo)
Set_Property(@Window : '.EDL_LOT_NO', 'TEXT', LotIdString[3, 999]) end
End Case end event
Event EDL_LOT_NO.LOSTFOCUS(Flag, FocusID)
Set_Property(@Window : '.EDL_CURR_WFR_QTY', 'TEXT', '')
Set_Property(@Window : '.EDL_NEW_LOT_WFR_QTY', 'TEXT', '')
LotNo = Get_Property(@Window : '.EDL_LOT_NO', 'TEXT')
If LotNo[1, 4] EQ '1T' then
LotNo = LotNo[3, 999]
Set_Property(@Window : '.EDL_LOT_NO', 'TEXT', LotNo)
end
If RowExists('LOT', LotNo) then
GoSub GetLotCurrData
end
end event end event
Event PUB_SEARCH_LOT.CLICK() Event PUB_SEARCH_LOT.CLICK()
@ -95,26 +113,43 @@ Event PUB_SUBMIT.CLICK()
CurrWfrQty = Database_Services('ReadDataColumn', 'LOT', LotId, LOT_WAFER_QTY$, True$, 0, False$) CurrWfrQty = Database_Services('ReadDataColumn', 'LOT', LotId, LOT_WAFER_QTY$, True$, 0, False$)
AmountToDecrease = 0 AmountToDecrease = 0
AmountToIncrease = 0 AmountToIncrease = 0
If NewWfrQty NE CurrWfrQty then If RowExists('LOT', LotId) then
Begin Case If NewWfrQty NE '' then
Case NewWfrQty LT CurrWfrQty if Num(NewWfrQty) then
AmountToDecrease = CurrWfrQty - NewWfrQty If NewWfrQty NE CurrWfrQty then
Lot_Services('CreateLotEvent', LotId, LotType, Datetime(), 'REDUCE_WAFER_QTY', 'Adjust wafer count by ' : AmountToDecrease, '', AmountToDecrease, 0, '', @User4) MsgHead = 'Adjust lot wafer quantity'
Case NewWfrQty GT CurrWfrQty MsgText = 'Are you sure you wish to adjust lot ' : LotId : ' wafer quantity from ' : CurrWfrQty : ' to ' : NewWfrQty : '?'
AmountToIncrease = NewWfrQty - CurrWfrQty
Lot_Services('CreateLotEvent', LotId, LotType, Datetime(), 'BONUS_WAFER_QTY', 'Adjust wafer count by ' : AmountToIncrease, '', 0, AmountToIncrease, '', @User4) OK = Msg(@WINDOW,'','YESNO','',MsgHead:@FM:MsgText)
End Case If OK then
If Error_Services('NoError') then Begin Case
msg(@Window, 'Wafer quantity adjusted successfully!') Case NewWfrQty LT CurrWfrQty
Result = '' AmountToDecrease = CurrWfrQty - NewWfrQty
Result<1> = True$ Lot_Services('CreateLotEvent', LotId, LotType, Datetime(), 'REDUCE_WAFER_QTY', 'Adjust wafer count by ' : AmountToDecrease, '', AmountToDecrease, 0, '', @User4)
End_Dialog(@Window, Result) Case NewWfrQty GT CurrWfrQty
AmountToIncrease = NewWfrQty - CurrWfrQty
Lot_Services('CreateLotEvent', LotId, LotType, Datetime(), 'BONUS_WAFER_QTY', 'Adjust wafer count by ' : AmountToIncrease, '', 0, AmountToIncrease, '', @User4)
End Case
If Error_Services('NoError') then
msg(@Window, 'Wafer quantity adjusted successfully!')
Result = ''
Result<1> = True$
End_Dialog(@Window, Result)
end else
ErrorMessage = Error_Services('GetMessage')
msg(@Window, 'Error Adjusting wafer quantity, ' : ErrorMessage)
end
end
end
end else
msg(@Window, 'New wafer count must be a number between 0-25')
end
end else end else
ErrorMessage = Error_Services('GetMessage') msg(@Window, 'New wafer count cannot be blank and must be a number between 0-25')
msg(@Window, 'Error Adjusting wafer quantity, ' : ErrorMessage)
end end
end else
msg(@Window, 'Lot # ' : LotId : ' not found!')
end end
end event end event
Event PUB_CANCEL.CLICK() Event PUB_CANCEL.CLICK()
@ -139,3 +174,4 @@ GetLotCurrData:
return return

View File

@ -23,7 +23,6 @@ Return EventFlow or 1
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
Event WINDOW.CREATE(CreateParam) Event WINDOW.CREATE(CreateParam)
PlaceDialog(-2, -2) PlaceDialog(-2, -2)
Set_Property(@Window, 'VISIBLE', 1) Set_Property(@Window, 'VISIBLE', 1)
NewTWSystemActive = XLATE('APP_INFO', 'NEW_TW_SYSTEM_ACTIVE_SWITCH', 1, 'X') NewTWSystemActive = XLATE('APP_INFO', 'NEW_TW_SYSTEM_ACTIVE_SWITCH', 1, 'X')
@ -237,13 +236,15 @@ Event PUB_SUBMIT.CLICK()
If Quantity NE '' AND TWLot NE '' then If Quantity NE '' AND TWLot NE '' then
if Num(Quantity) then if Num(Quantity) then
Begin Case Begin Case
Case Quantity GT 0 AND Quantity LT 25 Case Quantity GT 0 AND Quantity LE 25
TWLots<1, -1> = TWRow<1,1> TWLots<1, -1> = TWRow<1,1>
TWLotQtys<1, -1> = TWRow<1,3> TWLotQtys<1, -1> = TWRow<1,3>
Case Quantity GT 25 Case Quantity GT 25
NotReadyReason := 'Quantity value for test wafer lot ' : TWLot : ' must be less than 25.' : CRLF$ NotReadyReason := 'Quantity value for test wafer lot ' : TWLot : ' must be less than 25.' : CRLF$
Case Quantity LE 0 Case Quantity LE 0
NotReadyReason := 'Quantity value for test wafer lot ' : TWLot : ' must be greater than 0.' : CRLF$ NotReadyReason := 'Quantity value for test wafer lot ' : TWLot : ' must be greater than 0.' : CRLF$
Case Otherwise$
NotReadyReason := 'Quantity value for test wafer lot ' : TWLot : ' is invalid.' : CRLF$
End Case End Case
end else end else
NotReadyReason := 'Quantity value for test wafer lot ' : TWLot : ' must be a number' : CRLF$ NotReadyReason := 'Quantity value for test wafer lot ' : TWLot : ' must be a number' : CRLF$
@ -251,7 +252,6 @@ Event PUB_SUBMIT.CLICK()
end else end else
NotReadyReason := 'A quantity of test wafers used is required for test wafer lot ' : TWLot : CRLF$ NotReadyReason := 'A quantity of test wafers used is required for test wafer lot ' : TWLot : CRLF$
end end
Next TWRow Next TWRow
If NotReadyReason EQ '' then If NotReadyReason EQ '' then
TRWaferKey = Test_Run_Services('CreateTestRunRecord', SelRunTypeID, SelEquipType, EquipmentID, RelatedPSN, RelatedRDS, @User4, TWLots, TWLotQtys) TRWaferKey = Test_Run_Services('CreateTestRunRecord', SelRunTypeID, SelEquipType, EquipmentID, RelatedPSN, RelatedRDS, @User4, TWLots, TWLotQtys)

View File

@ -526,12 +526,15 @@ Service ProcessScanData(ScanID, ScanJSON)
ScansRow<SCANS.SCAN_TYPE$> = 'TENCOR_LOAD' ScansRow<SCANS.SCAN_TYPE$> = 'TENCOR_LOAD'
ScansRow<SCANS.TOOL_ID$>= ScanData[3,99] ScansRow<SCANS.TOOL_ID$>= ScanData[3,99]
Case ScanData[1, 16] EQ 'TWQUANTITYUPDATE' Case ScanData[1, 16] EQ 'TWQUANTITYUPDATE'
TWLot = Field(ScanData, '|', 2) TWLot = Field(ScanData, '|', 2)
TWLotQuantity = Field(ScanData, '|', 3) TWLotQuantity = Field(ScanData, '|', 3)
ThisScanTWLots = ScansRow<SCANS.TW_LOT_ID$> ThisScanTWLots = ScansRow<SCANS.TW_LOT_ID$>
Locate TWLot in ThisScanTWLots using @VM setting twPOS then Locate TWLot in ThisScanTWLots using @VM setting twPOS then
ScansRow<SCANS.TW_LOT_QTY$, twPos> = TWLotQuantity ScansRow<SCANS.TW_LOT_QTY$, twPos> = TWLotQuantity
end end
Case ScanData[1, 17] EQ 'TESTRUNTYPEUPDATE' Case ScanData[1, 17] EQ 'TESTRUNTYPEUPDATE'
TestRunTypeId = Field(ScanData, '|', 2) TestRunTypeId = Field(ScanData, '|', 2)
ScansRow<SCANS.TEST_RUN_TYPE_ID$> = TestRunTypeId ScansRow<SCANS.TEST_RUN_TYPE_ID$> = TestRunTypeId
@ -648,17 +651,27 @@ Service ProcessScanData(ScanID, ScanJSON)
If ThisTestRunType NE '' then If ThisTestRunType NE '' then
for each TWLot in TestWaferLotData using @VM setting twPOS for each TWLot in TestWaferLotData using @VM setting twPOS
If ScansRow<SCANS.TW_LOT_QTY$, twPOS> NE '' OR ScansRow<SCANS.TW_LOT_QTY$, twPOS> GT 0 then If ScansRow<SCANS.TW_LOT_QTY$, twPOS> NE '' OR ScansRow<SCANS.TW_LOT_QTY$, twPOS> GT 0 then
TWLotCurrOperation = Lot_Services('GetLotCurrOperationName', TWLot) TWLotCurrQty = Database_Services('ReadDataColumn', 'LOT', TWLot, LOT_WAFER_QTY$, True$, 0, False$)
If TWLotCurrOperation NE 'TW_CREATE' AND TWLotCurrOperation NE 'TW_CLOSE' then ThisCurrUsageQty = ScansRow<SCANS.TW_LOT_QTY$, twPOS>
TWLotCurrOpen = Database_Services('ReadDataColumn', 'LOT', TWLot, LOT_OPEN$, True$, 0, False$) If TWLotCurrQty GT 0 then
If Not(TWLotCurrOpen) then If TWLotCurrQty GE ThisCurrUsageQty then
Abort = True$ TWLotCurrOperation = Lot_Services('GetLotCurrOperationName', TWLot)
Scan_Services('AddNotAcceptableReason', 'Lot ':TWLot:' is closed and cannot be used at this time.') If TWLotCurrOperation NE 'TW_CREATE' AND TWLotCurrOperation NE 'TW_CLOSE' then
TWLotCurrOpen = Database_Services('ReadDataColumn', 'LOT', TWLot, LOT_OPEN$, True$, 0, False$)
If Not(TWLotCurrOpen) then
Abort = True$
Scan_Services('AddNotAcceptableReason', 'Lot ':TWLot:' is closed and cannot be used at this time.')
end
end else
Abort = True$
Scan_Services('AddNotAcceptableReason', 'Lot ':TWLot:' is currently at ':TWLotCurrOperation:' and cannot be used at this time.')
end
end else
Scan_Services('AddNotAcceptableReason', 'Test wafer Lot ':TWLot:' does not have enough wafers. Please select ' : TWLotCurrQty : ' wafers or less.')
end end
end else end else
Abort = True$ Scan_Services('AddNotAcceptableReason', 'Test wafer Lot ':TWLot:' has no wafers and cannot be logged for usage.')
Scan_Services('AddNotAcceptableReason', 'Lot ':TWLot:' is currently at ':TWLotCurrOperation:' and cannot be used at this time.') end
end
end else end else
Abort = True$ Abort = True$
Scan_Services('AddNotAcceptableReason', 'Lot ':TWLot:' must have a quantity associated with it.') Scan_Services('AddNotAcceptableReason', 'Lot ':TWLot:' must have a quantity associated with it.')
@ -1114,19 +1127,28 @@ Service ProcessScanData(ScanID, ScanJSON)
Abort = False$ Abort = False$
for each TWLot in TestWaferLotData using @VM setting twPOS for each TWLot in TestWaferLotData using @VM setting twPOS
If ScansRow<SCANS.TW_LOT_QTY$, twPOS> NE '' OR ScansRow<SCANS.TW_LOT_QTY$, twPOS> GT 0 then If ScansRow<SCANS.TW_LOT_QTY$, twPOS> NE '' OR ScansRow<SCANS.TW_LOT_QTY$, twPOS> GT 0 then
TWLotCurrQty = Database_Services('ReadDataColumn', 'LOT', TWLot, LOT_WAFER_QTY$, True$, 0, False$)
TWLotCurrOperation = Lot_Services('GetLotCurrOperationName', TWLot) ThisCurrUsageQty = ScansRow<SCANS.TW_LOT_QTY$, twPOS>
If TWLotCurrOperation NE 'TW_CREATE' AND TWLotCurrOperation NE 'TW_CLOSE' then If TWLotCurrQty GT 0 then
TWLotCurrOpen = Database_Services('ReadDataColumn', 'LOT', TWLot, LOT_OPEN$, True$, 0, False$) If TWLotCurrQty GE ThisCurrUsageQty then
If Not(TWLotCurrOpen) then TWLotCurrOperation = Lot_Services('GetLotCurrOperationName', TWLot)
If TWLotCurrOperation NE 'TW_CREATE' AND TWLotCurrOperation NE 'TW_CLOSE' then
Abort = True$ TWLotCurrOpen = Database_Services('ReadDataColumn', 'LOT', TWLot, LOT_OPEN$, True$, 0, False$)
Scan_Services('AddNotAcceptableReason', 'Lot ':TWLot:' is closed and cannot be used at this time.') If Not(TWLotCurrOpen) then
Abort = True$
Scan_Services('AddNotAcceptableReason', 'Lot ':TWLot:' is closed and cannot be used at this time.')
end
end else
Abort = True$
Scan_Services('AddNotAcceptableReason', 'Lot ':TWLot:' is currently at ':TWLotCurrOperation:' and cannot be used at this time.')
end
end else
Scan_Services('AddNotAcceptableReason', 'Test wafer Lot ':TWLot:' does not have enough wafers. Please select ' : TWLotCurrQty : ' wafers or less.')
end end
end else end else
Abort = True$ Scan_Services('AddNotAcceptableReason', 'Test wafer Lot ':TWLot:' has no wafers and cannot be logged for usage.')
Scan_Services('AddNotAcceptableReason', 'Lot ':TWLot:' is currently at ':TWLotCurrOperation:' and cannot be used at this time.') end
end
end else end else
Abort = True$ Abort = True$
Scan_Services('AddNotAcceptableReason', 'Lot ':TWLot:' must have a quantity associated with it.') Scan_Services('AddNotAcceptableReason', 'Lot ':TWLot:' must have a quantity associated with it.')
@ -2319,3 +2341,4 @@ return

View File

@ -11,7 +11,7 @@ $Insert LOT_EQUATES
$Insert LOT_OPERATION_EQUATES $Insert LOT_OPERATION_EQUATES
Declare function Nextkey, Error_Services, Environment_Services, OConv, Logging_Services, SRP_Hashtable, Lot_Services Declare function Nextkey, Error_Services, Environment_Services, OConv, Logging_Services, SRP_Hashtable, Lot_Services
Declare function SRP_Datetime, Database_Services, Test_Run_Services, File_Services, Status, delete, Insert, Datetime, SRP_Json Declare function SRP_Datetime, Database_Services, Test_Run_Services, File_Services, Status, delete, Insert, Datetime, SRP_Json, MemberOf
Declare subroutine Database_Services, Btree.Extract, Error_Services, Logging_Services, Rlist, Test_Run_Services, Lot_Services, SRP_Json Declare subroutine Database_Services, Btree.Extract, Error_Services, Logging_Services, Rlist, Test_Run_Services, Lot_Services, SRP_Json
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\TEST_RUN_SERVICES\TestWaferProduct' LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\TEST_RUN_SERVICES\TestWaferProduct'
@ -318,147 +318,166 @@ Service GetTestWaferLots(ShowOnlyOpenLots)
end service end service
Service CreateTestRunRecord(RunTypeID, EqpType, EqpID, PSNo, RDSNo, UserID, TWLotIds, TWLotQtys) Service CreateTestRunRecord(RunTypeID, EqpType, EqpID, PSNo, RDSNo, UserID, TWLotIds, TWLotQtys)
TWRunKey = '' TWRunKey = ''
Response = '' Response = ''
ErrorMessage = '' ErrorMessage = ''
If RunTypeID NE '' AND EqpType NE '' AND EqpID NE '' AND UserID NE '' then //Pre-Checks.
RunDTM = SRP_Datetime('Now') If TWLotIds NE '' then
TWRunRec = '' for each TWLotId in TWLotIds using @VM setting twLotPos
TWRunRec<TEST_RUN_RUN_DTM$> = RunDTM ThisTWLotCurrQty = Database_Services('ReadDataColumn', 'LOT', TWLotId, LOT_WAFER_QTY$, True$, 0, False$)
TWRunRec<TEST_RUN_RUN_TYPE_ID$> = RunTypeID If ThisTWLotCurrQty then
TWRunRec<TEST_RUN_EQUIPMENT_ID$> = EqpID ThisTWLotUsageQty = TWLotQtys<1, twLotPos>
TWRunRec<TEST_RUN_EQUIPMENT_TYPE$> = EqpType If ThisTWLotCurrQty LT ThisTWLotUsageQty then
TWRunRec<TEST_RUN_PROD_SPEC_ID$> = PSNo ErrorMessage = 'Error in Create Test Run Record routine. Lot # ' : TWLotId : ' does not have enough wafers. Please choose ' : ThisTWLotCurrQty : ' wafers or less.'
TWRunRec<TEST_RUN_LSL_USER_ID$> = UserID
TWRunRec<TEST_RUN_RDS_ID$> = RDSNo
TWRunKey = nextkey('TEST_RUN')
Database_Services('WriteDataRow', 'TEST_RUN', TWRunKey, TWRunRec)
If Error_Services('NoError') then
If RowExists('TEST_RUN', TWRunKey) then
LogData = ''
LogData<1, 1> = LoggingDTM
LogData<1, 2> = UserID
LogData<1, 3> = 'Successfully created new TEST_RUN record with ID of ' : TWRunKey
Logging_Services('AppendLog', objLogTR, LogData, @FM, @VM)
//Now create the test wafer usages
Success = False$
If TWLotIds NE '' then
//Supports new logging methods.
for each TWLotId in TWLotIds using @VM setting twlPos
LotRec = Database_Services('ReadDataRow', 'LOT', TWLotId, True$, 0, False$)
IsThisLotOnHold = LotRec<LOT_HOLD$>
IsThisLotOpen = LotRec<LOT_OPEN$>
IsThisLotATWLot = LotRec<LOT_TYPE$> EQ 'TW'
ThisLotCurrQty = LotRec<LOT_WAFER_QTY$>
ThisLotPartId = LotRec<LOT_PROD_ID$>
//
ThisUsageQty = TWLotQtys<1, twlPos>
If IsThisLotOpen then
If Not(IsThisLotOnHold) then
If IsThisLotATWLot then
InAtTWInUse = False$
Loop
LotMovedIn = Lot_Services('IsLotMovedIn', TWLotId)
ThisLotCurrOperationId = Lot_Services('GetLotCurrOperationId', TWLotId)
ThisLotCurrOperation = Database_Services('ReadDataColumn', 'LOT_OPERATION', ThisLotCurrOperationId, LOT_OPERATION_OPERATION_ID$, True$, 0, False$)
Begin Case
Case ThisLotCurrOperation EQ 'TW_IN_USE'
If Not(LotMovedIn) then
Lot_Services('CreateLotEvent', TWLotId, 'TW', Datetime(), 'MOVE_IN', 'Move into TW_IN_USE', '', 0, 0, '', UserID)
If Error_Services('HasError') then
ErrorMessage = Error_Services('GetMessage')
end
end else
InAtTWInUse = True$
end
Case ThisLotCurrOperation EQ 'TW_READY_TO_USE'
If Not(LotMovedIn) then
Lot_Services('CreateLotEvent', TWLotId, 'TW', Datetime(), 'MOVE_IN', 'Move into TW_READY_TO_USE', '', 0, 0, '', UserID)
end else
Lot_Services('CreateLotEvent', TWLotId, 'TW', Datetime(), 'MOVE_OUT', 'Move out of TW_READY_TO_USE', '', 0, 0, '', UserID)
end
If Error_Services('HasError') then
ErrorMessage = Error_Services('GetMessage')
end
Case Otherwise$
ErrorMessage = 'Error: Lot ':TWLotId:' is currently at ' : ThisLotCurrOperation : '. It cannot be used at this time.'
End Case
Until ErrorMessage NE '' Or InAtTWInUse
Repeat
If InAtTWInUse then
if Num(ThisUsageQty) then
If ThisUsageQty GT 0 then
//Now check that the usage QTY can be consumed from the TW Lot
ThisLotCurrQty = Database_Services('ReadDataColumn', 'LOT', TWLotId, LOT_WAFER_QTY$, True$, 0, False$)
If ThisUsageQty LE ThisLotCurrQty then
Abort = false$
for i = 1 to ThisUsageQty
Test_Run_Services('CreateTestRunWaferRecord',TWRunKey, ThisLotPartId, RunTypeID, TWLotId, UserID)
If Error_Services('HasError') then
ErrorMessage = Error_Services('GetMessage')
end
until ErrorMessage NE ''
Next i
If ErrorMessage EQ '' then
Lot_Services('CreateLotEvent', TWLotId, 'TW', Datetime(), 'REDUCE_WAFER_QTY', ThisUsageQty : ' wafers consumed from lot.', EqpID, ThisUsageQty, 0, '', UserID)
end
end else
ErrorMessage = 'Error in Create Test Run Record routine, ' : TWLotId : ' does not have enough wafers.'
end
end
end else
ErrorMessage = 'Error in Create Test Run Record routine, Invalid qty for lot ' : TWLotId : ' passed to routine.'
end
end
end else
//Lot is not classified as a test wafer lot.
end
end else
//Lot is on hold
end
end else
//Lot is not open
end
until ErrorMessage NE ''
Next TWLotId
If ErrorMessage EQ '' then
//commit everything
end else
//commit nothing, there was an error.
end
end else
//Supports legacy TW logging
Response = TWRunKey
end end
end else end else
ErrorMessage = 'Error in Create Test Run Record routine, Generated Test Run Key did not exist in TEST Run table.' ErrorMessage = 'Error in Create Test Run Record routine. Lot # ' : TWLotId : ' has a zero wafer quantity.'
end end
Until ErrorMessage NE ''
Response = TWRunKey Next TWLotId
end else
ErrorMessage = Error_Services('GetMessage')
end
end else end else
If RunTypeID EQ '' then ErrorMessage = 'Error in Create Test Run Record routine. No test wafer lots entered.'
ErrorMessage := 'Run Type ID Missing. '
end
If EqpType EQ '' then
ErrorMessage := 'Equipment Type ID Missing. '
end
If EqpID EQ '' then
ErrorMessage := 'Equipment ID Missing. '
end
If UserID EQ '' then
ErrorMessage := 'User ID Missing. '
end
end end
If ErrorMessage EQ '' then
If RunTypeID NE '' AND EqpType NE '' AND EqpID NE '' AND UserID NE '' then
RunDTM = SRP_Datetime('Now')
TWRunRec = ''
TWRunRec<TEST_RUN_RUN_DTM$> = RunDTM
TWRunRec<TEST_RUN_RUN_TYPE_ID$> = RunTypeID
TWRunRec<TEST_RUN_EQUIPMENT_ID$> = EqpID
TWRunRec<TEST_RUN_EQUIPMENT_TYPE$> = EqpType
TWRunRec<TEST_RUN_PROD_SPEC_ID$> = PSNo
TWRunRec<TEST_RUN_LSL_USER_ID$> = UserID
TWRunRec<TEST_RUN_RDS_ID$> = RDSNo
TWRunKey = nextkey('TEST_RUN')
Database_Services('WriteDataRow', 'TEST_RUN', TWRunKey, TWRunRec)
If Error_Services('NoError') then
If RowExists('TEST_RUN', TWRunKey) then
LogData = ''
LogData<1, 1> = LoggingDTM
LogData<1, 2> = UserID
LogData<1, 3> = 'Successfully created new TEST_RUN record with ID of ' : TWRunKey
Logging_Services('AppendLog', objLogTR, LogData, @FM, @VM)
//Now create the test wafer usages
Success = False$
If TWLotIds NE '' then
//Supports new logging methods.
for each TWLotId in TWLotIds using @VM setting twlPos
LotRec = Database_Services('ReadDataRow', 'LOT', TWLotId, True$, 0, False$)
IsThisLotOnHold = LotRec<LOT_HOLD$>
IsThisLotOpen = LotRec<LOT_OPEN$>
IsThisLotATWLot = LotRec<LOT_TYPE$> EQ 'TW'
ThisLotCurrQty = LotRec<LOT_WAFER_QTY$>
ThisLotPartId = LotRec<LOT_PROD_ID$>
//
ThisUsageQty = TWLotQtys<1, twlPos>
If IsThisLotOpen then
If Not(IsThisLotOnHold) then
If IsThisLotATWLot then
InAtTWInUse = False$
Loop
LotMovedIn = Lot_Services('IsLotMovedIn', TWLotId)
ThisLotCurrOperationId = Lot_Services('GetLotCurrOperationId', TWLotId)
ThisLotCurrOperation = Database_Services('ReadDataColumn', 'LOT_OPERATION', ThisLotCurrOperationId, LOT_OPERATION_OPERATION_ID$, True$, 0, False$)
Begin Case
Case ThisLotCurrOperation EQ 'TW_IN_USE'
If Not(LotMovedIn) then
Lot_Services('CreateLotEvent', TWLotId, 'TW', Datetime(), 'MOVE_IN', 'Move into TW_IN_USE', '', 0, 0, '', UserID)
If Error_Services('HasError') then
ErrorMessage = Error_Services('GetMessage')
end
end else
InAtTWInUse = True$
end
Case ThisLotCurrOperation EQ 'TW_READY_TO_USE'
If Not(LotMovedIn) then
Lot_Services('CreateLotEvent', TWLotId, 'TW', Datetime(), 'MOVE_IN', 'Move into TW_READY_TO_USE', '', 0, 0, '', UserID)
end else
Lot_Services('CreateLotEvent', TWLotId, 'TW', Datetime(), 'MOVE_OUT', 'Move out of TW_READY_TO_USE', '', 0, 0, '', UserID)
end
If Error_Services('HasError') then
ErrorMessage = Error_Services('GetMessage')
end
Case Otherwise$
ErrorMessage = 'Error: Lot ':TWLotId:' is currently at ' : ThisLotCurrOperation : '. It cannot be used at this time.'
End Case
Until ErrorMessage NE '' Or InAtTWInUse
Repeat
If InAtTWInUse then
if Num(ThisUsageQty) then
If ThisUsageQty GT 0 then
//Now check that the usage QTY can be consumed from the TW Lot
ThisLotCurrQty = Database_Services('ReadDataColumn', 'LOT', TWLotId, LOT_WAFER_QTY$, True$, 0, False$)
If ThisUsageQty LE ThisLotCurrQty then
Abort = false$
for i = 1 to ThisUsageQty
Test_Run_Services('CreateTestRunWaferRecord',TWRunKey, ThisLotPartId, RunTypeID, TWLotId, UserID)
If Error_Services('HasError') then
ErrorMessage = Error_Services('GetMessage')
end
until ErrorMessage NE ''
Next i
If ErrorMessage EQ '' then
Lot_Services('CreateLotEvent', TWLotId, 'TW', Datetime(), 'REDUCE_WAFER_QTY', ThisUsageQty : ' wafers consumed from lot.', EqpID, ThisUsageQty, 0, '', UserID)
end
end else
ErrorMessage = 'Error in Create Test Run Record routine, ' : TWLotId : ' does not have enough wafers.'
end
end
end else
ErrorMessage = 'Error in Create Test Run Record routine, Invalid qty for lot ' : TWLotId : ' passed to routine.'
end
end
end else
//Lot is not classified as a test wafer lot.
end
end else
//Lot is on hold
end
end else
//Lot is not open
end
until ErrorMessage NE ''
Next TWLotId
If ErrorMessage EQ '' then
//commit everything
end else
//commit nothing, there was an error.
end
end else
//Supports legacy TW logging
Response = TWRunKey
end
end else
ErrorMessage = 'Error in Create Test Run Record routine, Generated Test Run Key did not exist in TEST Run table.'
end
Response = TWRunKey
end else
ErrorMessage = Error_Services('GetMessage')
end
end else
If RunTypeID EQ '' then
ErrorMessage := 'Run Type ID Missing. '
end
If EqpType EQ '' then
ErrorMessage := 'Equipment Type ID Missing. '
end
If EqpID EQ '' then
ErrorMessage := 'Equipment ID Missing. '
end
If UserID EQ '' then
ErrorMessage := 'User ID Missing. '
end
end
end
If ErrorMessage NE '' then If ErrorMessage NE '' then
LogData = '' LogData = ''
LogData<1, 1> = LoggingDTM LogData<1, 1> = LoggingDTM
@ -751,6 +770,22 @@ Service GenerateTWCSVReport(StartDTM, StopDTM, SavePath)
end service end service
Service IsNewTWSystemActive(UserId)
IsTWSystemActive = False$
If UserId EQ '' then
UserId = @USER4
end
TWTrackingSystemActive = Database_Services('ReadDataColumn', 'APP_INFO', 'NEW_TW_SYSTEM_ACTIVE_SWITCH', 1, True$, 0, False$)
If TWTrackingSystemActive EQ True$ then
IsTWSystemActive = True$
end else
If MemberOf(UserId, 'TW_TRACKING_TEST') then
IsTWSystemActive = True$
end
end
end service