Modified UpdateQAMet service to support reactor scheduled metrology tests

This commit is contained in:
Infineon\StieberD
2025-09-25 15:33:11 -07:00
committed by Stieber Daniel (CSC FI SPS MESLEO)
parent f07e4476a7
commit 245f832445
4 changed files with 422 additions and 366 deletions

View File

@ -57,6 +57,8 @@ $Insert PRS_LAYER_EQUATES
$Insert PRS_STAGE_EQUATES
$Insert PROD_VER_EQUATES
$Insert QA_MET_EQUATES ;* Used in GetQAMet data structure return variable
$Insert RDS_EQUATES
$Insert WO_REACT_EQUATES
Declare function Database_Services, SRP_JSON, Error_Services, obj_Prod_Spec, Wo_Mat_Qa_Services
Declare subroutine Database_Services, SRP_JSON, Error_Services
@ -192,130 +194,168 @@ End Service
Service UpdateQAMet(WOMatKey)
WOMatQARec = ''
ErrorMsg = ''
If (WOMatKey NE '') then
WONo = Field(WOMatKey, '*', 1)
CassNo = Field(WOMatKey, '*', 2)
* * * * * * * * Build QA_MET profile - Work Order scheduled only * * * * * * * *
WOStepKeys = XLATE('WO_LOG', WONo, WO_LOG_WO_STEP_KEY$, 'X')
StepCnt = DCount(WOStepKeys,@VM)
EpiProPSNo = ''
EpiProPSRec = ''
MetLine = 1
// Get original WO_MAT_QA record to copy any test results
OrigWOMatQARec = Database_Services('ReadDataRow', 'WO_MAT_QA', WOMatKey)
OrigQAStages = OrigWOMatQARec<WO_MAT_QA_STAGE$>
OrigQAProfiles = OrigWOMatQARec<WO_MAT_QA_PROFILE$>
OrigQASlots = OrigWOMatQARec<WO_MAT_QA_SLOT$>
OrigQASlotTests = OrigWOMatQARec<WO_MAT_QA_SLOT_TEST$>
OrigQAResults = OrigWOMatQARec<WO_MAT_QA_RESULT$>
OrigQASigs = OrigWOMatQARec<WO_MAT_QA_SIG$>
OrigQASigDtms = OrigWOMatQARec<WO_MAT_QA_SIG_DTM$>
OrigQAStdResults = OrigWOMatQARec<WO_MAT_QA_STD_RESULT$>
OrigQADataPoints = OrigWOMatQARec<WO_MAT_QA_DATA_POINTS$>
OrigQAMinResults = OrigWOMatQARec<WO_MAT_QA_MIN_RESULT$>
OrigQAMaxResults = OrigWOMatQARec<WO_MAT_QA_MAX_RESULT$>
OrigQARangeResults = OrigWOMatQARec<WO_MAT_QA_RANGE_PCT_RESULT$>
OrigQAEdgeResults = OrigWOMatQARec<WO_MAT_QA_EDGE_MEAN_RESULT$>
OrigQA5mmResults = OrigWOMatQARec<WO_MAT_QA_5MM_PCT_RESULT$>
OrigQAOutOfSpecs = OrigWOMatQARec<WO_MAT_QA_OUT_OF_SPEC$>
OrigQAFailReasons = OrigWOMatQARec<WO_MAT_QA_FAIL_REASON$>
* WO_MAT record is used to check for pre-existing signatures jch 6/7/2015
WOMatRec = Database_Services('ReadDataRow', 'WO_MAT', WOMatKey)
FOR WOStepNo = 1 TO StepCnt
PSNo = XLATE('WO_STEP', WOStepKeys<1,WOStepNo>, WO_STEP_PROD_SPEC_ID$, 'X')
PSRec = Database_Services('ReadDataRow', 'PROD_SPEC', PSNo)
QAMetData = obj_Prod_Spec('GetQAMet',PSNo:@RM:PSRec)
QAStages = QAMetData<COL$QA_MET_STAGE>
StageCnt = COUNT(QAStages,@VM) + (QAStages NE '')
FOR StageNo = 1 TO StageCnt
Stage = QAMetData<COL$QA_MET_STAGE,StageNo>
MetTest = QAMetData<COL$QA_MET_TEST,StageNo> ;* StageRec<PRS_STAGE_MET_TEST$>
Interval = QAMetData<COL$QA_MET_INTERVAL,StageNo> ;* StageRec<PRS_STAGE_MET_INTERVAL$,StageNo>
Start = QAMetData<COL$QA_MET_START,StageNo> ;* StageRec<PRS_STAGE_MET_START$,StageNo>
ReactSched = QAMetData<COL$QA_MET_REACT_SCHED,StageNo> ;* StageRec<PRS_STAGE_MET_REACT_SCHED$,StageNo>
TestFlag = 0
IF Interval NE '' AND Start NE '' THEN
IF Interval = Start THEN
IF REM(CassNo,Interval) = 0 THEN TestFlag = 1
END ELSE
IF ABS((Start + INT(CassNo/Interval)*Interval) - CassNo) = 0 THEN TestFlag = 1
END
IF TestFlag AND NOT(ReactSched) THEN
WOMatQARec<WO_MAT_QA_PROFILE$,MetLine> = WOStepNo:QAMetData<COL$QA_MET_TEST,StageNo> ;* StageRec<PRS_STAGE_MET_TEST$,N>
WOMatQARec<WO_MAT_QA_PROP$,MetLine> = QAMetData<COL$QA_MET_PROP,StageNo> ;* StageRec<PRS_STAGE_MET_PROP$,N>
WOMatQARec<WO_MAT_QA_TOOL_CLASS$,MetLine> = QAMetData<COL$QA_MET_TOOL_CLASS,StageNo> ;* StageRec<PRS_STAGE_MET_TOOL_CLASS$,N>
WOMatQARec<WO_MAT_QA_STAGE$,MetLine> = QAMetData<COL$QA_MET_STAGE,StageNo>
WOMatQARec<WO_MAT_QA_MIN$,MetLine> = QAMetData<COL$QA_MET_MIN,StageNo> ;* StageRec<PRS_STAGE_MET_MIN$,N>
WOMatQARec<WO_MAT_QA_MAX$,MetLine> = QAMetData<COL$QA_MET_MAX,StageNo> ;* StageRec<PRS_STAGE_MET_MAX$,N>
WOMatQARec<WO_MAT_QA_SLOT$,MetLine> = QAMetData<COL$QA_MET_SLOT,StageNo> ;* StageRec<PRS_STAGE_MET_SLOT$,N>
WOMatQARec<WO_MAT_QA_RECIPE$,MetLine> = QAMetData<COL$QA_MET_RECIPE,StageNo> ;* StageRec<PRS_STAGE_MET_RECIPE$,N>
WOMatQARec<WO_MAT_QA_RECIPE_PATTERN$,MetLine> = QAMetData<COL$QA_MET_RECIPE_PATTERN,StageNo> ;* StageRec<PRS_STAGE_MET_RECIPE_PATTERN$,StageNo>
WOMatQARec<WO_MAT_QA_WFR_QTY$,MetLine> = QAMetData<COL$QA_MET_WFR_QTY,StageNo> ;* StageRec<PRS_STAGE_MET_WFR_QTY$,StageNo>
WOMatQARec<WO_MAT_QA_WFR_TYPE$,MetLine> = QAMetData<COL$QA_MET_WFR_TYPE,StageNo> ;* StageRec<PRS_STAGE_MET_WFR_TYPE$,StageNo>
WOMatQARec<WO_MAT_QA_REACT_SCHED$,MetLine> = ReactSched ;* StageRec<PRS_STAGE_MET_REACT_SCHED$,StageNo>
WOMatQARec<WO_MAT_QA_SHIP_DOC$,MetLine> = QAMetData<COL$QA_MET_SHIP_DOC,StageNo> ;* StageRec<PRS_STAGE_MET_SHIP_DOC$,StageNo>
WOMatQARec<WO_MAT_QA_PHASE_MIN$,MetLine> = QAMetData<COL$QA_MET_PHASE_MIN,StageNo>
If OrigWOMatQARec NE '' then
CurrStage = QAMetData<COL$QA_MET_STAGE,StageNo>
CurrProfile = WOStepNo:QAMetData<COL$QA_MET_TEST,StageNo>
CurrSlot = QAMetData<COL$QA_MET_SLOT,StageNo>
// Copy any existing results from the original WO_MAT_QA record.
If OrigQAStages NE '' then
Found = False$
For each OrigQAStage in OrigQAStages using @VM setting sPos
OrigQAProfile = OrigQAProfiles<0, sPos>
OrigQASlot = OrigQASlots<0, sPos>
If ( (CurrStage EQ OrigQAStage) and (CurrProfile EQ OrigQAProfile) and (CurrSlot EQ OrigQASlot) ) then
Found = True$
WOMatQARec<WO_MAT_QA_SLOT_TEST$,MetLine> = OrigQASlotTests<0, sPos>
WOMatQARec<WO_MAT_QA_RESULT$,MetLine> = OrigQAResults<0, sPos>
WOMatQARec<WO_MAT_QA_SIG$,MetLine> = OrigQASigs<0, sPos>
WOMatQARec<WO_MAT_QA_SIG_DTM$,MetLine> = OrigQASigDtms<0, sPos>
WOMatQARec<WO_MAT_QA_STD_RESULT$,MetLine> = OrigQAStdResults<0, sPos>
WOMatQARec<WO_MAT_QA_DATA_POINTS$,MetLine> = OrigQADataPoints<0, sPos>
WOMatQARec<WO_MAT_QA_MIN_RESULT$,MetLine> = OrigQAMinResults<0, sPos>
WOMatQARec<WO_MAT_QA_MAX_RESULT$,MetLine> = OrigQAMaxResults<0, sPos>
WOMatQARec<WO_MAT_QA_RANGE_PCT_RESULT$,MetLine> = OrigQARangeResults<0, sPos>
WOMatQARec<WO_MAT_QA_EDGE_MEAN_RESULT$,MetLine> = OrigQAEdgeResults<0, sPos>
WOMatQARec<WO_MAT_QA_5MM_PCT_RESULT$,MetLine> = OrigQA5mmResults<0, sPos>
WOMatQARec<WO_MAT_QA_OUT_OF_SPEC$,MetLine> = OrigQAOutOfSpecs<0, sPos>
WOMatQARec<WO_MAT_QA_FAIL_REASON$,MetLine> = OrigQAFailReasons<0, sPos>
end
Until Found
Next OrigQAStage
end
end
MetLine += 1
END
END
NEXT StageNo
NEXT WOStepNo
Database_Services('WriteDataRow', 'WO_MAT_QA', WONo:'*':CassNo, WOMatQARec)
WONo = Field(WOMatKey, '*', 1)
CassNo = Field(WOMatKey, '*', 2)
RDSNo = Database_Services('ReadDataColumn', 'WO_MAT', WOMatKey, WO_MAT_RDS_NO$)
If Error_Services('NoError') then
If (RDSNo NE '') then
// Check if it has been assigned to a reactor
ReactNo = Database_Services('ReadDataColumn', 'RDS', RDSNo, RDS_REACTOR$)
If Error_Services('HasError') then
ErrorMsg = 'Error in ':Service:' service. Error message: ':Error_Services('GetMessage')
end
end else
// Either not signed into a reactor yet or this WO_MAT is EpiPro and therefore there is no
// 1-to-1 RDS record. Because of this, reactor scheduled QA met is not possible with EpiPro.
ReactNo = ''
end
If (ErrorMsg EQ '') then
WOStepKeys = Database_Services('ReadDataColumn', 'WO_LOG', WONo, WO_LOG_WO_STEP_KEY$)
If Error_Services('NoError') then
StepCnt = DCount(WOStepKeys,@VM)
MetLine = 1
// Get original WO_MAT_QA record to copy any test results
OrigWOMatQARec = Database_Services('ReadDataRow', 'WO_MAT_QA', WOMatKey)
OrigQAStages = OrigWOMatQARec<WO_MAT_QA_STAGE$>
OrigQAProfiles = OrigWOMatQARec<WO_MAT_QA_PROFILE$>
OrigQASlots = OrigWOMatQARec<WO_MAT_QA_SLOT$>
OrigQASlotTests = OrigWOMatQARec<WO_MAT_QA_SLOT_TEST$>
OrigQAResults = OrigWOMatQARec<WO_MAT_QA_RESULT$>
OrigQASigs = OrigWOMatQARec<WO_MAT_QA_SIG$>
OrigQASigDtms = OrigWOMatQARec<WO_MAT_QA_SIG_DTM$>
OrigQAStdResults = OrigWOMatQARec<WO_MAT_QA_STD_RESULT$>
OrigQADataPoints = OrigWOMatQARec<WO_MAT_QA_DATA_POINTS$>
OrigQAMinResults = OrigWOMatQARec<WO_MAT_QA_MIN_RESULT$>
OrigQAMaxResults = OrigWOMatQARec<WO_MAT_QA_MAX_RESULT$>
OrigQARangeResults = OrigWOMatQARec<WO_MAT_QA_RANGE_PCT_RESULT$>
OrigQAEdgeResults = OrigWOMatQARec<WO_MAT_QA_EDGE_MEAN_RESULT$>
OrigQA5mmResults = OrigWOMatQARec<WO_MAT_QA_5MM_PCT_RESULT$>
OrigQAOutOfSpecs = OrigWOMatQARec<WO_MAT_QA_OUT_OF_SPEC$>
OrigQAFailReasons = OrigWOMatQARec<WO_MAT_QA_FAIL_REASON$>
FOR WOStepNo = 1 TO StepCnt
PSNo = Database_Services('ReadDataColumn', 'WO_STEP', WOStepKeys<1,WOStepNo>, WO_STEP_PROD_SPEC_ID$)
If Error_Services('NoError') then
PSRec = Database_Services('ReadDataRow', 'PROD_SPEC', PSNo)
If Error_Services('NoError') then
QAMetData = obj_Prod_Spec('GetQAMet',PSNo:@RM:PSRec:@RM:@RM:True$)
QAStages = QAMetData<COL$QA_MET_STAGE>
StageCnt = DCount(QAStages,@VM)
If (ReactNo NE '') then
WOReactKey = WONo:'*':WOStepNo:'*':ReactNo
end else
WOReactKey = ''
end
If (WOReactKey NE '') then
WOReactRDSNos = Database_Services('ReadDataColumn', 'WO_REACT', WOReactKey, WO_REACT_RDS_NO$)
If Error_Services('HasError') then
ErrorMsg = 'Error in ':Service:' service. Error message: ':Error_Services('GetMessage')
end
end
If (ErrorMsg EQ '') then
For StageNo = 1 to StageCnt
Stage = QAMetData<COL$QA_MET_STAGE,StageNo>
MetTest = QAMetData<COL$QA_MET_TEST,StageNo> ;* StageRec<PRS_STAGE_MET_TEST$>
Interval = QAMetData<COL$QA_MET_INTERVAL,StageNo> ;* StageRec<PRS_STAGE_MET_INTERVAL$,StageNo>
Start = QAMetData<COL$QA_MET_START,StageNo> ;* StageRec<PRS_STAGE_MET_START$,StageNo>
ReactSched = QAMetData<COL$QA_MET_REACT_SCHED,StageNo> ;* StageRec<PRS_STAGE_MET_REACT_SCHED$,StageNo>
TestFlag = False$
If ( (Interval NE '') and (Start NE '') ) then
// Add Work Order scheduled tests (i.e., not reactor scheduled tests)
If Not(ReactSched) then
If Interval = Start then
If ( Rem(CassNo, Interval) EQ 0 ) then TestFlag = True$
end else
If ( Abs( (Start + Int(CassNo / Interval)*Interval) - CassNo ) EQ 0) then TestFlag = True$
end
end else
Locate RDSNo in WOReactRDSNos using @VM setting TestSeq then
If ( Rem( (TestSeq - Start), Interval) EQ 0 ) then TestFlag = True$
end
end
If TestFlag then
WOMatQARec<WO_MAT_QA_PROFILE$,MetLine> = WOStepNo:MetTest
WOMatQARec<WO_MAT_QA_PROP$,MetLine> = QAMetData<COL$QA_MET_PROP,StageNo>
WOMatQARec<WO_MAT_QA_TOOL_CLASS$,MetLine> = QAMetData<COL$QA_MET_TOOL_CLASS,StageNo>
WOMatQARec<WO_MAT_QA_STAGE$,MetLine> = Stage
WOMatQARec<WO_MAT_QA_MIN$,MetLine> = QAMetData<COL$QA_MET_MIN,StageNo>
WOMatQARec<WO_MAT_QA_MAX$,MetLine> = QAMetData<COL$QA_MET_MAX,StageNo>
WOMatQARec<WO_MAT_QA_SLOT$,MetLine> = QAMetData<COL$QA_MET_SLOT,StageNo>
WOMatQARec<WO_MAT_QA_RECIPE$,MetLine> = QAMetData<COL$QA_MET_RECIPE,StageNo>
WOMatQARec<WO_MAT_QA_RECIPE_PATTERN$,MetLine> = QAMetData<COL$QA_MET_RECIPE_PATTERN,StageNo>
WOMatQARec<WO_MAT_QA_WFR_QTY$,MetLine> = QAMetData<COL$QA_MET_WFR_QTY,StageNo>
WOMatQARec<WO_MAT_QA_WFR_TYPE$,MetLine> = QAMetData<COL$QA_MET_WFR_TYPE,StageNo>
WOMatQARec<WO_MAT_QA_REACT_SCHED$,MetLine> = ReactSched
WOMatQARec<WO_MAT_QA_SHIP_DOC$,MetLine> = QAMetData<COL$QA_MET_SHIP_DOC,StageNo>
WOMatQARec<WO_MAT_QA_PHASE_MIN$,MetLine> = QAMetData<COL$QA_MET_PHASE_MIN,StageNo>
If OrigWOMatQARec NE '' then
CurrStage = QAMetData<COL$QA_MET_STAGE,StageNo>
CurrProfile = WOStepNo:MetTest
CurrSlot = QAMetData<COL$QA_MET_SLOT,StageNo>
// Copy any existing results from the original WO_MAT_QA record.
If OrigQAStages NE '' then
Found = False$
For each OrigQAStage in OrigQAStages using @VM setting sPos
OrigQAProfile = OrigQAProfiles<0, sPos>
OrigQASlot = OrigQASlots<0, sPos>
If ( (CurrStage EQ OrigQAStage) and (CurrProfile EQ OrigQAProfile) and (CurrSlot EQ OrigQASlot) ) then
Found = True$
WOMatQARec<WO_MAT_QA_SLOT_TEST$,MetLine> = OrigQASlotTests<0, sPos>
WOMatQARec<WO_MAT_QA_RESULT$,MetLine> = OrigQAResults<0, sPos>
WOMatQARec<WO_MAT_QA_SIG$,MetLine> = OrigQASigs<0, sPos>
WOMatQARec<WO_MAT_QA_SIG_DTM$,MetLine> = OrigQASigDtms<0, sPos>
WOMatQARec<WO_MAT_QA_STD_RESULT$,MetLine> = OrigQAStdResults<0, sPos>
WOMatQARec<WO_MAT_QA_DATA_POINTS$,MetLine> = OrigQADataPoints<0, sPos>
WOMatQARec<WO_MAT_QA_MIN_RESULT$,MetLine> = OrigQAMinResults<0, sPos>
WOMatQARec<WO_MAT_QA_MAX_RESULT$,MetLine> = OrigQAMaxResults<0, sPos>
WOMatQARec<WO_MAT_QA_RANGE_PCT_RESULT$,MetLine> = OrigQARangeResults<0, sPos>
WOMatQARec<WO_MAT_QA_EDGE_MEAN_RESULT$,MetLine> = OrigQAEdgeResults<0, sPos>
WOMatQARec<WO_MAT_QA_5MM_PCT_RESULT$,MetLine> = OrigQA5mmResults<0, sPos>
WOMatQARec<WO_MAT_QA_OUT_OF_SPEC$,MetLine> = OrigQAOutOfSpecs<0, sPos>
WOMatQARec<WO_MAT_QA_FAIL_REASON$,MetLine> = OrigQAFailReasons<0, sPos>
end
Until Found
Next OrigQAStage
end
end
MetLine += 1
end
end
Next StageNo
end
end else
ErrorMsg = 'Error in ':Service:' service. Error message: ':Error_Services('GetMessage')
end
end else
ErrorMsg = 'Error in ':Service:' service. Error message: ':Error_Services('GetMessage')
end
Until (ErrorMsg NE '')
Next WOStepNo
If (ErrorMsg EQ '') then
Database_Services('WriteDataRow', 'WO_MAT_QA', WONo:'*':CassNo, WOMatQARec)
If Error_Services('HasError') then ErrorMsg = 'Error in ':Service:' service. Error message: ':Error_Services('GetMessage')
end
end else
ErrorMsg = 'Error in ':Service:' service. Error message: ':Error_Services('GetMessage')
end
end
end else
ErrorMsg = 'Error in ':Service:' service. Error message: ':Error_Services('GetMessage')
end
end else
ErrorMsg = 'Error in ':Service:' service. Null WOMatKey passed in.'
end
If ErrorMsg NE '' then
If (ErrorMsg NE '') then
Error_Services('Add', ErrorMsg)
end else
Response = WOMatQARec
@ -469,7 +509,7 @@ end service
Service GetMUWaferQAComplete(WOMatKey)
ErrorMsg = ''
If WOMatKey NE '' then
@ -521,4 +561,3 @@ Service GetMUWaferQAComplete(WOMatKey)
end service