Merged PR 21151: Return To Fab Operations and Processing

This commit is contained in:
Ouellette Jonathan (CSC FI SPS MESLEO)
2025-07-16 21:17:07 +02:00
parent b607432be4
commit aabd4c3a91
56 changed files with 8856 additions and 2508 deletions

View File

@ -34,6 +34,8 @@ $Insert RLIST_EQUATES
$Insert WAFER_COUNTER_EQUATES
$Insert TOOL_EQUATES
$Insert TOOL_LOG_EQUATES
$Insert LOT_OPERATION_EQUATES
$Insert LOT_EQUATES
Equ Tab$ to \09\
Equ CRLF$ to \0D0A\
@ -213,7 +215,7 @@ end service
Service GetWaferCounterJSON(WaferSize, ToolLocation, CassID)
If ( (WaferSize NE '') and (ToolLocation NE '') and (CassID NE '') ) then
URL = 'https://oi-metrology-viewer-prod.mes.infineon.com:4438/api/v1/WaferCounter/{waferSize}/last-quantity-and-slot-map/?area={area}&text={cassID}'
Swap '{waferSize}' with WaferSize in URL
@ -226,15 +228,15 @@ Service GetWaferCounterJSON(WaferSize, ToolLocation, CassID)
If Error_Services('NoError') then
StatusCode = Httpclient_Services('GetResponseStatusCode')
If StatusCode NE 200 then
Begin Case
Case Response EQ ''
ErrorMsg = 'Unexpected server error.'
Case Response EQ 'No files!'
ErrorMsg = 'No data. Please re-seat cassette and try again.'
Case Otherwise$
// Use message in response body to populate error services
ErrorMsg = Response
End Case
Begin Case
Case Response EQ ''
ErrorMsg = 'Unexpected server error.'
Case Response EQ 'No files!'
ErrorMsg = 'No data. Please re-seat cassette and try again.'
Case Otherwise$
// Use message in response body to populate error services
ErrorMsg = Response
End Case
Error_Services('Add', ErrorMsg)
end
end
@ -244,7 +246,7 @@ end service
Service AddScan(LotID, ScanQty, ScanDtm, ScanTool, ScanUser, ScanLocation, WaferMap)
KeyID = RTI_CreateGuid()
Record = ''
Record<WAFER_COUNTER.LOT_ID$> = LotID
@ -448,9 +450,9 @@ Service ProcessCass2DBarcode(BarcodeText)
end
If ErrorMessage EQ '' then
Response = CassId : @VM: ExpectedQty : @VM : CassType
Response = CassId : @VM: ExpectedQty : @VM : CassType
end else
Error_Services('Add', ErrorMessage)
Error_Services('Add', ErrorMessage)
end
end service
@ -464,16 +466,16 @@ end service
Service ProcessTool2DBarcode(BarcodeText, CassId, CassType, UserId)
ErrorMessage = ''
If BarcodeText NE '' then
DelimCnt = DCount(BarcodeText, '|')
If DelimCnt EQ 2 then
WaferSize = Field(BarcodeText, '|', 1)
Area = Field(BarcodeText, '|', 2)
If Environment_Services('IsProd') then
WcJson = Wafer_Counter_Services('GetWaferCounterJSON', WaferSize, Area, CassID)
WcJson = Wafer_Counter_Services('GetWaferCounterJSON', WaferSize, Area, CassID)
end else
WcJson = Wafer_Counter_Services('GetWaferCounterJSONTestData', WaferSize, Area, CassID)
WcJson = Wafer_Counter_Services('GetWaferCounterJSONTestData', WaferSize, Area, CassID)
end
If Error_Services('NoError') then
@ -504,13 +506,13 @@ Service ProcessTool2DBarcode(BarcodeText, CassId, CassType, UserId)
ErrorMessage = 'Invalid tool scan.'
end
end else
ErrorMessage = 'Scan data was null.'
ErrorMessage = 'Scan data was null.'
end
If ErrorMessage EQ '' then
Response = WaferCounterId
end else
Error_Services('Add', ErrorMessage)
Error_Services('Add', ErrorMessage)
end
end service
@ -521,15 +523,15 @@ end service
// Emulates GetWaferCounterJson service.
//----------------------------------------------------------------------------------------------------------------------
Service GetWaferCounterJSONTestData(WaferSize, ToolLocation, CassID)
If ( (WaferSize NE '') and (ToolLocation NE '') and (CassID NE '') ) then
Response = ''
objJson = ''
If SRP_JSON(objJson, 'New', 'Object') then
SRP_JSON(objJson, 'SetValue', 'dateTimeFormatted', Datetime(), 'String')
SRP_JSON(objJson, 'SetValue', 'equipmentId', 'WC8INCH1', 'String')
SRP_JSON(objJson, 'SetValue', 'total', 24, 'Number')
SRP_JSON(objJson, 'SetValue', 'slotMap', '1111111110111111111111111', 'String')
SRP_JSON(objJson, 'SetValue', 'total', 25, 'Number')
SRP_JSON(objJson, 'SetValue', 'slotMap', '1111111111111111111111111', 'String')
Response = SRP_Json(objJson, 'Stringify', 'Styled')
SRP_JSON(objJSON, 'Release')
end
@ -537,15 +539,15 @@ Service GetWaferCounterJSONTestData(WaferSize, ToolLocation, CassID)
If Error_Services('NoError') then
StatusCode = 200
If StatusCode NE 200 then
Begin Case
Case Response EQ ''
ErrorMsg = 'Unexpected server error.'
Case Response EQ 'No files!'
ErrorMsg = 'No data. Please re-seat cassette and try again.'
Case Otherwise$
// Use message in response body to populate error services
ErrorMsg = Response
End Case
Begin Case
Case Response EQ ''
ErrorMsg = 'Unexpected server error.'
Case Response EQ 'No files!'
ErrorMsg = 'No data. Please re-seat cassette and try again.'
Case Otherwise$
// Use message in response body to populate error services
ErrorMsg = Response
End Case
Error_Services('Add', ErrorMsg)
end
end
@ -553,6 +555,181 @@ Service GetWaferCounterJSONTestData(WaferSize, ToolLocation, CassID)
end service
Service ConvertWaferCounterRecToJson(WaferCounterId)
ErrorMessage = ''
If WaferCounterId NE '' then
WaferCounterRec = Database_Services('ReadDataRow', 'WAFER_COUNTER', WaferCounterId, True$, 0, False$)
If Error_Services('NoError') then
//Fields within wafer counter rec
CassId = WaferCounterRec<WAFER_COUNTER.LOT_ID$>
swap '.' with '*' in CassId
WaferCount = WaferCounterRec<WAFER_COUNTER.SCAN_QTY$>
ScanDtm = WaferCounterRec<WAFER_COUNTER.SCAN_DTM$>
ToolID = WaferCounterRec<WAFER_COUNTER.SCAN_TOOL$>
WaferMapData = WaferCounterRec<WAFER_COUNTER.SCAN_WAFER_MAP$>
swap 1 with 1:@FM in WaferMapData
swap 0 with 0:@FM in WaferMapData
ActualWaferArray = ''
for i = 25 to 1 step -1
Slot = i
WaferPresent = WaferMapData<i>
ActualWaferArray<-1, 1> = Slot : @VM : WaferPresent
Next i
//Fields calculated at runtime.
CassType = ''
WONo = ''
CassNo = ''
ExpectedQty = ''
Begin Case
Case RowExists('RDS', CassId)
CassType = 'RDS'
WONo = XLATE('RDS', CassId, 'WO', 'X')
CassNo = XLATE('RDS', CassId, 'CASS_NO', 'X')
ExpectedQty = Xlate('RDS', CassId, 'WFRS_OUT', 'X')
Case RowExists('WM_OUT', CassId) OR RowExists('WM_IN', CassId)
CassType = 'WM_OUT'
WONo = Field(CassId, '*', 1)
CassNo = Field(CassId, '*', 3)
ExpectedQty = Xlate('WM_OUT', CassId, 'WAFER_CNT', 'X')
End Case
WoMatKey = WONo : '*' : CassNo
ExpectedWaferData = Wo_Mat_Services('GetWaferMap', WoMatKey)
ExpectedWaferArray = ''
for i = 25 to 1 step -1
Slot = i
WaferPresent = ExpectedWaferData<1, i>
ExpectedWaferArray<-1, 1> = Slot : @VM : WaferPresent
Next i
//Constructing the JSON Object
objJson = ''
If SRP_Json(objJson, 'New', 'Object') then
SRP_Json(objJson, 'SetValue', 'WaferCounterId', WaferCounterId, 'String')
SRP_Json(objJson, 'SetValue', 'CassId', CassId, 'String')
SRP_Json(objJson, 'SetValue', 'CassType', CassType, 'String')
SRP_Json(objJson, 'SetValue', 'ExpectedQty', ExpectedQty, 'Number')
SRP_Json(objJson, 'SetValue', 'ScanDtm', OConv(ScanDtm, 'DT4/'), 'String')
SRP_Json(objJson, 'SetValue', 'ToolId', ToolId, 'String')
SRP_Json(objJson, 'SetValue', 'WaferCount', WaferCount, 'Number')
//Wafer Counter Slot Array
objWaferCounterSlotArray = ''
IF SRP_Json(objWaferCounterSlotArray, 'New', 'Array') then
For each Slot in ActualWaferArray using @FM
SlotNo = Slot<1, 1>
WaferPresent = Slot<1, 2>
//Create the individiual slot object
objSlot = ''
If SRP_Json(objSlot, 'New', 'Object') then
SRP_Json(objSlot, 'SetValue', 'SlotNo', SlotNo, 'Number')
SRP_Json(objSlot, 'SetValue', 'WaferPresent', WaferPresent, 'Boolean')
SRP_Json(objWaferCounterSlotArray, 'Add', objSlot)
SRP_Json(objSlot, 'Release')
end
Next Slot
SRP_Json(objJson, 'Set', 'WaferArray', objWaferCounterSlotArray)
SRP_Json(objWaferCounterSlotArray, 'Release')
end
//OpenInsight Expected Slot Array
objOISlotArray = ''
IF SRP_Json(objOISlotArray, 'New', 'Array') then
For each Slot in ExpectedWaferArray using @FM
SlotNo = Slot<1, 1>
WaferPresent = Slot<1, 2>
//Create the individiual slot object
objSlot = ''
If SRP_Json(objSlot, 'New', 'Object') then
SRP_Json(objSlot, 'SetValue', 'SlotNo', SlotNo, 'Number')
SRP_Json(objSlot, 'SetValue', 'WaferPresent', WaferPresent, 'Boolean')
SRP_Json(objOISlotArray, 'Add', objSlot)
SRP_Json(objSlot, 'Release')
end
Next slot
SRP_Json(objJson, 'Set', 'ExpectedWaferArray', objOISlotArray)
SRP_Json(objWaferCounterSlotArray, 'Release')
end
Response = SRP_Json(objJson, 'Stringify', 'Styled')
SRP_Json(objJson, 'Release')
end else
ErrorMessage = 'Error initializing JSON object'
end
end else
ErrorMessage = 'Error reading wafer counter record. ' : Error_Services('GetMessage')
end
end else
ErrorMessage = 'Wafer counter id was null.'
end
If ErrorMessage NE '' then
Error_Services('Add', ErrorMessage)
end
end service
Service AssociateWaferCounter(LotOperationId, WaferCounterId, UserId)
ErrorMessage = ''
If RowExists('LSL_USERS', UserId) then
If RowExists('LOT_OPERATION', LotOperationId) then
If RowExists('WAFER_COUNTER', WaferCounterId) then
WaferCounterRec = Database_Services('ReadDataRow', 'WAFER_COUNTER', WaferCounterId, True$, 0, False$)
If Error_Services('NoError') then
WaferCounterToolId = WaferCounterRec<WAFER_COUNTER.SCAN_TOOL$>
ThisLotOpRec = Database_Services('ReadDataRow', 'LOT_OPERATION', LotOperationId, True$, 0, False$)
If Error_Services('NoError') then
LotId = ThisLotOpRec<LOT_OPERATION_LOT_ID$>
If RowExists('LOT', LotId) then
ThisWaferCountCassId = WaferCounterRec<WAFER_COUNTER.LOT_ID$>
ThisLotId = ThisLotOpRec<LOT_OPERATION_LOT_ID$>
LegacyLotType = Xlate('LOT', ThisLotId, LOT_LEGACY_LOT_TYPE$, 'X')
LotIdToCompare = ''
If LegacyLotType NE '' then
LotIdToCompare = Xlate('LOT', ThisLotId, LOT_LEGACY_LOT_ID$, 'X')
end else
LotIdToCompare = ThisLotId
end
If ThisWaferCountCassId EQ LotIdToCompare then
ThisLotOpRec<LOT_OPERATION_WAFER_COUNTER_ID$> = WaferCounterId
Database_Services('WriteDataRow', 'LOT_OPERATION', LotOperationId, ThisLotOpRec)
If Error_Services('NoError') then
Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'LOG_WAFER_COUNT', 'Wafer Count logged.', WaferCounterToolId, UserId)
end
end else
ErrorMessage = 'Lot IDs do not match!'
end
end else
ErrorMessage = 'Lot not found.'
end
end else
ErrorMessage = Error_Services('GetMessage')
end
end else
ErrorMessage = Error_Services('GetMessage')
end
end else
ErrorMessage = 'Wafer counter record not found.'
end
end else
ErrorMessage = 'Lot Operation record not found.'
end
end else
ErrorMessage = 'User ID not found.'
end
If ErrorMessage NE '' then
Error_Services('Add', ErrorMessage)
end
end service
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Internal GoSubs
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -566,3 +743,5 @@ ClearCursors:
return