Initialized RunData variable to prevent VNAV on failure to parse/read json.

This commit is contained in:
Infineon\StieberD
2025-11-11 12:26:50 -07:00
committed by Stieber Daniel (CSC FI SSM MAI MESLEO)
parent 60e70b9958
commit 169fabdac6

View File

@ -205,24 +205,25 @@ end service
Service GetJsonFromProcessDataStandardFormat(Text)
json = '';
HeaderId = -1;
SubgroupId = -1;
FoundEndOfFile = False$;
SWAP '|' WITH @VM IN Text;
SWAP CRLF$ WITH @FM IN Text;
LineCount = DCOUNT(Text, @FM);
json = ''
HeaderId = -1
SubgroupId = -1
FoundEndOfFile = False$
SWAP '|' WITH @VM IN Text
SWAP CRLF$ WITH @FM IN Text
LineCount = DCOUNT(Text, @FM)
FOR LineLoopIndex = 1 TO LineCount
Line = Text<LineLoopIndex>;
Line = Text<LineLoopIndex>
IF FoundEndOfFile EQ True$ THEN
json = json:Line;
json = json:Line
END
IF Line EQ 'EOF' THEN
FoundEndOfFile = True$;
Line = Text<LineLoopIndex - 1>;
FoundEndOfFile = True$
Line = Text<LineLoopIndex - 1>
Convert Tab$ to @FM IN Line
SWAP '=' WITH @VM IN Line;
SWAP ';' WITH @FM IN Line;
SWAP '=' WITH @VM IN Line
SWAP ';' WITH @FM IN Line
IF Line<2, 1> EQ 'B_HeaderId' THEN
HeaderId = Line<2, 2>
END
@ -231,19 +232,21 @@ Service GetJsonFromProcessDataStandardFormat(Text)
END
END
NEXT LineLoopIndex
Response = json;
Response = json
end service
Service GetStratus(Handle)
Result = ''; // Service ImportStratusData(
Offset = 1
FieldPosition = 13
FieldPositionIncrement = 2
Result<1, 1> = SRP_JSON(Handle, 'GETVALUE', 'Count');
Result<1, 2> = SRP_JSON(Handle, 'GETVALUE', 'Sequence');
Result<1, 3> = SRP_JSON(Handle, 'GETVALUE', 'HeaderId');
Result<1, 4> = SRP_JSON(Handle, 'GETVALUE', 'SubgroupId');
Result<1, 1> = SRP_JSON(Handle, 'GETVALUE', 'Count')
Result<1, 2> = SRP_JSON(Handle, 'GETVALUE', 'Sequence')
Result<1, 3> = SRP_JSON(Handle, 'GETVALUE', 'HeaderId')
Result<1, 4> = SRP_JSON(Handle, 'GETVALUE', 'SubgroupId')
FOR RecordIndex = 1 TO Result<1, 1>
IF RecordIndex EQ 1 THEN
Result<2> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DateTime'); // Timestamp
@ -258,23 +261,25 @@ Service GetStratus(Handle)
Result<11> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Cassette'); // Cassette
Result<12> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].GradeMean'); // ThickAvg
END
ForOffset = (RecordIndex - 1) * FieldPositionIncrement;
ForOffset = (RecordIndex - 1) * FieldPositionIncrement
Result<FieldPosition + ForOffset> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Slot'); // Position
Result<FieldPosition + ForOffset + Offset> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Mean'); // DataPoint
NEXT RecordIndex
Response = Result;
Response = Result
end service
Service GetBioRad(Handle)
Result = ''; // Service ImportBioRadData(
Offset = 1
FieldPosition = 13
FieldPositionIncrement = 2
Result<1, 1> = SRP_JSON(Handle, 'GETVALUE', 'Count');
Result<1, 2> = SRP_JSON(Handle, 'GETVALUE', 'Sequence');
Result<1, 3> = SRP_JSON(Handle, 'GETVALUE', 'HeaderId');
Result<1, 4> = SRP_JSON(Handle, 'GETVALUE', 'SubgroupId');
Result<1, 1> = SRP_JSON(Handle, 'GETVALUE', 'Count')
Result<1, 2> = SRP_JSON(Handle, 'GETVALUE', 'Sequence')
Result<1, 3> = SRP_JSON(Handle, 'GETVALUE', 'HeaderId')
Result<1, 4> = SRP_JSON(Handle, 'GETVALUE', 'SubgroupId')
FOR RecordIndex = 1 TO Result<1, 1>
IF RecordIndex EQ 1 THEN
Result<2> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DateTime'); // TimeStamp
@ -291,19 +296,21 @@ Service GetBioRad(Handle)
Result<FieldPosition + ForOffset> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Position'); // Position
Result<FieldPosition + ForOffset + Offset> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Thickness'); // DataPoint
NEXT RecordIndex
Response = Result;
Response = Result
end service
Service GetCDE(Handle)
Result = ''; // Service ImportCDEData(
Offset = 3
FieldPosition = 23
FieldPositionIncrement = 5
Result<1, 1> = SRP_JSON(Handle, 'GETVALUE', 'Count');
Result<1, 2> = SRP_JSON(Handle, 'GETVALUE', 'Sequence');
Result<1, 3> = SRP_JSON(Handle, 'GETVALUE', 'HeaderId');
Result<1, 4> = SRP_JSON(Handle, 'GETVALUE', 'SubgroupId');
Result<1, 1> = SRP_JSON(Handle, 'GETVALUE', 'Count')
Result<1, 2> = SRP_JSON(Handle, 'GETVALUE', 'Sequence')
Result<1, 3> = SRP_JSON(Handle, 'GETVALUE', 'HeaderId')
Result<1, 4> = SRP_JSON(Handle, 'GETVALUE', 'SubgroupId')
FOR RecordIndex = 1 TO Result<1, 1>
IF RecordIndex EQ 1 THEN
Result<3> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Date'); // Timestamp
@ -314,25 +321,27 @@ Service GetCDE(Handle)
Result<9> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Layer'); // RunDataLayer
Result<10> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Zone'); // RunDataZo
END
ForOffset = (RecordIndex - 1) * FieldPositionIncrement;
ForOffset = (RecordIndex - 1) * FieldPositionIncrement
Result<FieldPosition + ForOffset> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].InferredPoint'); // Position
Result<FieldPosition + ForOffset + Offset> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Data'); // DataPoint
Result<FieldPosition + ForOffset + FieldPositionIncrement - 1> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].MeritGOF'); // N/A
NEXT RecordIndex
Response = Result;
Response = Result
end service
Service GetHgCV(Handle)
Result = ''; // Service ImportHgCVData(
Offset = 5
PhaseOffset = 7
FieldPosition = 53
FieldPositionIncrement = 9
Result<1, 1> = SRP_JSON(Handle, 'GETVALUE', 'Count');
Result<1, 2> = SRP_JSON(Handle, 'GETVALUE', 'Sequence');
Result<1, 3> = SRP_JSON(Handle, 'GETVALUE', 'HeaderId');
Result<1, 4> = SRP_JSON(Handle, 'GETVALUE', 'SubgroupId');
Result<1, 1> = SRP_JSON(Handle, 'GETVALUE', 'Count')
Result<1, 2> = SRP_JSON(Handle, 'GETVALUE', 'Sequence')
Result<1, 3> = SRP_JSON(Handle, 'GETVALUE', 'HeaderId')
Result<1, 4> = SRP_JSON(Handle, 'GETVALUE', 'SubgroupId')
FOR RecordIndex = 1 TO Result<1, 1>
IF RecordIndex EQ 1 THEN
Result<2> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].MesEntity'); // ToolID
@ -343,22 +352,24 @@ Service GetHgCV(Handle)
Result<11> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Date'); // Timestamp
Result<IMPORT_VALIDATION_IDX$> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].IndexOf'); // Validation
END
ForOffset = (RecordIndex - 1) * FieldPositionIncrement;
ForOffset = (RecordIndex - 1) * FieldPositionIncrement
Result<FieldPosition + ForOffset> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Site'); // Position
Result<FieldPosition + ForOffset + Offset> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].RhoAvg'); // HgCVDataPoint
Result<FieldPosition + ForOffset + PhaseOffset> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Phase'); // PhaseDataPoint
Result<FieldPosition + ForOffset + FieldPositionIncrement - 1> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Grade'); // N/A
NEXT RecordIndex
Response = Result;
Response = Result
end service
Service GetTencor(Handle)
Result = ''; // Service ImportTencorData(
Result<1, 1> = SRP_JSON(Handle, 'GETVALUE', 'Count');
Result<1, 2> = SRP_JSON(Handle, 'GETVALUE', 'Sequence');
Result<1, 3> = SRP_JSON(Handle, 'GETVALUE', 'HeaderId');
Result<1, 4> = SRP_JSON(Handle, 'GETVALUE', 'SubgroupId');
Result<1, 1> = SRP_JSON(Handle, 'GETVALUE', 'Count')
Result<1, 2> = SRP_JSON(Handle, 'GETVALUE', 'Sequence')
Result<1, 3> = SRP_JSON(Handle, 'GETVALUE', 'HeaderId')
Result<1, 4> = SRP_JSON(Handle, 'GETVALUE', 'SubgroupId')
FOR RecordIndex = 1 TO Result<1, 1>
IF RecordIndex EQ 1 THEN
Result<9> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Date'); // Timestamp
@ -371,16 +382,18 @@ Service GetTencor(Handle)
Result<43> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].MesEntity'); // ScanTool
END
NEXT RecordIndex
Response = Result;
Response = Result
end service
Service GetSP1(Handle)
Result = ''; // Service ImportSP1Data(
Result<5, 1> = SRP_JSON(Handle, 'GETVALUE', 'Count');
Result<5, 2> = SRP_JSON(Handle, 'GETVALUE', 'Sequence');
Result<5, 3> = SRP_JSON(Handle, 'GETVALUE', 'HeaderId');
Result<5, 4> = SRP_JSON(Handle, 'GETVALUE', 'SubgroupId');
Result<5, 1> = SRP_JSON(Handle, 'GETVALUE', 'Count')
Result<5, 2> = SRP_JSON(Handle, 'GETVALUE', 'Sequence')
Result<5, 3> = SRP_JSON(Handle, 'GETVALUE', 'HeaderId')
Result<5, 4> = SRP_JSON(Handle, 'GETVALUE', 'SubgroupId')
FOR RecordIndex = 1 TO Result<5, 1>
IF RecordIndex EQ 1 THEN
Result<9> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Date'); // Timestamp
@ -397,7 +410,8 @@ Service GetSP1(Handle)
Result<44> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnAreaMean'); // DCNMM2
END
NEXT RecordIndex
Response = Result;
Response = Result
end service
@ -439,7 +453,7 @@ Service ImportMetrologyFiles(Machine=MACHINE_TYPES)
End Case
If Error_Services('NoError') and ErrMsg EQ '' then
SearchPattern = '*.pdsf';
SearchPattern = '*.pdsf'
InitDir DataPath:SearchPattern
FileList = DirList()
FileNames = ''
@ -516,16 +530,16 @@ Service ImportMetrologyFiles(Machine=MACHINE_TYPES)
RepoPath = Environment_Services('GetApplicationRootPath') : '\Metrology\Run Data Repository\MET08ANLYSDIFAAST230\Source\MET08ANLYSDIFAAST230\'
End Case
OSREAD Text FROM DataPath:FileName THEN
json = Metrology_Services('GetJsonFromProcessDataStandardFormat', Text);
END ELSE
json = '';
END
IF LEN(json) GT 0 THEN
RunData = Metrology_Services('GetRunData', Machine, json);
END ELSE
Metrology_Services('LogResults', PSN, Machine, 'UID002', Service : ' : ' : 'Failed to get PDSF json');
END
json = ''
RunData = ''
OSRead Text from DataPath:FileName then json = Metrology_Services('GetJsonFromProcessDataStandardFormat', Text)
If Len(json) GT 0 then
RunData = Metrology_Services('GetRunData', Machine, json)
end else
Metrology_Services('LogResults', PSN, Machine, 'UID002', Service : ' : ' : 'Failed to get PDSF json')
end
*************************
* Import metrology data *
@ -536,7 +550,7 @@ Service ImportMetrologyFiles(Machine=MACHINE_TYPES)
Metrology_Services('ImportMetrologyRunData', Machine, DataPath, FileName, RunData)
end else
ErrMsg = 'Import validation failed'
Metrology_Services('LogResults', PSN, Machine, 'UID002', Service : ' : ' : ErrMsg);
Metrology_Services('LogResults', PSN, Machine, 'UID002', Service : ' : ' : ErrMsg)
end
END ELSE
ErrMsg = 'RunData argument was missing'
@ -602,38 +616,38 @@ end service
Service GetRunData(Machine, json)
Result = '';
Handle = '';
Result = ''
Handle = ''
If Assigned(Handle) else Handle = 0
If Handle LE 0 then
ParseError = SRP_JSON(Handle, 'PARSE', json);
ParseError = SRP_JSON(Handle, 'PARSE', json)
IF ParseError EQ '' THEN
Begin Case
Case Machine _EQC 'Stratus'
Result = Metrology_Services('GetStratus', Handle);
Result = Metrology_Services('GetStratus', Handle)
Case Machine _EQC 'Biorad'
Result = Metrology_Services('GetBiorad', Handle);
Result = Metrology_Services('GetBiorad', Handle)
Case Machine _EQC 'CDE'
Result = Metrology_Services('GetCDE', Handle);
Result = Metrology_Services('GetCDE', Handle)
Case Machine _EQC 'HgCV'
Result = Metrology_Services('GetHgCV', Handle);
Result = Metrology_Services('GetHgCV', Handle)
Case Machine _EQC 'SP1'
Result = Metrology_Services('GetSP1', Handle);
Result = Metrology_Services('GetSP1', Handle)
Case Machine _EQC 'Tencor'
Result = Metrology_Services('GetTencor', Handle);
Result = Metrology_Services('GetTencor', Handle)
End Case
SRP_JSON(Handle, 'RELEASE');
SRP_JSON(Handle, 'RELEASE')
END ELSE
Metrology_Services('LogResults', PSN, Machine, 'UID002', Service : ' : ' : 'Failed to parse PDSF json');
Metrology_Services('LogResults', PSN, Machine, 'UID002', Service : ' : ' : 'Failed to parse PDSF json')
END
END
Response = Result;
Response = Result
end service
@ -2330,7 +2344,7 @@ Service ImportTencorData(RunData)
Next Wafer
end
If exists EQ False$ then
oCIParms := CleanInspRec ;
oCIParms := CleanInspRec
CINo = obj_Clean_Insp('Create',oCIParms)
If Error_Services('NoError') then
ReactRunRec = INSERT(ReactRunRec,REACT_RUN_CI_NO$,-1,0,CINo)
@ -3666,4 +3680,3 @@ LoadRunDataToDatabase:
return