Function WO_WFR_Actions(Action, CalcColName, FSList, Handle, Name, FMC, Record, Status, OrigRecord, Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10) /*********************************************************************************************************************** This program is proprietary and is not to be used by or disclosed to others, nor is it to be copied without written permission from Infineon. Name : WO_WFR_Actions Description : Handles calculated columns and MFS calls for the current table. Notes : This function uses @ID, @RECORD, and @DICT to make sure {ColumnName} references work correctly. If called from outside of a calculated column these will need to be set and restored. Parameters : Action [in] -- Name of the action to be taken CalcColName [in] -- Name of the calculated column that needs to be processed. Normally this should only be populated when the CalcField action is being used. FSList [in] -- The list of MFSs and the BFS name for the current file or volume. This is an @SVM delimited array, with the current MFS name as the first value in the array, and the BFS name as the last value. Normally set by a calling MFS. Handle [in] -- The file handle of the file or media map being accessed. Note, this does contain the entire handle structure that the Basic+ Open statement would provide. Normally set by a calling MFS. Name [in] -- The name (key) of the record or file being accessed. Normally set by a calling MFS. FMC [in] -- Various functions. Normally set by a calling MFS. Record [in] -- The entire record (for record-oriented functions) or a newly-created handle (for "get handle" functions). Normally set by a calling MFS. Status [in/out] -- Indicator of the success or failure of an action. Normally set by the calling MFS but for some actions can be set by the action handler to indicate failure. OrigRecord [in] -- Original content of the record being processed by the current action. This is automatically being assigned by the WRITE_RECORD and DELETE_RECORD actions within BASE_MFS. Param1-10 [in/out] -- Additional request parameter holders ActionFlow [out] -- Used to control the action chain (see the ACTION_SETUP insert for more information.) Can also be used to return a special value, such as the results of the CalcField method. History : (Date, Initials, Notes) 08/21/19 djs Original programmer. ***********************************************************************************************************************/ #pragma precomp SRP_PreCompiler $Insert FILE.SYSTEM.EQUATES $Insert ACTION_SETUP $Insert RDS_EQUATES $Insert CLEAN_INSP_EQUATES $Insert COMPANY_EQUATES $Insert RDS_LAYER_EQUATES $Insert TOOL_PARMS_EQUATES $Insert RLIST_EQUATES $Insert APP_INSERTS $Insert RETAINED_WAFERS_EQUATES $Insert WO_WFR_EQUATES Equ COMMA$ to ',' Declare function Error_Services, Database_Services, obj_RDS_Test, Logging_Services, Environment_Services Declare function Tool_Parms_Services Declare subroutine Error_Services, Database_Services, Logging_Services, Set_Status If KeyID then GoSub Initialize_System_Variables LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\GaNWIP' LogDate = Oconv(Date(), 'D4/') LogTime = Oconv(Time(), 'MTS') LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' PocketLog.csv' Headers = 'Logging DTM' : @FM : 'WfrID' : @FM : 'Notes' objLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, Comma$, Headers, '', False$, False$) LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM Begin Case Case Action _EQC 'CalculateColumn' ; GoSub CalculateColumn Case Action _EQC 'READ_RECORD_PRE' ; GoSub READ_RECORD_PRE Case Action _EQC 'READ_RECORD' ; GoSub READ_RECORD Case Action _EQC 'READONLY_RECORD_PRE' ; GoSub READONLY_RECORD_PRE Case Action _EQC 'READONLY_RECORD' ; GoSub READONLY_RECORD Case Action _EQC 'WRITE_RECORD_PRE' ; GoSub WRITE_RECORD_PRE Case Action _EQC 'WRITE_RECORD' ; GoSub WRITE_RECORD Case Action _EQC 'DELETE_RECORD_PRE' ; GoSub DELETE_RECORD_PRE Case Action _EQC 'DELETE_RECORD' ; GoSub DELETE_RECORD Case Otherwise$ ; Status = 'Invalid Action' End Case If KeyID then GoSub Restore_System_Variables If Assigned(ActionFlow) else ActionFlow = ACTION_CONTINUE$ Return ActionFlow //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Calculated Columns // // The typical structure of a calculated column will look like this: // // Declare function Database_Services // // @ANS = Database_Services('CalculateColumn') //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// CalculateColumn: // Make sure the ActionFlow return variable is cleared in case nothing is calculated. ActionFlow = '' Begin Case Case CalcColName EQ 'RR_SCRIBE' ; GoSub RR_SCRIBE Case CalcColName EQ 'SHIP_CASS_ID' ; GoSub SHIP_CASS_ID Case CalcColName EQ 'SHIP_SLOT' ; GoSub SHIP_SLOT Case CalcColName EQ 'WFR_SIZE' ; GoSub WFR_SIZE End Case return RR_SCRIBE: RDSNo = {RDS_NO} InWfrIDs = Xlate('REACT_RUN', RDSNo, 'IN_WFR_ID', 'X') Scribes = Xlate('REACT_RUN', RDSNo, 'WAFER_SCRIBE', 'X') Locate @ID in InWfrIDs using @VM setting vPos then ActionFlow = Scribes<0, vPos> end return SHIP_CASS_ID: RDSNo = {RDS_NO} InWfrIDs = Xlate('REACT_RUN', RDSNo, 'IN_WFR_ID', 'X') OutSlotIDs = Xlate('REACT_RUN', RDSNo, 'OUT_SLOT_ID', 'X') ShipFlags = Xlate('REACT_RUN', RDSNo, 'CARR_WFR_SHIP', 'X') Locate @ID in InWfrIDs using @VM setting vPos then WaferShipped = ShipFlags<0, vPos> If WaferShipped EQ True$ then OutSlotID = OutSlotIDs<0, vPos> OutCassID = Field(OutSlotID, '*', 1, 2) ActionFlow = OutCassID end end return SHIP_SLOT: RDSNo = {RDS_NO} InWfrIDs = Xlate('REACT_RUN', RDSNo, 'IN_WFR_ID', 'X') OutSlotIDs = Xlate('REACT_RUN', RDSNo, 'OUT_SLOT_ID', 'X') Locate @ID in InWfrIDs using @VM setting vPos then OutSlotID = OutSlotIDs<0, vPos> OutSlot = Field(OutSlotID, '*', 3, 1) ActionFlow = OutSlot end return WFR_SIZE: EpiPartNo = Xlate('WO_LOG', {WO_NO}, 'EPI_PART_NO', 'X') ActionFlow = Xlate('EPI_PART', EpiPartNo, 'SUB_WAFER_SIZE', 'X') return // ----- MFS calls ----------------------------------------------------------------------------------------------------- READ_RECORD_PRE: // In order to stop a record from being read in this action these lines of code must be used: // // OrigFileError = 100 : @FM : KeyID // Status = 0 // Record = '' // ActionFlow = ACTION_STOP$ return READ_RECORD: // In order to stop a record from being read in this action these lines of code must be used: // // OrigFileError = 100 : @FM : KeyID // Status = 0 // Record = '' return READONLY_RECORD_PRE: // In order to stop a record from being read in this action these lines of code must be used: // // OrigFileError = 100 : @FM : KeyID // Status = 0 // Record = '' // ActionFlow = ACTION_STOP$ return READONLY_RECORD: // In order to stop a record from being read in this action these lines of code must be used: // // OrigFileError = 100 : @FM : KeyID // Status = 0 // Record = '' return WRITE_RECORD_PRE: If ( (OrigRecord NE 'Wafer Destroyed') and (Record EQ 'Wafer Destroyed') ) then // Automatically set the destroy signature and the destroy date Record = Date() Record = @User4 SaveRecord = Record end return WRITE_RECORD: WfrID = Name If Record NE '' then // Copy data to RETAINED_WAFERS database table RetWaferRec = Database_Services('ReadDataRow', 'RETAINED_WAFERS', WfrID) RetWaferRec = {GAN_RUN_ID} RetWaferRec = {POCKET} RetWaferRec = {SCRIBE} RetWaferRec = {GRADE} RetWaferRec = {RETAIN_BOX} RetWaferRec = {RETAIN_SLOT} RetWaferRec = {RETAIN_SIG} RetWaferRec = {RETAIN_DT} RetWaferRec = {DESTROY_SIG} RetWaferRec = {DESTROY_DT} RetWaferRec = {RETAIN_LOC} RetWaferRec = {RETAIN_STATUS} RetWaferRec = {RETAIN_COMMENT} RetWaferRec = {WFR_SIZE} Database_Services('WriteDataRow', 'RETAINED_WAFERS', WfrID, RetWaferRec, True$, False$, True$) end If Record EQ '' then // Remove wafer ID from RETAINED_WAFERS database table if it exists If RowExists('RETAINED_WAFERS', WfrID) then Database_Services('DeleteDataRow', 'RETAINED_WAFERS', WfrID, True$, False$) end end ReactType = {REACT_TYPE} If ( (ReactType EQ 'GAN') and ( ( (OrigRecord NE '') and (Record EQ '') ) or (Record EQ 0) or (Record EQ '') ) ) then // Log the routine responsible Stack = RetStack() Swap @FM with ' | ' in Stack LogData = '' LogData<1> = LoggingDTM LogData<2> = WfrID LogData<3> = Stack Logging_Services('AppendLog', objLog, LogData, @RM, @FM, True$) end return DELETE_RECORD_PRE: return DELETE_RECORD: // Remove wafer ID from RETAINED_WAFERS database table if it exists If RowExists('RETAINED_WAFERS', WfrID) then Database_Services('DeleteDataRow', 'RETAINED_WAFERS', WfrID, True$, False$) end return //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Internal GoSubs //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ClearCursors: For counter = 0 to 8 ClearSelect counter Next counter return Initialize_System_Variables: // Save these for restoration later SaveDict = @DICT SaveID = @ID SaveRecord = @RECORD OrigFileError = @FILE.ERROR // Now make sure @DICT, ID, and @RECORD are populated CurrentDictName = '' If @DICT then DictHandle = @DICT<1, 2> Locate DictHandle in @TABLES(5) Using @FM Setting fPos then CurrentDictName = Field(@TABLES(0), @FM, fPos, 1) end end If CurrentDictName NE DictName then Open DictName to @DICT else Status = 'Unable to initialize @DICT' end @ID = KeyID If Record else // Record might not have been passed in. Read the record from the database table just to make sure. @FILE.ERROR = '' Open TableName to hTable then FullFSList = hTable[1, 'F' : @VM] BFS = FullFSList[-1, 'B' : @SVM] LastHandle = hTable[-1, 'B' : \0D\] FileHandle = \0D\ : LastHandle[1, @VM] Call @BFS(READO.RECORD, BFS, FileHandle, KeyID, FMC, Record, ReadOStatus) end end @RECORD = Record return Restore_System_Variables: Transfer SaveDict to @DICT Transfer SaveID to @ID Transfer SaveRecord to @RECORD @FILE.ERROR = OrigFileError return