Function Test_Daniel3(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10) #pragma precomp SRP_PreCompiler Declare subroutine Set_Property, Set_Status, ErrMsg, Set_Property, obj_AppWindow, Send_Message, Logging_Services Declare subroutine Btree.Extract, Send_Event, Security_Err_Msg, Forward_Event, End_Window, Start_Window, FTP_Services Declare subroutine EditCell, obj_NCR, obj_Notes, Post_Event, obj_WO_Mat, obj_WO_Mat_Log, obj_WO_Wfr, obj_Tables, obj_RDS Declare subroutine Error_Services, RDS_Services, Dialog_Box, Insert, Unlock, QA_Services, Validate, Development_Services Declare subroutine Update_Index, Database_Services, Obj_WO_Mat_QA, Fmt, Yield, WinYield, Sleepery, Qa_Services, Declare subroutine Obj_Post_Log, GaN_Services, Excel_Services, obj_WO_React, Activate_Save_Select, Reduce, FSMsg Declare subroutine SRP_Stopwatch, Copy_Record_To_SQL, SQL_Services, Material_Services, Messaging_Services, Utility Declare subroutine Reactor_Services, Reactor_Services_Dev, SRP_Stopwatch, Btree.Extract, Set_Env, RDS_React_Run Declare subroutine obj_Prod_Spec, Security_Services, Make.List, Write_OI_To_SQL, Send_Info, PSN_Services, Free_Class.Net Declare subroutine Work_Order_Services, Test_Daniel2, obj_RDS_Layer, Report_Services, Pass_To_Sql, SRP_JSON, SRP_Run_Command Declare subroutine Httpclient_Services, SRP_TcpClient, RTI_Set_Debugger, Sleepery, Set_Env, Extract_SI_Keys, Repository Declare subroutine PM_Spec_Services, Push.Select, Pop.Select, GetTempPath, GetEngineVersion Declare function Get_Property, Get_Status, Popup, Send_Message, Msg, Security_Check, Dialog_Box, RowExists, Utility Declare function Dialog_Box, obj_WO_Log, obj_NCR, Check_Notes, obj_MUWafers, obj_WO_Mat, Error_Services, RDS_Services Declare function MemberOf, obj_Tables, obj_RDS, Environment_Services, Logging_Services, Material_Services, ErrMsg Declare function Work_Order_Services, RetStack, Min, Max, Obj_Prod_Spec, Insert, SRP_Trim, Xlate, Obj_Wo_Mat Declare function Security_Services, QA_Services, Database_Services, RowExists, Rti_Lh_Info, UNICODE_ANSI, UNICODE_UTF8 Declare function index, Httpclient_Services, SRP_Encode, SRP_Decode, DirList, Obj_Rds_Test, Tool_Parms_Services Declare function SQL_Services, RDS_Services, Obj_WM_out, Schedule_Services, Obj_Tool, SRP_Sort_Array, ICONV Declare function Development_Services, Obj_WO_Mat_QA, SRP_Join_Arrays, NextKey, Obj_Prod_Spec, FTP_Services, SQL_Format Declare function DateTime, GaN_Services, SRP_Array, Excel_Services, EpiPro_Services, Repository, RTI_Task_Submit Declare function RTI_Task_Status, Rds_Services, StartDotNet, Reactor_Services, SRP_Get_FileVersion, Direct_Print Declare function obj_React_Run, RTI_Lock_Owner, obj_WM_In, Get_Repos_Entities, Get_Printer, Schedule_Services Declare function Location_Services, Replication_Services, List_User_Locks, Start_Window, SRP_JSON, SRP_Path Declare function Httpclient_Services, SRP_TcpClient, GetTickCount, Repository, Select_Into, Active_Directory_Services Declare function Rti_Ldap_Groups_For_User, Wafer_Counter_Services, SRP_Logon, SRP_Get_Printers, Printer_Select Declare function RTI_Xlate_Controller $INSERT LOGICAL * $Insert RLIST_EQUATES * $INSERT ENVIRON_CONSTANTS * $Insert REVCAPI_EQUATES * $INSERT MSG_EQUATES * $INSERT APPCOLORS * $INSERT WM_IN_EQUATES * $Insert WM_OUT_EQUATES * $INSERT WO_LOG_EQU * $INSERT WO_STEP_EQU $INSERT WO_MAT_EQUATES * $INSERT ORDER_EQU * $INSERT RDS_EQUATES * $INSERT PROD_SPEC_EQU * $INSERT NOTIFICATION_EQU * $INSERT LSL_USERS_EQU * $INSERT SECURITY_RIGHTS_EQU * $INSERT POPUP_EQUATES * $INSERT RTI_LH_INFO_EQUATES * $INSERT WO_MAT_QA_EQUATES * $INSERT CUST_EPI_PART_EQUATES * $INSERT PRS_STAGE_EQUATES * $Insert RLIST_EQUATES * $Insert CLEAN_INSP_EQUATES * $Insert TOOL_PARMS_EQUATES * $Insert SCHEDULE_EQU * $Insert SCHED_DET_EQUATES * $Insert SCHEDULER_EQUATES * $Insert NCR_EQUATES * $Insert REACT_RUN_EQUATES * $Insert TOOL_EQUATES * $Insert TOOL_LOG_EQUATES * $Insert PM_EQUATES * $Insert WO_WFR_EQUATES $Insert REVDOTNETEQUATES * $Insert REACTOR_EQUATES * $Insert RDS_TEST_EQUATES * $Insert RUN_STAGE_WFR_EQUATES * $Insert RTI_DEBUG_COMMON * $Insert DICT_EQUATES * $Insert SRPMAIL_INSERTS * $Insert SCHED_DET_NG_EQUATES * $Insert RDS_LAYER_EQUATES * $Insert PROD_VER_EQUATES * $Insert PM_SPEC_EQUATES * // 02/22/2023 48312 50112 ; // 5 hours = 14400 seconds * // Reduce modes (for Select statement) * Equ NEW_EXIST$ To 0 * Equ NEXT_CUR$ To 1 * Equ ADD_EXIST$ To 2 * * EQU COL$QA_MET_PHASE_MIN TO 17 * Equ Tab$ to \09\ Equ CRLF$ to \0D0A\ Equ LF$ to \0A\ Equ Comma$ to ',' $Insert PS_EQUATES * * $INSERT PRINTSETUP_EQUATES * equ REV_CREATE_ENGINE_NO_UI$ to 0x040 Main: * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,REACTOR_SERVICES', '', '', '') debug * LoadInstAckReq = Xlate('RDS', 646209, 'LOAD_INST_ACK_REQ', 'X') DefPrinter = Get_Printer( "CURRENTDEVICE") Printers = Get_Printer( "DEVICES" ) * SelPrinter = Printer_Select() * Stage = Rds_Services('GetCurrentStage', 646209) * CurrStage = Xlate('RDS', 646209, 'CURR_STAGE', 'X') *TaskID = RTI_Task_Submit('', 'TEST_DANIEL2', '', '', '') * Slots = Xlate('WM_OUT', '173011*1*2', 'SLOT_WAFER_ID', 'X') * RDSNos = Xlate('WM_OUT', '173011*1*3', 'RDS', 'X') * WONo = 172637 * WOStep = 1 * CassNo = 30 * WMOKey = WONo:'*':WOStep:'*':CassNo * WOMatKey = WONo:'*':CassNo * NCRNos = Xlate('WM_OUT', WMOKey, 'SLOT_NCR', 'X') * NumScrapSlots = 0 * If NCRNos NE '' then * For each NCRNo in NCRNos using @VM * NumScrapSlots += (NCRNo NE '') * Next NCRNo * end * * SchedCassQty = XLATE('WO_MAT', WOMatKey, 'WAFER_QTY', 'X') * * If NumScrapSlots GE SchedCassQty then * FullBoxReject = True$ * end else * FullBoxReject = False$ * end * Version = '' * GetEngineVersion(Version) * If Version GT 10 then * rv = RTI_Xlate_Controller('EnableCache') * end return TaskID * Path = Drive() * UNCPath = SRP_Path("PathToUnc", Path) * OrderId = '03b06637-51d4-4fed-76df-08dcac37e547' * OrderId = 'A735DA70-9917-4025-76DE-08DCAC37E547' * * BaseNicaUrl = Environment_Services("GetProveInApiUrl"):'/checklists?' * NicaUrl = BaseNicaUrl:'checklistOrderId=':OrderId * NicaUrl := '&checklistState=cancelled' * * Retries = 3 * BackoffSeconds = 1 * IsSuccessful = False$ * * Loop * while (IsSuccessful EQ False$ and Retries GT 0) * WaitSeconds = (2 - Retries) * BackoffSeconds * Delay(WaitSeconds) * * Retries = Retries - 1 * * HttpResponseJson = Httpclient_Services('SendHTTPRequest', 'PUT', NicaUrl, 'Accept':@VM:'*/*', '', '', '', False$, False$, '') * If HttpResponseJson NE '' then * ObjResponseJson = '' * If SRP_JSON(ObjResponseJson, 'Parse', HttpResponseJson) EQ '' then * IsComplete = SRP_JSON(ObjResponseJson, 'GetValue', 'pendingUpdate') * Response = (IsComplete EQ True$) * end * end * SRP_JSON(ObjResponseJson, 'Release') * IsSuccessful = ( (Response EQ True$) or (Response EQ False$) ) * Repeat * BatchConvTrans = '' * BatchConvTrans<1> = 1210 * BatchConvTrans<2> = 'U442' * BatchConvTrans<3> = '104PNYZ.35'; // SAP Batch No * BatchConvTrans<4> = '0500' ; // SLOC From * BatchConvTrans<5> = '0400' ; // SLOC To * BatchConvTrans<6> = 25 ; // Quantity * * CONVERT @FM TO TAB$ IN BatchConvTrans * * BatchConvTrans := CRLF$ * * OSWrite BatchConvTrans on 'D:\apps\Temp\BatchConv1.tsv' return * DotNetHandle = StartDotNet("","4.0") * DotNetDir = CheckDotNet('4.0'):'\' * DLLPath = 'D:\Apps\OIStieberD\IFXAPI\SSHNET\Renci.SshNet.dll' * * // Specify the DLL * rv = Set_Property.NET(DotNetHandle, "AssemblyName", DLLPath) * * // Define the classes * User = 'qasopeni' * Password = 'sapqasopeni' * Host = '172.28.150.80' * objSftpClient = Create_Class.NET(DotNetHandle, "Renci.SshNet.SftpClient", 0, Host:@FM:User:@FM:Password, 'System.String':@FM:'System.String':@FM:'System.String') * errCode = '' * If Not(Get_Status(errCode)) then * mthds = get_info.net(objSftpClient, REVDOTNET_INFO_METHODS) * rv = Send_Message.Net(objSftpClient, 'Connect', '', '', 0) * If Not(Get_Status(errCode)) then * IsConnected = Get_Property.Net(objSftpClient, 'get_IsConnected', 0) * objList = Send_Message.Net(objSftpClient, 'ListDirectory', '/':@FM:0, 'System.String':@FM:'System.Int32', 0) * If Not(Get_Status(errCode)) then * Null * end * ListProps = get_info.net(objList, REVDOTNET_INFO_PROPERTIES) * ListMthds = get_info.net(objList, REVDOTNET_INFO_METHODS) * end * Free_Class.Net(objList) * Free_Class.Net(objSftpClient) * end * CheckListActive = '' * Res = Sum(CheckListActive) * * CurrModeKey = Xlate('REACTOR_CHILD_KEY_IDS_NG', 30, 1, 'X') * CurrRLKey = Xlate('REACT_MODE_NG', CurrModeKey, 'START_RL_ID', 'X') * * ChecklistActive = Xlate('REACTOR_LOG', CurrRLKey, 'CHECKLIST_ACTIVE', 'X') * If ChecklistActive then * ChecklistTypes = Xlate('REACTOR_LOG', CurrRLKey, 'CHECKLIST_TYPE', 'X') * Swap @VM with ',' in ChecklistTypes * Msg(@Window, '', 'OK', '', * end return TempDirectory = Str(\00\, 1024) GetTempPath(Len(TempDirectory), TempDirectory) Convert \00\ to '' in TempDirectory * Printer = Printer_Select() * Printers = SRP_Get_Printers('Local') * Groups = RTI_Ldap_Groups_For_User('OUELLETTE', 'Infineon') * Swap @VM with \0D0A\ in Groups * OSWrite Groups on 'D:\tmp\OUELLETTE_Groups_OI9.txt' * res = Dialog_Box('NDW_WAFER_COUNTER', @Window, 633032:@FM:0:@FM:'QA') * Set_Property('WM_OUT.CURR_STATUS', 'TEXT', 'WMO - FQA Label Check') * Set_Property('WM_OUT.CURR_STATUS', 'TEXT', 'WMO - Final QA') * Set_Property('WM_OUT.MAKEUP_BOX', 'CHECK', 0) * WfrSize = Xlate('RDS', 456789, 'WAFER_SIZE', 'X') * WfrSize = Xlate('WO_MAT', '172792*37', 'REP_STATUS', 'X') * PSNo = Xlate('WM_OUT', '172790*1*45', 'PS_NO', 'X') * Ans = xlate( 'PROD_SPEC', PSNo, 'SUB_WAFER_SIZE', 'X' ) * KeyList = Database_Services('ReadDataRow', 'SYSLISTS', 'TOOL_LOG_WC6INCH') * If Error_Services('HasError') then Error_Services('DisplayError') * For each Key in KeyList using @FM setting fPos * NewKey = Field(Key, '*', 1):'1*':Field(Key, '*', 2) * Rec = Database_Services('ReadDataRow', 'TOOL_LOG', Key) * If Error_Services('HasError') then Error_Services('DisplayError') * Database_Services('WriteDataRow', 'TOOL_LOG', NewKey, Rec) * If Error_Services('HasError') then Error_Services('DisplayError') * Database_Services('DeleteDataRow', 'TOOL_LOG', Key) * If Error_Services('HasError') then Error_Services('DisplayError') * Next Key * * Database_Services('DeleteDataRow', 'TOOL', 'WC6INCH') * If Error_Services('HasError') then Error_Services('DisplayError') * * KeyList = Database_Services('ReadDataRow', 'SYSLISTS', 'TOOL_LOG_WC8INCH') * If Error_Services('HasError') then Error_Services('DisplayError') * For each Key in KeyList using @FM setting fPos * NewKey = Field(Key, '*', 1):'1*':Field(Key, '*', 2) * Rec = Database_Services('ReadDataRow', 'TOOL_LOG', Key) * If Error_Services('HasError') then Error_Services('DisplayError') * Database_Services('WriteDataRow', 'TOOL_LOG', NewKey, Rec) * If Error_Services('HasError') then Error_Services('DisplayError') * Database_Services('DeleteDataRow', 'TOOL_LOG', Key) * If Error_Services('HasError') then Error_Services('DisplayError') * Next Key * Database_Services('DeleteDataRow', 'TOOL', 'WC8INCH') * If Error_Services('HasError') then Error_Services('DisplayError') return * Response = Xlate('WO_MAT', '172709*73', 'SLOT_WAFER_ID', 'X') * URL = 'https://metrology-viewer-prod.mes.infineon.com/api/v1/WaferCounter/8INCH/last-quantity-and-slot-map?area=MU' * Res = Httpclient_Services('SendHTTPRequest', 'GET', URL, '', '', '', '', False$, False$, '') * Debug * Open 'PM_SPEC' to hPMSpec then * Select hPMSpec * Done = False$ * Loop * ReadNext KeyID else Done = True$ * Until Done * PM_Spec_Services('UpdatePMCompDtm', KeyID) * Repeat * end * CycleCnt = Xlate('PM_SPEC', 706, 'TOOL_CYCLE_CNT', 'X') * CycleCnt = Xlate('PM', 33593, 'TOOL_CYCLE_CNT', 'X') * Ctrl = 'WO_REC.PAGE_1_TAB' * Val = Get_Property(Ctrl, 'DRAWTEXT') * equ ES_LEFT to 0 * equ ES_CENTER to 1 * equ ES_RIGHT to 2 * * Ctrl = 'WO_REC.PAGE_1_TAB' * * Text = Get_Property(Ctrl, "TEXT") * Style = Get_Property(Ctrl, "STYLE") * Struct = Get_Property(Ctrl, "ORIG_STRUCT") * * If Style [1,2] _EQC '0x' then * convert @lower.case to @upper.case in Style * Style = iconv(Style [3,99], "MX") * end * AllBits = bitor(ES_LEFT, bitor(ES_CENTER, ES_RIGHT)) * Style = bitand(Style, bitnot(AllBits)) * AddStyle = ES_CENTER * Style = bitor(Style, AddStyle) * Struct<1, PSPOS_SDKSTYLE$> = Style * Struct<1, PSPOS_TEXT$ > = Text * Utility("DESTROY", Ctrl) * Utility("CREATE", Struct) * Response = Dialog_Box('NDW_WAFER_COUNTER', @Window, '630268') * Exists = RowExists('WM_OUT', '172767*1*35') * Response = Dialog_Box('NDW_WAFER_COUNTER', @Window, '172767*1*35':@FM:5) * Username = 'StieberD' * Password = '' * Domain = 'Infineon' * debug * Groups1 = SRP_Logon('GetADGroups', Username, Domain) * Groups2 = Active_Directory_Services('GetADGroups', Username, Domain) * SRP_Stopwatch('Reset') * SRP_Stopwatch('Start', 'SRP') * ValidUser = SRP_Logon('ValidateUser', Username, Password, Domain) * SRP_Stopwatch('Stop') * SRP_Stopwatch('Start', 'IFX') * ValidUser = Active_Directory_Services('AuthenticateUser', Username, Password, Domain) * SRP_Stopwatch('Stop', 'IFX') * SRP_Stopwatch('ShowAll') * // Empty cassette * FileData = 'T00':CRLF$:'P0000000' * Value = Wafer_Counter_Services('ConvertWaferData', FileData) * * // Full cassette * FileData = 'T25':CRLF$:'P1FFFFFF' * Data = Wafer_Counter_Services('ConvertWaferData', FileData) * * // 12 wafers in even slots * FileData = 'T12':CRLF$:'P0AAAAAA' * Data = Wafer_Counter_Services('ConvertWaferData', FileData) * * // 13 wafers in odd slots * FileData = 'T13':CRLF$:'P1555555' * Data = Wafer_Counter_Services('ConvertWaferData', FileData) * * // Slot 24 empty * FileData = 'T01':CRLF$:'P17FFFFF' * Data = Wafer_Counter_Services('ConvertWaferData', FileData) * Val = IConv('0', 'MX') * Val = OConv(Val, 'MB') * Val = Fmt(Val, 'R(0)#4') * * Val = IConv('1', 'MX') * Val = OConv(Val, 'MB') * Val = Fmt(Val, 'R(0)#4') * * Val = IConv('2', 'MX') * Val = OConv(Val, 'MB') * Val = Fmt(Val, 'R(0)#4') * * Val = IConv('3', 'MX') * Val = OConv(Val, 'MB') * Val = Fmt(Val, 'R(0)#4') * * Val = IConv('4', 'MX') * Val = OConv(Val, 'MB') * Val = Fmt(Val, 'R(0)#4') * * Val = IConv('5', 'MX') * Val = OConv(Val, 'MB') * Val = Fmt(Val, 'R(0)#4') * * Val = IConv('6', 'MX') * Val = OConv(Val, 'MB') * Val = Fmt(Val, 'R(0)#4') * * Val = IConv('7', 'MX') * Val = OConv(Val, 'MB') * Val = Fmt(Val, 'R(0)#4') * * Val = IConv('8', 'MX') * Val = OConv(Val, 'MB') * Val = Fmt(Val, 'R(0)#4') * * Val = IConv('9', 'MX') * Val = OConv(Val, 'MB') * Val = Fmt(Val, 'R(0)#4') * * Val = IConv('A', 'MX') * Val = OConv(Val, 'MB') * Val = Fmt(Val, 'R(0)#4') * * Val = IConv('B', 'MX') * Val = OConv(Val, 'MB') * Val = Fmt(Val, 'R(0)#4') * * Val = IConv('C', 'MX') * Val = OConv(Val, 'MB') * Val = Fmt(Val, 'R(0)#4') * * Val = IConv('D', 'MX') * Val = OConv(Val, 'MB') * Val = Fmt(Val, 'R(0)#4') * * Val = IConv('E', 'MX') * Val = OConv(Val, 'MB') * Val = Fmt(Val, 'R(0)#4') * * Val = IConv('F', 'MX') * Val = OConv(Val, 'MB') * Val = Fmt(Val, 'R(0)#4') * * return * KeyList = '' * Equ new_exist$ To 0 ; * Reduce Mode 0 * Equ next_cur$ To 1 * Equ add_exist$ to 2 * * table_name = "WO_MAT" * * flag = "" * done = False$ * CursorVar = "" * * * Clears all cursors * For counter = 0 To 8 * ClearSelect counter * Next counter * * sort_list = "SAP_TX_DT" * Reduce_Script = "WITH {SAP_BATCH_NO} EQ '' AND WITH {SAP_TX_DT} GT '":OConv(Date() - 16, 'D4/'):"'" * mode = NEXT_CUR$ * * Reduce(reduce_script, sort_list, mode, table_name, Cursorvar, flag) * If flag then * Select table_name By sort_list Using Cursorvar then * Open table_name To file_var then * ctr = 0 * * Loop * ReadNext key Using Cursorvar By AT Else done = TRUE$ * Until done * KeyList<-1> = Key * Repeat * End Else * FsMsg() * End * End Else * FsMsg() * end * End Else * FsMsg() * End * NumKeys = DCount(KeyList, @FM) * table = "WO_MAT" * Open "DICT ":table To @DICT Else * RetVal = Set_FSError() * Return * End * Column = "SAP_BATCH_NO" * data1 = "" * search_criteria = column:@VM:data1:@FM * keylist = "" * option = "" * flag = "" * Btree.Extract(search_criteria, table, @DICT, keylist1, option, flag) * Rows = DCount(keylist1, @VM) * * Column = "SAP_TX_DT" * data1 = '>=':Date() - 15 * search_criteria = column:@VM:data1:@FM * keylist = "" * option = "" * flag = "" * Btree.Extract(search_criteria, table, @DICT, keylist2, option, flag) * KeyList3 = SRP_Array('Join', keylist1, keylist2, 'AND', @VM) * Httpclient_Services('SetTimeoutDuration', '600') * Response = Httpclient_Services('SendHTTPRequest', 'GET', 'mestsa008.infineon.com/apidev/oiwizard', '', '', '', '', True$, True$, '') * Authenticated = False$ * DotNetHandle = StartDotNet("","4.0") * DotNetDir = CheckDotNet('4.0'):'\' * AccountMgmtDllPath = DotNetDir:'System.DirectoryServices.AccountManagement.dll' * Set_Property.Net(DotNetHandle, "AssemblyName", AccountMgmtDllPath) * If Not(Get_Status(errCode)) then * Params = 'Domain':@FM:Domain * ParamTypes = 'System.DirectoryServices.AccountManagement.ContextType':@FM:'System.String' * objPC = Create_Class.Net(DotNetHandle, "System.DirectoryServices.AccountManagement.PrincipalContext", 0, Params, ParamTypes) * If Not(Get_Status(errCode)) then * Params = Username:@FM:Password * ParamTypes = 'System.String':@FM:'System.String' * Authenticated = Send_Message.Net(objPC, 'ValidateCredentials', Params, ParamTypes, 0) * Swap 'True' with True$ in Authenticated * Swap 'False' with False$ in Authenticated * Free_Class.Net(objPC) * end * end * Response = Authenticated * debug * Groups = Rti_Ldap_Groups_For_User('STIEBERD', 'infineon') * Groups = Rti_Ldap_Groups_For_User('MURSTIEBERD', 'infineon') * LoremIpsum = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ' * LoremIpsum := 'Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' * LoremIpsum := 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non ' * LoremIpsum := 'proident, sunt in culpa qui officia deserunt mollit anim id est laborum.' * return * * For I = 0 to 1000 * Result = SQL_Services('PostSQLRequest', 'SPC', 'SELECT * FROM RDS') * * Result = SQL_Services('GetDataRows', 'SPC', 'SELECT TOP (10) * FROM [LSL2SQL].[dbo].[RDS]', 1) * SQL_Services('ExecuteQuery', * Groups = Active_Directory_Services('GetADGroups', 'StieberD', 'Infineon') * Groups = SRP_Logon('GetADGroups', 'StieberD', 'Infineon') * Groups = Rti_Ldap_Groups_For_User('StieberD', 'Infineon') * * Next I * * * * return * TransFilePathIn = Environment_Services('GetFTPRootPath') : '\FTP_IN_TEST' * TransFilePathOut = Environment_Services('GetFTPRootPath') : '\FTP_OUT_TEST' * FTPScriptPath = Environment_Services('GetFTPRootPath') : '\FTPScript_Test\' * FTPServerIP = '172.28.150.80' ;* IFX EU FTP Server IP address or URL * FTPUser = 'qasopeni' * FTPPassWord = 'sapqasopeni' * FTPCapturePath = Environment_Services('GetApplicationRootPath') : '\SAP\FTPFiles\' * * BaseFromSAPScript = 'open ':FTPServerIP:CRLF$ * BaseFromSAPScript := 'user':CRLF$ * BaseFromSAPScript := FTPUser:CRLF$ * BaseFromSAPScript := FTPPassWord:CRLF$ * BaseFromSAPScript := 'lcd ':TransFilePathIn:CRLF$ ;* Change local directory to C:\FTP_IN * * FromSAPScriptName = FTPScriptPath:'FromSAP.txt' * * BaseToSAPScript = 'open ':FTPServerIP:CRLF$ * BaseToSAPScript := 'user':CRLF$ * BaseToSAPScript := FTPUser:CRLF$ * BaseToSAPScript := FTPPassword:CRLF$ * BaseToSAPScript := 'lcd ':TransFilePathOut:CRLF$ ;* Change local directory to C:\FTP_OUT * * ToSAPScriptName = FTPScriptPath:'ToSAP.txt' * * OutBoundDir = 'CassComp' * * TransFileName = 'TX':FMT(1,"R(0)#6"):'.tsv' * TempFileName = TransFileName[1, 'F.'] * TempFileName := '.tmp' * TempDosTable = TransFilePathOut:'\':TempFileName * DosTable = TransFilePathOut:'\':TransFileName * FTPRootPath = Environment_Services('GetFTPRootPath') * * ExternalDate = OConv(Date(), 'D') * Swap ' ' with '_' in ExternalDate * ExternalTime = OConv(Time(), 'MTS') * Swap ':' with '_' in ExternalTime * RepoFileName = ExternalDate:'_':ExternalTime:'_':RepoID:'_':TransFileName * RepoDir = FTPRootPath : '\FTP_OUT_REPOSITORY\':OutBoundDir:'\':RepoFileName * OSWrite OutRec ON RepoDir * OutRec = 'test' * OSWrite OutRec on DosTable * OSWrite OutRec on TempDosTable * * ToSAPScript = BaseToSAPScript * ToSAPScript := 'cd ToSAP':CRLF$ * ToSAPScript := 'cd ':OutBoundDir:CRLF$ * * ToSAPScript := 'ls ':CRLF$ * ToSAPScript := 'bye':CRLF$ * * OSwrite ToSAPScript on FTPScriptPath:'ToSAP.txt' * * Stat = 'VAR' * * SRP_Run_Command('ftp -i -n -s ' : FTPScriptPath, Stat, '', '', 1, '') * ToSAPScript := 'put ':TempDosTable:CRLF$ * // Added on 02/11/19 to save a copy of SAP files that we place on the ftp server for verfication purposes * ToSAPScript := 'lcd ':FTPRootPath:'\FTP_OUT_VERIFY\':OutBoundDir:CRLF$ * ToSAPScript := 'get ':TempFileName:' ':RepoFileName:CRLF$ * // Added on 4/2/19 to work with SAP's tmp filename convention * ToSAPScript := 'ren ':TempFileName:' ':TransFileName:CRLF$ * // ------------------------------------------------------------------------------------------------------ * ToSAPScript := 'bye':CRLF$ * * OSWrite ToSAPScript ON ToSAPScriptName * StartTime = Time() * DELETE Buffer,TxSeqNo ELSE Null * Stat = 'VAR' * * SRP_Run_Command('ftp -i -n -s:' : ToSAPScriptName, Stat, '', '', '', TransType) * Cmds = 'SELECT CALIB_LIST WITH CL_TYPE EQ "E"' : @FM * Cmds := 'SELECT CALIB_LIST WITH EQ_LOC NE "Out of Service"' : @FM * Cmds := 'LIST CALIB_LIST DEPT EQ_DESC JUSTLEN 120 EQ_SN EQ_LOC CAL_INTERVAL CAL_LOC LAST_CAL_DT NEXT_CAL_DT BY NEXT_CAL_DT' * MyData = Select_Into(Cmds, 'EDT') * OSWrite MyData on 'C:\Users\MURStieberD\Desktop\MyData.json' * Free_Class.Net() * For I = 1 to 1000 * DotNetHandle = StartDotNet("","4.0") * ErrCode = '' * Free_Class.Net(DotNetHandle) * If Get_Status(ErrCode) then * debug * end * Next I * For I = 1 to 1000 * objConnection = Sql_Services('GetConnectionObject', 'SPC') * If Error_Services('NoError') then * Sql_Services('DestroyConnectionObject', objConnection) * end * Next I * * * return * * debug * Open 'WO_MAT' to hTable then * WONo = 172592 * For CassNo = 1 to 31 * WriteV True$ on hTable, WONo:'*':CassNo, WO_MAT_CONVERTED_MATERIAL$ else * debug * end * Next CassNo * end * debug * * WONo = 171956 * NewPVNo = 14302 * WOMatKeys = Xlate('WO_LOG', WONo, 'WO_MAT_KEY', 'X') * WOMatKeysRot = SRP_Array('Rotate', WOMatKeys, @VM, '*') * CassNos = WOMatKeysRot<0, 2> * Swap '*' with @VM in CassNos * CassNos = Delete(CassNos, 0, 1, 0) * NewWONo = Material_Services('ConvertMaterial', WONo, CassNos, NewPVNo) * If Error_Services('HasError') then Error_Services('DisplayError') return * NextIntProdOrdNo = 10 * NewIntProdOrdNo = 'IFX' : Fmt(NextIntProdOrdNo, 'R(0)#4') * * LSL2Inserts = Get_Repos_Entities('LSL2', 'STPROCINS', '', '') * FWInserts = Get_Repos_Entities('FRAMEWORKS', 'STPROCINS', '', '') * SysprogInserts = Get_Repos_Entities('SYSPROG', 'STPROCINS', '', '') * * InsertList = SRP_Array('Join', LSL2Inserts, FWInserts, 'OR', @FM) * InsertList = SRP_Array('Join', InsertList, SysprogInserts, 'OR', @FM) * * BadList = '' * For each InsertKey in InsertList using @Fm setting fPos * * App = InsertKey[1, 'F*'] * Key = InsertKey[-1, 'B*'] * If App EQ 'SYSPROG' then * SourceKey = Key * end else * SourceKey = Key:'*':App * end * Source = Database_Services('ReadDataRow', 'SYSPROCS', SourceKey) * If IndexC(Source, 'LOGICAL', 1) GT 0 then * // Contains LOGICAL * BadList<-1> = InsertKey * end * * Next InsertKey * * BadList4 = '' * Open 'SYSPROCS' to hTable then * Select hTable * EOF = False$ * Loop * ReadNext KeyID else EOF = True$ * Until EOF * Read Source from hTable, KeyID then * If ( (IndexC(Source, 'POPUP_EQUATES', 1) GT 0) and (IndexC(Source, 'LOGICAL', 1) EQ 0) and ( (IndexC(Source, 'true$', 1) GT 0) or (IndexC(Source, 'false$', 1) GT 0) or (IndexC(Source, 'yes$', 1) GT 0) or (IndexC(Source, 'no$', 1) GT 0) or (IndexC(Source, 'otherwise$', 1) GT 0)) ) then * // Contains POPUP_EQUATES, but not LOGICAL, and contain true$ or false$ * BadList4<-1> = KeyID * end * end * Repeat * end * * BadList3 = '' * Open 'SYSREPOSEVENTS' to hTable then * Select hTable * EOF = False$ * Loop * ReadNext KeyID else EOF = True$ * Until EOF * Read Source from hTable, KeyID then * If ( (IndexC(Source, 'POPUP_EQUATES', 1) GT 0) and (IndexC(Source, 'LOGICAL', 1) EQ 0) and ( (IndexC(Source, 'true$', 1) GT 0) or (IndexC(Source, 'false$', 1) GT 0) ) ) then * // Contains POPUP_EQUATES, but not LOGICAL, and contain true$ or false$ * BadList3<-1> = KeyID * end * end * Repeat * end * * Database_Services('WriteDataRow', 'SYSLISTS', 'TEST_DANIEL', BadList) * Database_Services('WriteDataRow', 'SYSLISTS', 'TEST_DANIEL2', BadList2) * Database_Services('WriteDataRow', 'SYSLISTS', 'TEST_DANIEL3', BadList3) * * Database_Services('WriteDataRow', 'SYSLISTS', 'TEST_DANIEL4', BadList4) * * * ErrCode = '' * InsertStr = @FM:'$INSERT LOGICAL' * KeyList = Database_Services('ReadDataRow', 'SYSLISTS', 'TEST_DANIEL4') * For each Key in KeyList using @FM setting fPos * Stproc = Field(Key, '*', 1) * App = Field(Key, '*', 2) * If App EQ 'LSL2' then * EntID = App:'*STPROC**':Stproc * EntData = Repository('ACCESS', EntID) * If Not(Get_Status(errCode)) then * Loc = IndexC(EntData, 'POPUP_EQUATES', 1) * If Loc GT 0 then * EntData[Loc + Len('POPUP_EQUATES'), 0] = InsertStr * Repository('UPDATE', EntID, EntData) * If Not(Get_Status(errCode)) then * Repository('COMPILE', EntID, True$) * If Get_Status(errCode) then * Msg(@Window, '', 'OK', '', 'Error':@FM:errCode) * end * end * end * end * end * Next Key * * return * * Spawn: * debug * PSNs = '' * ProdVerKeys = '' * Extract_SI_Keys('PROD_VER', 'CUST_NO', 7127, ProdVerKeys) * If ProdVerKeys NE '' then * PSNs = Xlate('PROD_VER', ProdVerKeys, 'PSN_ID', 'X') * end * * PSNs = '' * ProdVerKeys = '' * Option = '' * ErrorFlag = '' * Open 'DICT.PROD_VER' to hDict then * Query = 'CUST_NO':@VM:7127:@FM * Btree.Extract(Query, 'PROD_VER', hDict, ProdVerKeys, Option, ErrorFlag) * If Not(ErrorFlag) then * PSNs = Xlate('PROD_VER', ProdVerKeys, 'PSN_ID', 'X') * end * end * * PSNs = '' * Query = 'SELECT PROD_VER WITH CUST_NO EQ ':7127 * RList(Query, TARGET_ACTIVELIST$, '', '', '') * ErrCode = '' * If Not(Get_Status(ErrCode)) then * EOF = False$ * Loop * ReadNext ProdVerKeyID else EOF = True$ * Until EOF * PSNs<0, -1> = Xlate('PROD_VER', ProdVerKeyID, 'PSN_ID', 'X') * Repeat * end * * return * * KeyList = Database_Services('ReadDataRow', 'SYSLISTS', 'TEST_DANIEL') * For each Key in KeyList using @FM * Database_Services('DeleteDataRow', 'SCHED_DET_NG', Key, True$, False$) * Next Key * * on_off = 1 * t_flag = 1 * set_env(ENV_DEBUGGER_ENABLED$, on_off, t_flag) * debug * * hEngine = '' * hQueue = '' * QueueName = '' * Database = 'LSL2' * UserName = 'DANIEL_ST' * Password = 'SRPSUPPORT2020!' * ServerSpec = '\\':SocketServerIp : ":" : SocketServerPort * ServerSpec = '\\.\DJS' * Flags = BitOr(CREATE_ENGINE_CREATE_NEW$, REV_CREATE_ENGINE_NO_UI$) * Flags = CREATE_ENGINE_CREATE_NEW$ * Err = CreateEngine(hEngine, ServerSpec, Database, Flags, 1) * Err = CreateQueue(hQueue, hEngine, QueueName, Database, UserName, Password) * RetVal = '' * Err = CallFunction(hQueue, RetVal, 'TEST_DANIEL2', 'Testing OEngineServer') * Err = CloseQueue(hQueue) * Err = CloseEngine(hEngine) * * return * * Testing: * * RTI_Set_Debugger(1, '') * debug * Sleepery(100) * OSWrite 'Hello World!' on 'D:\tmp\helloworld.txt' * Response = 'My second response!' * * TickCount = GetTickCount() * Response = 'Hello World! Ticks: ':TickCount * OSWrite Response on 'D:\tmp\helloworld.txt' * OSWrite 'Hello World!' on 'D:\tmp\helloworld.txt' * Results = 'Hello World!' * * return Response * * 'HGCV1*20169.2778240741' * * 'HGCV1*20169.3674652778' * * 'HGCV1*20169.2753472222' * * debug * CurrModeKeys = Database_Services('ReadDataRow', 'SYSLISTS', 'TEST_DANIEL') * For each CurrModeKey in CurrModeKeys using @FM setting fPos * Rec = Database_Services('ReadDataRow', 'TOOL_LOG', CurrModeKey) * Rec<4> = '' * Rec<5> = '' * Database_Services('WriteDataRow', 'TOOL_LOG', CurrModeKey, Rec, True$, False$, True$) * Next CurrModeKey * * CurrModeKeys = 'HGCV1*19523.12345':@VM:'HGCV1*19523.23456':@VM:'HGCV1*19524.12345' * Swap '*' with @VM in CurrModeKeys * SortedRows = SRP_Array('SortRows', CurrModeKeys, 'DN2', 'LIST', @FM, '*', False$) * SortedList = SRP_Array('SortSimpleList', CurrModeKeys, 'DescendingText', @VM) * * Port = 8088 * IP = '10.95.176.50' * Command = \01\ * TcpClientHandle = 0 * If SRP_TcpClient(TcpClientHandle, 'CONNECT', IP, Port) then * SRP_TcpClient(TcpClientHandle, 'SEND', Command) * SRP_TcpClient(TcpClientHandle, 'CLOSE') * end * * // Testing out small improvement * * * Test = 'test' * CurrMode = Xlate('TOOL', 'HGCV1':@VM:'HGCV2', 'CURR_MODE', 'X') * * debug * // Get the port from the SRPEngineServer.ini file. * FilePath = Drive():'\SRPEngineServer.ini' * OSRead IniFile from FilePath then * CharIndex = Index(IniFile, 'Port', 1) * Line = IniFile[CharIndex, 'F':CRLF$] * Port = Trim(Line[-1, 'B=']) * end * return * * ToolID = 'HGCV2' * * Test = 'test' * * * debug * // Get the port from the SRPEngineServer.ini file. * FilePath = Drive():'\SRPEngineServer.ini' * OSRead IniFile from FilePath then * CharIndex = Index(IniFile, 'Port', 1) * Line = IniFile[CharIndex, 'F':CRLF$] * Port = Trim(Line[-1, 'B=']) * end * return * * ToolID = 'HGCV1' * * ModeKeys = Xlate('TOOL', ToolID, 4, 'X') * NumKeys = DCount(ModeKeys, @VM) * Open 'TOOL_LOG' to hToolLog then * For KeyIndex = NumKeys to 2 Step -1 * NextModeKey = ModeKeys<0, KeyIndex - 1> * NextModeStartDTM = Field(NextModeKey, '*', 2) * ThisModeKey = ModeKeys<0, KeyIndex> * WriteV NextModeStartDTM to hToolLog, ThisModeKey, 4 else * debug * end * WriteV 'OI_ADMIN' to hToolLog, ThisModeKey, 5 else * debug * end * Next KeyIndex * end * * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,WO_MAT_ACTIONS', '', '', '') * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,OBJ_WO_LOG', '', '', '') * * return * * WONo = 171804 * WOMatKeys = Xlate('WO_LOG', WONo, 'WO_MAT_KEY', 'X') * RDSNos = Xlate('WO_MAT', WOMatKeys, 'RDS_NO', 'X') * YieldQtys = * ScrapQtys = * ProdTestQtys = * * * Open 'DAILY_PERFORMANCE' to hTable then * Select hTable * EOF = False$ * Loop * ReadNext Key else EOF = True$ * Until EOF * KeyDate = Field(Key, '*', 1, 1) * If Not(Num(KeyDate)) then * Delete hTable, Key else debug * end * Repeat * end * * * * Httpclient_Services('SetTimeoutDuration', 10) * URL = 'https://oi-metrology-viewer-prod.mes.infineon.com/api/export/headers' * Response = Httpclient_Services('SendHTTPRequest', 'GET', URL) * * WONo = 171795 * SapBatchNos = Xlate('WO_LOG', WONo, 'SAP_BATCH_NO', 'X') * SAPYield = Xlate('WO_LOG', WONo, 'WO_MAT_SAP_YIELD', 'X') * SAPScrap = Xlate('WO_LOG', WONo, 'WO_MAT_SAP_CONFIRM_SCRAP', 'X') * DataExport = SapBatchNos:CRLF$:SAPYield:CRLF$:SAPScrap * Swap @VM with ',' in DataExport * OSWrite DataExport to 'D:\temp\171795.csv' * * return * * Procedures = '' * Procedures<1> = 'PM_SERVICES' * Procedures<2> = 'COMM_DIALOG_TOOL_STATUS' * Development_Services('DeployRoutine', Procedures) * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,COMM_DIALOG_TOOL_STATUS', '', '', '') * * Copy_Record_To_Sql('TOOL', 'BIORAD2', 1, '') * * FileName = '-__2023-28-02 10-48-24.txt' * ResourceID = Field(FileName, ' ', 1, 1) * URL = "https://oi-metrology-viewer-prod.mes.infineon.com/api/InfinityQSV3/":ResourceID:"/header" * TimeoutDuration = HTTPClient_Services('GetTimeoutDuration') * If TimeoutDuration NE 30 then Httpclient_Services('SetTimeoutDuration', 30) * Response = Httpclient_Services('SendHTTPRequest', 'GET', URL, '', '', '', '', '', '', '') * If Response NE '' then * If SRP_JSON(objJSON, 'Parse', Response) EQ '' then * SumOOS = SRP_JSON(objJSON, 'GetValue', 'Results[1].iq_sum') * If SumOOS NE '' then * * end else * ErrorMsg = SRP_JSON(objJSON, 'GetValue', 'message') * end * SRP_JSON(objJSON, 'Release') * end * end * * return * * debug * Query = 'SELECT PM_SPEC with PMS_ID GT 664' * RList(Query, TARGET_ACTIVELIST$, '', '', '') * EOF = False$ * Loop * Readnext KeyID else EOF = True$ * Until EOF * Database_Services('DeleteDataRow', 'PM_SPEC', KeyID) * Repeat * * return * * debug * OSRead File from 'D:\temp\PM_SPEC.csv' then * Swap CRLF$ with @RM in File * For each Line in File using @RM * Temp = Line * Swap @RM with '' in Temp * KeyID = Field(Temp, ',', 1, 1) * Rec = Field(Temp, ',', 2, 18) * Swap ',' with @FM in Rec * Database_Services('WriteDataRow', 'PM_SPEC', KeyID, Rec) * Next Line * end * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,EPI_PART', '', '', '') * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,EPI_PART_SERVICES', '', '', '') * * return * * debug * ActiveList = '286,289,292,278,281,282' * Open 'PM_SPEC' to hTable then * Select hTable * EOF = False$ * Loop * Readnext KeyID else EOF = True$ * Until EOF * Locate KeyID in ActiveList using ',' setting Dummy then * Archived = False$ * end else * Archived = True$ * end * WriteV Archived on hTable, KeyID, PM_SPEC_PM_ARCHIVED$ else * debug * end * Repeat * end * * return * * debug * Open 'DUMMY' to hTable then * Delete hTable, 456789 then * null * end else * null * end * end * debug * URL = 'http://mestsa05ec.ec.local:50176/login/camellabs/camellabs' * Response = Httpclient_Services('SendHTTPRequest', 'GET', URL, '', '', '', '', '', '', '') * If Response NE '' then * If SRP_JSON(objJSON, 'Parse', Response) EQ '' then * objData = SRP_JSON(objJSON, 'Get', 'Data') * If objData then * FirstName = SRP_JSON(objData, 'GetValue', 'firstname') * SRP_JSON(objData, 'Release') * end * SRP_JSON(objJSON, 'Release') * end * end * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,EPI_PART_SERVICES', '', '', '') * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,PACKAGING_SERVICES', '', '', '') * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,OBJ_WO_MAT_LOG', '', '', '') * * return * * debug * TablesToSkipOld = "ANNUAL_CONTRACTS,DESIG_ERR_GRP,EXPORTS,INVOICE,MFC_LOC,NAMES,ORDER,ORDER_CHANGE,QUOTE,REACT_ESC,SURFACE_SCAN,TW_PRIME_USAGE,TW_USAGE,VISION_LOG,VISION_ORDER" * TablesToSkip = Database_Services('ReadDataRow', 'APP_INFO', 'SQL_TABLES_TO_SKIP') * If TablesToSkipOld EQ TablesToSkip then * Null * end * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,RDS_ACTIONS', '', '', '') * debug * KeyList = Database_Services('ReadDataRow', 'SYSLISTS', 'TEST_DANIEL') * KeyList = Delete(KeyList, 1, 0, 0) * For each Key in KeyList using @FM * Database_Services('DeleteDataRow', 'SQL_PENDING', Key) * Next Key * * return * * * PassToSql: * * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,PASS_TO_SQL', '', '', '') * * return * * KeyList = Xlate('SYSLISTS', 'TEST_DANIEL_RDS_OI', '', 'X') * KeyList = Delete(KeyList, 1, 0 , 0) * Counter = 0 * Def = "" * Def = "Pushing REACT_MODE_NG data..." * Def = "GC" * Def = DCount(KeyList, @FM) * Def = 800 * MsgUp = Msg(@window, Def) * * For each Key in KeyList using @FM * Counter += 1 * Msg(@window, MsgUp, Counter, MSGINSTUPDATE$) * Copy_Record_To_Sql('REACT_MODE_NG', Key, 1) * Copy_Record_To_Sql('REACT_RUN', Key, 1) * Copy_Record_To_Sql('RDS', Key, 1) * WOMatKey = Xlate('RDS', Key, 'WO_MAT_KEY', 'X') * If WOMatKey NE '' then * Copy_Record_To_Sql('WO_MAT', WOMatKey, 1) * end * RDSLayerKeys = Xlate('RDS', Key, 'RDS_LS_SORTED', 'X') * If RDSLayerKeys NE '' then * For each RDSLayerKey in RDSLayerKeys using @VM * Copy_Record_To_Sql('RDS_LAYER', RDSLayerKey, 1) * RDSTestKeys = Xlate('RDS_LAYER', RDSLayerKey, 'RDS_TEST_KEYS', 'X') * If RDSTestKeys NE '' then * For each RDSTestKey in RDSTestKeys using @VM * Copy_Record_To_Sql('RDS_TEST', RDSTestKey, 1) * TWUseKeys = Xlate('RDS_TEST', RDSTestKey, 'TW_USE_ID', 'X') * If TWUseKeys NE '' then * For each TWUseKey in TWUseKeys using @VM * Copy_Record_To_Sql('TW_USE', TWUseKey, 1) * Next TWUseKey * end * Next RDSTestKey * end * Next RDSLayerKey * end * WMIKeys = Xlate('RDS', Key, 'WM_IN_KEY', 'X') * If WMIKeys NE '' then * For each WMIKey in WMIKeys using @VM * Copy_Record_To_Sql('WM_IN', WMIKey, 1) * Next WMIKey * end * WMOKeys = Xlate('RDS', Key, 'WM_OUT_KEY', 'X') * If WMOKeys NE '' then * For each WMOKey in WMOKeys using @VM * Copy_Record_To_Sql('WM_OUT', WMOKey, 1) * Next WMOKey * end * Next Key * * Msg(@window, MsgUp) ;* take down the gauge * * For each Key in KeyList using @FM * Counter += 1 * Msg(@window, MsgUp, Counter, MSGINSTUPDATE$) * WOMatKey = Xlate('RDS', Key, 'WO_MAT_KEY', 'X') * If WOMatKey NE '' then * Copy_Record_To_Sql('WO_MAT', WOMatKey, 1) * end * Next Key * Msg(@window, MsgUp) ;* take down the gauge * * return * * * SQLTest1: * * Open 'SCHED_DET_NG' to hTable then * Select hTable * EOF = False$ * Loop * Readnext KeyID else EOF = True$ * Copy_Record_To_SQL('SCHED_DET_NG', KeyID, True$) * Repeat * end * * * return * * objConnection = SQL_Services('GetConnectionObject', 'Metrology', 2) * If objConnection then * Query = "SELECT [EVENT_ID] FROM [SCHED_DET_NG]" * Keys = SQL_Services('ExecuteQuery', objConnection, Query, True$, 2) * Swap @RM with @FM in Keys * If Error_Services('NoError') then * For each Key in Keys using @FM * If Not(RowExists('SCHED_DET_NG', Key)) then * debug * Statement = "DELETE FROM [dbo].[SCHED_DET_NG] WHERE [EVENT_ID] = '":Key:"'" * SQL_Services('ExecuteQuery', objConnection, Statement, False$, 2) * If Error_Services('HasError') then Error_Services('DisplayError') * end * Next Key * end else * Error_Services('DisplayError') * end * SQL_Services('DestroyConnectionObject', objConnection) * end * * return * * * UpdateNCR: * * debug * KeyList = Xlate('SYSLISTS', 'TEST_DANIEL', '', 'X') * * Counter = 0 * Def = "" * Def = "Pushing WO_WFR data..." * Def = "GC" * Def = DCount(KeyList, @FM) * Def = 800 * MsgUp = Msg(@window, Def) * * Table = 'WO_WFR' * Open 'DICT.':Table to @DICT then * For each Key in KeyList using @FM * Counter += 1 * Msg(@window, MsgUp, Counter, MSGINSTUPDATE$) * WONo = Xlate('RDS', Key, 'WO', 'X') * If WONo NE '' then * Column = 'WO_NO' * Data = WONo * SearchCrit = Column:@VM:Data:@FM * BtreeKeys = '' * Option = '' * Flag = '' * Btree.Extract(SearchCrit, Table, @DICT, BtreeKeys, Option, Flag) * If BtreeKeys NE '' then * For each BtreeKey in BtreeKeys using @VM * Copy_Record_To_Sql('WO_WFR', BtreeKey, 1) * Next BtreeKey * end * end * * Copy_Record_To_Sql('PROD_SPEC', Key, 1) * * Copy_Record_To_Sql('RDS', Key, 1) * * Copy_Record_To_Sql('REACT_RUN', Key, 1) * * WOMatKey = Xlate('RDS', Key, 'WO_MAT_KEY', 'X') * * If WOMatKey NE '' then * * Copy_Record_To_Sql('WO_MAT', WOMatKey, 1) * * end * * NCRKeys = Xlate('RDS', Key, 'NCR_NOS', 'X') * * If NCRKeys NE '' then * * For each NCRKey in NCRKeys using @VM * * Copy_Record_To_Sql('NCR', NCRKey, 1) * * Next NCRKey * * end * * CIKeys = Xlate('REACT_RUN', Key, 'CI_NO', 'X') * * If CIKeys NE '' then * * For each CIKey in CIKeys using @VM * * Copy_Record_To_Sql('CLEAN_INSP', CIKey, 1) * * Next CIKey * * end * * RDSTestKeys = Xlate('RDS', Key, 'MET_KEYS', 'X') * * If RDSTestKeys NE '' then * * For each RDSTestKey in RDSTestKeys using @VM * * Copy_Record_To_Sql('RDS_TEST', RDSTestKey, 1) * * Next RDSTestKey * * end * Next Key * end * * Msg(@window, MsgUp) ;* take down the gauge * Connection = Sql_Services('GetConnectionObject', 'Scrape DB', 2) * If Error_Services('NoError') then * objCommand = Send_Message.Net(Connection, 'CreateCommand', '', '', 1) * If Not(Get_Status(errCode)) then * Null * end else * Free_Class.NET(objCommand) * end * Free_Class.NET(Connection) * end * Counter = 0 * KeyList = Database_Services('ReadDataRow', 'SYSLISTS', 'TEST_DANIEL') * Def = "" * Def = "Pushing NCR data..." * Def = "GC" * Def = DCount(KeyList, @FM) * Def = 800 * MsgUp = Msg(@window, Def) * * For each Key in KeyList using @FM * Counter += 1 * Msg(@window, MsgUp, Counter, MSGINSTUPDATE$) * Copy_Record_To_SQL('NCR', Key, True$) * Next Key * Msg(@window, MsgUp) ;* take down the gauge * * return * * * return * * CleanBacklog: * * Rec = Datetime() * ID = '4001DEF2679043B595F1F7998D8D04CE' * Database_Services('WriteDataRow', 'SQL_BACKLOG', 'SCHED_DET_NG':"*":ID:"*DELETE", Rec) * * Rec = Datetime() * ID = '40E884AB716E4857BD6A9FF982AACBFC' * Database_Services('WriteDataRow', 'SQL_BACKLOG', 'SCHED_DET_NG':"*":ID:"*DELETE", Rec) * RV = Start_Window('LIST_USER_LOCKS', '', '') * Dummy1 = '' * Dummy2 = '' * Locks = List_User_Locks(Dummy1, Dummy2) * debug * Open 'SQL_BACKLOG_WO_MAT' to hTable then * Select hTable * EOF = False$ * Loop * ReadNext KeyID else EOF = True$ * Until EOF * WONo = Field(KeyID, '*', 2) * If WONo LT 170000 then * Database_Services('DeleteDataRow', 'SQL_BACKLOG_WO_MAT', KeyID) * end * Repeat * end * * return * * ReactListFix: * * ReactNos = Reactor_Services('GetReactorNumbers') * For each ReactNo in ReactNos using @FM * HaveLock = Database_Services('GetKeyIDLock', 'REACT_STATUS', ReactNo) * If HaveLock then * OrigReactStatRec = Database_Services('ReadDataRow', 'REACT_STATUS', ReactNo) * ReactStatRec = OrigReactStatRec * If Error_Services('NoError') then * For Col = 1 to 9 * OrigList = OrigReactStatRec * If OrigList NE '' then * CleanList = '' * For each Val in OrigList using @VM * If Val NE 1 then CleanList<0, -1> = Val * Next Val * ReactStatRec = CleanList * end * Next Col * If OrigReactStatRec NE ReactStatRec then * Database_Services('WriteDataRow', 'REACT_STATUS', ReactNo, ReactStatRec, True$, False$, False$) * end else * Database_Services('ReleaseKeyIDLock', 'REACT_STATUS', ReactNo) * end * end * end * Next ReactNo * * return * * * * WMIn: * * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,REACTOR_LOG_EVENTS', '', '', '') * * return * * * Sched: * * Open 'SCHED_DET_NG' to hTable then * Select hTable * EOF = False$ * Loop * ReadNext KeyID else EOF = True$ * Until EOF * StartDtm = Xlate('SCHED_DET_NG', KeyID, 'START_DTM', 'X') * If DCount(StartDtm, @VM) GT 1 then debug * StopDtm = Xlate('SCHED_DET_NG', KeyID, 'STOP_DTM', 'X') * If DCount(StopDtm, @VM) GT 1 then debug * Repeat * end * * * return * * PushSched: * * Def = "" * Def = "Pushing data..." * Def = "GC" * Def = 114 * Def = 400 * MsgUp = Msg(@window, Def) * * Counter = 0 * KeyList = Database_Services('ReadDataRow', 'SYSLISTS', 'ACTIVE_WO') * For each Key in KeyList using @FM * Counter += 1 * Msg(@window, MsgUp, Counter, MSGINSTUPDATE$) * Copy_Record_To_SQL('WO_LOG', Key, True$) * Next Key * Msg(@window, MsgUp) ;* take down the gauge * Open 'WO_LOG' to hTable then * Select hTable * EOF = False$ * Counter = 0 * Loop * Counter += 1 * Msg(@window, MsgUp, Counter, MSGINSTUPDATE$) * ReadNext Key else EOF = True$ * Until EOF * Copy_Record_To_SQL('WO_LOG', Key, True$) * Repeat * Msg(@window, MsgUp) ;* take down the gauge * end * * return * * DateFix: * * debug * Keys = Schedule_Services('GetScheduleDetailKeys', Date() - 90, Date(), 35) * * return * * Reactors: * * debug * table = "RDS" * Open "DICT ":table To @DICT Else * RetVal = Set_FSError() * Return * End * Column = "DATE_OUT" * search_criteria = column:@VM:'01/01/23~01/11/23':@FM * keylist = "" * option = "" * flag = "" * Btree.Extract(search_criteria, table, @DICT, keylist, option, flag) * * return * * Testing: * * Def = "" * Def = "Populating performance data..." * Def = "GC" * Def = 600 * EndDate = IConv('12/01/22', 'D') * StartDate = IConv('01/13/23', 'D') * Counter = 0 * Def = StartDate - EndDate * MsgUp = Msg(@window, Def) * For ReportDate = StartDate to EndDate Step -1 * Counter += 1 * ConvReportDate = OConv(ReportDate, 'D4/') * Report_Services('CalcDailyPerformanceData', ConvReportDate) * While Msg(@window, MsgUp, Counter, MSGINSTUPDATE$) * Next ReportDate * Msg(@window, MsgUp) ;* take down the gauge * * return * * * EmailTest: * * debug * objLog = Logging_Services('NewLog', 'D:\Tmp', 'EmailLogTest.txt', @RM, @FM, '', '', '', False$) * LogData = 'This is a test' * Logging_Services('AppendLog', objLog, LogData, @FM, ',', '', 'Stieber.external@infineon.com,Jonathan.Ouellette@infineon.com', LogData) * * return * * EpiPart: * * debug * * KeyList = Database_Services('ReadDataRow', 'SYSLISTS', 'PROD_SPEC_6593_INACTIVE_PROD_VER') * * For each KeyID in KeyList using @FM * Rec = Database_Services('ReadDataRow', 'PROD_SPEC', KeyID) * If Error_Services('NoError') then * Rec = 'I' * Database_Services('WriteDataRow', 'PROD_SPEC', KeyID, Rec, True$, False$, True$) * If Error_Services('HasError') then * Error_Services('DisplayError') * end * end * Next KeyID * * KeyList = Database_Services('ReadDataRow', 'SYSLISTS', 'PROD_VER_6593_INACTIVE') * * For each KeyID in KeyList using @FM * Rec = Database_Services('ReadDataRow', 'PROD_VER', KeyID) * If Error_Services('NoError') then * Rec = 'I' * Database_Services('WriteDataRow', 'PROD_VER', KeyID, Rec, True$, False$, True$) * If Error_Services('HasError') then * Error_Services('DisplayError') * end * end * Next KeyID * * return * * * FormMetricsReport: * debug * ReportList = '' * List = Get_Repos_Entities('LSL2', 'OIWIN', '', False$) * For each Row in List using @FM setting fPos * ReportList = Field(Row, '*', 4) * Next Row * * FormMetrics = Database_Services('ReadDataRow', 'SYSLISTS', 'FORM_METRICS_20221216') * * LastLaunch = 0 * FormCounts = '' * EOF = False$ * * For each Key in FormMetrics using @FM setting fPos * * FormName = Field(Key, '*', 1) * Locate FormName in ReportList using @FM setting fPos then * FormCounts = FormCounts + 1 * end * * Next Key * * NumForms = DCount(ReportList, @FM) * For FormIndex = 1 to NumForms * FormCount = FormCounts * If FormCount EQ '' then FormCount = 0 * ReportList = FormCount * Next FormIndex * * ReportList = Insert(ReportList, 1, 0, 0, 'Form Name':@VM:'Launch Count') * Swap @VM with ',' in ReportList * Swap @FM with CRLF$ in ReportList * OSWrite ReportList on 'D:\FITemp\FormCounts20221216.csv' * * return * * RxType: * debug * Database_Services('ActivateRecord', 'RDS', 565182) * IF @RECORD<2> = '' THEN * @ANS = XLATE('PROD_SPEC',@RECORD<114>, PROD_SPEC_REACTOR_TYPE$, 'X' ) * END ELSE * @ANS = XLATE('REACTOR',@RECORD<2>,1,'X') * END * return * * * WMQty: * * For Cursor = 1 to 8 * ClearSelect Cursor * Next Cursor * * Open 'MAKEUP_WAFERS' to hTable then * Select hTable * EOF = False$ * Loop * ReadNext KeyID else EOF = True$ * Until EOF * WMOKey = Xlate('MAKEUP_WAFERS', KeyID, 'WM_OUT_NO', 'X') * If WMOKey NE '' then * Rec = Database_Services('ReadDataRow', 'WM_OUT', WMOKey) * Database_Services('WriteDataRow', 'WM_OUT', WMOKey, Rec) * end else * Rec = Database_Services('ReadDataRow', 'WO_MAT', KeyID) * Database_Services('WriteDataRow', 'WO_MAT', KeyID, Rec) * end * Repeat * end * * return * * CassStatus: * * WONo = @ID[1,'*'] * CassNo = @ID[-1,'B*'] * WMOStatus = obj_WM_Out('CurrStatus', WONo:'*1*':CassNo) * RepStatus = obj_WO_Mat('ReportStatus', @ID) * RepStatus = XLATE('WO_MAT',WONo:'*':CassNo,'REP_STATUS','X')[-1,'B':@VM] * IF RepStatus = '' OR RepStatus[1,3] NE 'WMO' THEN * WMOCurrStatus = Xlate('WM_OUT', '171227*1*21', 'CURR_STATUS', 'X') * @ANS = OCONV(WMOCurrStatus,'[WM_OUT_CURR_STATUS_CONV]') * END ELSE * @ANS = RepStatus * END * * * return * * PopulateSAPHoldDTM: * * debug * Open 'SAP_HOLD' to hTable then * Select hTable * EOF = False$ * Loop * Readnext KeyID else EOF = True$ * Until EOF * Read Rec from hTable, KeyID then * WOMatKey = Rec<2> * HoldFlag = Rec<4> * InvActions = Xlate('WO_MAT', WOMatKey, 'INV_ACTION', 'X') * InvDTMs = Xlate('WO_MAT', WOMatKey, 'INV_DTM', 'X') * If HoldFlag then * Locate 'HOLD_ON' in InvActions using @VM setting vPos then * TransDTM = InvDTMs<0, vPos> * end * end else * Locate 'HOLD_OFF' in InvActions using @VM setting vPos then * TransDTM = InvDTMs<0, vPos> * end * end * Rec<5> = TransDTM * Write Rec on hTable, KeyID else * ErrMsg('Error') * end * end * Repeat * end * * * return * * * Fix: * * debug * RDSKeys = Xlate('WO_STEP', '171611*1', 'RDS_KEY', 'X') * NumRDS = DCount(RDSKeys, @VM) * For RDSIndex = 1 to 8 * RDSNo = RDSKeys<0, RDSIndex> * RDSLayerKey = RDSNo:'*L1' * RDSLayerRec = Database_Services('ReadDataRow', 'RDS_LAYER', RDSLayerKey) * RDSLayerRec = 930 * Database_Services('WriteDataRow', 'RDS_LAYER', RDSLayerKey, RDSLayerRec, True$, False$, True$) * Next RDSIndex * * For each RDSNo in RDSKeys using @VM * RDSRec = Database_Services('ReadDataRow', 'RDS', RDSNo) * RDSRec = 7115 * RDSRec = 4546 * Database_Services('WriteDataRow', 'RDS', RDSNo, RDSRec, True$, False$, True$) * Next RDSNo * * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,REPORT_SERVICES_DEV5', '', '', '') * * return * * * CleanPM: * * debug * KeyList = Database_Services('ReadDataRow', 'SYSLISTS', 'TEST_DANIEL') * For each Key in KeyList using @FM setting fPos * Copy_Record_To_Sql('RDS', Key, 0) * Next Key * * * z * return * * * * UpdateRecipe: * * debug * RDSNos = Xlate('WO_STEP', '171626*1', 'RDS_KEY', 'X') * For each RDSNo in RDSNos using @VM * LayerKeys = Xlate('RDS', RDSNo, 'RDS_LAYER_KEYS', 'X') * For each LayerKey in LayerKeys using @VM setting vPos * LayerRec = Database_Services('ReadDataRow', 'RDS_LAYER', LayerKey) * LayerRec = 930 * Database_Services('WriteDataRow', 'RDS_LAYER', LayerKey, LayerRec) * LSId = Field(LayerKey, '*', 2) * obj_RDS_Layer('UpdateLimits',RDSNo:@RM:LSId) * Next LayerKey * Next RDSNo * * * return * * * TWProd: * * KeyList = Database_Services('ReadDataRow', 'SYSLISTS', 'TEST_DANIEL') * debug * Def = "" * Def = "Pushing RDS data to SCRAPE..." * Def = "GC" * Def = DCount(KeyList, @FM) * Def = 600 * MsgUp = Msg(@WINDOW, Def) ;* Start gas guage message * * For each Key in KeyList using @FM setting fPos * Copy_Record_To_Sql('RDS', Key, 0) * Running = Msg(@WINDOW, MsgUp, fPos, MSGINSTUPDATE$) ;* Update message * Next Key * * Msg(@WINDOW, MsgUp) * * return * * CleanSched: * * debug * KeyList = Database_Services('ReadDataRow', 'SYSLISTS', 'TEST_DANIEL') * For each Key in KeyList using @FM * Database_Services('DeleteDataRow', 'SCHED_DET_NG', Key) * Next Key * * * return * * Email: * * Recipients = 'DANIEL_ST' * SentFrom = 'OI_ADMIN' * Subject = 'Auto-Scheduler Error' * Message = 'Invalid START_DTM and STOP_DTM calculated in AdjustScheduleEvents for event CC4E8D2AAE2F4632BF761320553910D4.' * AttachWindow = '' * AttachKey = '' * SendToGroup = '' * Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup * obj_Notes('Create',Parms) * * * return * * WFRSOut: * * debug * WfrsOut = Xlate('RDS', 553940, 'WFRS_OUT', 'X') * WfrsOut := @SVM * WfrsLen = Len(WfrsOut) * CleanWfrs = '' * For CharIndex = 1 to WfrsLen * If Num(WfrsOut[CharIndex, 1]) then CleanWfrs := WfrsOut[CharIndex, 1] * Next CharIndex * * return * * * * WafersIn: * * * Copy_Record_To_SQL('REACT_RUN', 550886) * RDSRec = Database_Services('ReadDataRow', 'RDS', 550886) * WafersIn = 25:@SVM:'' * WafersIn = WafersIn<1,1,1> * * Array = '' * Array<1,1> = 1 * Array<1,2> = 1.1 * Array<2> = 2 * * Test_Daniel2() * debug * * return * * WOMatStatus: * * CINo = 2175647 * ErrorMessage = 'The clean & inspect record ':CINo:' has been updated since the form was opened! ' * ErrorMessage := 'Metrology data has likely been imported since you read the record. ' * ErrorMessage := 'Please close the form and try again.' * ErrMsg('Save error!':@SVM:ErrorMessage) * * WOMatKey = '171358*54' * CassetteQty = XLATE('WO_MAT', WOMatKey, 'WAFER_QTY', 'X') * RejectedWafers = XLATE('WO_MAT', WOMatKey, 'TOT_REJ_WFRS', 'X') * RejectedMUWafers = XLATE('WO_MAT', WOMatKey, 'TOT_REJ_MU_WFRS', 'X') * ProdTestWafers = XLATE('WO_MAT', WOMatKey, 'TW_PROD','X') * CurrWfrCount = XLATE('WO_MAT', WOMatKey, 'CURR_WFR_CNT', 'X') * * * return * * * CleanRepMan: * debug * Open 'REPLICATION_QUEUE_LSL2_WM_OUT' to TableHandle then * Select TableHandle * EOF = False$ * Loop * ReadNext @ID else EOF = True$ * Until EOF * TransType = Field(@ID, '*', 1) * If TransType EQ 'WRITE' or TransType EQ 'DELETE' then * Delete TableHandle, @ID then Null * end * Repeat * end * * return * * * * * * * * * CleanRDS: * debug * RDSNo = NextKey('RDS') * * // Delete old instance of this RDS if it exists ------------------------------------------------------------------------ * If RowExists('RDS', RDSNo) then * Database_Services('DeleteDataRow', 'RDS', RDSNo, True$, False$) * If Error_Services('NoError') then * Results = 'RDS ' : RDSNo : ' deleted' * end else * Results = 'RDS ' : RDSNo : ' not deleted. Error : ' : Error_Services('GetMessage') * end * end * // --------------------------------------------------------------------------------------------------------------------- * * * // Delete related RDS_LAYER records ------------------------------------------------------------------------------------ * Layers = 'L1,L2,2' * For each Layer in Layers using ',' * RDSLayerKey = RDSNo:'*':Layer * If RowExists('RDS_LAYER', RDSLayerKey) then * // Look for related RDS_TEST records and delete them first * RDSTestKeys = Xlate('RDS_LAYER', RDSLayerKey, 'RDS_TEST_KEYS', 'X') * If RDSTestKeys NE '' then * For each RDSTestKey in RDSTestKeys using @VM setting vPos * // Look for related TW_USE records and delete them first * TWKeys = Xlate('RDS_TEST', RDSTestKey, 'TW_USE_ID', 'X') * If TWKeys NE '' then * For each TWKey in TWKeys using @VM setting vPos * Database_Services('DeleteDataRow', 'TW_USE', TWKey, True$, True$) * Next TWKey * end * Database_Services('DeleteDataRow', 'RDS_TEST', RDSTestKey, True$, True$) * Next RDSTestKey * end * Database_Services('DeleteDataRow', 'RDS_LAYER', RDSLayerKey, True$, False$) * If Error_Services('NoError') then * Results = 'RDS_LAYER ' : RDSLayerKey : ' deleted' * end else * Results = 'RDS_LAYER ' : RDSLayerKey : ' not deleted. Error : ' : Error_Services('GetMessage') * end * end * Next Layer * // --------------------------------------------------------------------------------------------------------------------- * * * // Delete old REACT_RUN record if it exists ---------------------------------------------------------------------------- * If RowExists('REACT_RUN', RDSNo) then * // Delete old CLEAN_INSP record(s) if they exist * CIKeys = Xlate('REACT_RUN', RDSNo, 'CI_NO', 'X') * For each CIKey in CIKeys using @VM setting vPos * If RowExists('CLEAN_INSP', CIKey) then * Database_Services('DeleteDataRow', 'CLEAN_INSP', CIKey, True$, False$) * If Error_Services('NoError') then * Results = 'CLEAN_INSP ' : CIKey : ' deleted' * end else * Results = 'CLEAN_INSP ' : CIKey : ' not deleted. Error : ' : Error_Services('GetMessage') * end * end * Next CIKey * Database_Services('DeleteDataRow', 'REACT_RUN', RDSNo, True$, False$) * If Error_Services('NoError') then * Results = 'REACT_RUN ' : RDSNo : ' deleted' * end else * Results = 'REACT_RUN ' : RDSNo : ' not deleted. Error : ' : Error_Services('GetMessage') * end * end * // --------------------------------------------------------------------------------------------------------------------- * * * * return * * * RDSKey: * * Debug * * * return * * * RDSTest: * * DateIn = Xlate('RDS', 456789, 'DATE_IN', 'X') * * * Fields = Xlate('DICT.WO_MAT', '%FIELDS%', 3, 'X') * For each Field in Fields using @VM setting vPos * Val = Xlate('WO_MAT', '171151*58', Field, 'X') * Next Field * * * return * * * RepTest: * * Debug * OITarget = Replication_Services('GetTargetServerPath') * * return * * * TestMsg: * * Def = "" * Def = '*' * Def = 'INFINEON' * Def = 'Success' * Def = "Metrology limits update complete!" * Def = "BO" * MsgUp = Msg(@window, Def) * return * * * SAPYield: * * debug * Yield = Xlate('WO_MAT', '171379*1', 'SAP_YIELD', 'X') * * * return * * * Push: * * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,NDW_RDS_UPDATE_MET_LIMITS_EVENTS', '', '', '') * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,WORK_ORDER_SERVICES', '', '', '') * * return * * Verify: * * WOList = 171402 * WOList<-1> = 171396 * WOList<-1> = 171179 * WOList<-1> = 171069 * * For each WorkOrderNo in WOList using @FM * If RowExists('WO_LOG', WorkOrderNo) then * Work_Order_Services('UpdateReleasedQty', WorkOrderNo) * WORec = Database_Services('ReadDataRow', 'WO_LOG', WorkOrderNo) * WOQty = WORec * RXQty = obj_WO_Log('RxQty', WorkOrderNo:@RM:WORec) * RelQty = obj_WO_Log('RelQty', WorkOrderNo:@RM:WORec) * If RelQty GT WOQty then * UnRelQty = 0 * end else * UnRelQty = WOQty - RelQty * end * ShipQty = obj_WO_Log('ShipQty', WorkOrderNo:@RM:WORec) * RxQtyStatic = Xlate('WO_LOG', WorkOrderNo, 'RX_QTY_STATIC', 'X') * RelQtyStatic = Xlate('WO_LOG', WorkOrderNo, 'REL_QTY_STATIC', 'X') * UnRelQtyStatic = Xlate('WO_LOG', WorkOrderNo, 'UNREL_QTY_STATIC', 'X') * ShipQtyStatic = Xlate('WO_LOG', WorkOrderNo, 'SHIP_QTY_STATIC', 'X') * If RxQty NE RxQtyStatic then * Error<-1> = WorkOrderNo : ' RX_QTY mismatch' * Work_Order_Services('UpdateReceivedQty', WorkOrderNo) * end * If RelQty NE RelQtyStatic or UnRelQty NE UnRelQtyStatic then * Error<-1> = WorkOrderNo : ' REL_QTY and/or UNREL_QTY mismatch' * Work_Order_Services('UpdateReleasedQty', WorkOrderNo) * end * If ShipQty NE ShipQtyStatic then * Error<-1> = WorkOrderNo : ' SHIP_QTY mismatch' * Work_Order_Services('UpdateShippedQty', WorkOrderNo) * end * end * Next WorkOrderNo * * return * * WOAudit: * debug * Error = '' * * NextWO = Xlate('DICT.WO_LOG', '%SK%', 1, 'X') * LastWO = NextWO - 1 * * NumWO = LastWO - 171000 * Def = "" * Def = "Verifying work order quantities..." * Def = "GC" * Def = NumWO * Def = 600 * MsgUp = Msg(@WINDOW, Def) ;* Start gas guage message * Counter = 1 * For WorkOrderNo = LastWO to 171000 Step -1 * Running = Msg(@WINDOW, MsgUp, Counter, MSGINSTUPDATE$) ;* Update message * If RowExists('WO_LOG', WorkOrderNo) then * WORec = Database_Services('ReadDataRow', 'WO_LOG', WorkOrderNo) * WOQty = WORec * RXQty = obj_WO_Log('RxQty', WorkOrderNo:@RM:WORec) * RelQty = obj_WO_Log('RelQty', WorkOrderNo:@RM:WORec) * If RelQty GT WOQty then * UnRelQty = 0 * end else * UnRelQty = WOQty - RelQty * end * ShipQty = obj_WO_Log('ShipQty', WorkOrderNo:@RM:WORec) * RxQtyStatic = Xlate('WO_LOG', WorkOrderNo, 'RX_QTY_STATIC', 'X') * RelQtyStatic = Xlate('WO_LOG', WorkOrderNo, 'REL_QTY_STATIC', 'X') * UnRelQtyStatic = Xlate('WO_LOG', WorkOrderNo, 'UNREL_QTY_STATIC', 'X') * ShipQtyStatic = Xlate('WO_LOG', WorkOrderNo, 'SHIP_QTY_STATIC', 'X') * If RxQty NE RxQtyStatic then * Error<-1> = WorkOrderNo : ' RX_QTY mismatch' * Work_Order_Services('UpdateReceivedQty', WorkOrderNo) * end * If RelQty NE RelQtyStatic or UnRelQty NE UnRelQtyStatic then * Error<-1> = WorkOrderNo : ' REL_QTY and/or UNREL_QTY mismatch' * Work_Order_Services('UpdateReleasedQty', WorkOrderNo) * end * If ShipQty NE ShipQtyStatic then * Error<-1> = WorkOrderNo : ' SHIP_QTY mismatch' * Work_Order_Services('UpdateShippedQty', WorkOrderNo) * end * end * Counter += 1 * Next WorkOrderNo * * Msg(@WINDOW,MsgUp) * * Database_Services('WriteDataRow', 'SYSLISTS', 'WO_QTY_ERROR', Error) * * return * * * UpdateWorkOrderQuantities: * * debug * StartDate = Date() - 120 * EndDate = Date() + 120 * SchedDetKeyIDs = Schedule_Services('GetScheduleDetailKeys', StartDate, EndDate) * If SchedDetKeyIDs NE '' then * NumKeys = DCount(SchedDetKeyIDs, @FM) * Def = "" * Def = "Populating work order quantities..." * Def = "GC" * Def = NumKeys * Def = 600 * MsgUp = Msg(@WINDOW, Def) ;* Start gas guage message * * For Each SchedDetKeyID in SchedDetKeyIDs using @FM setting fPos * Running = Msg(@WINDOW, MsgUp, fPos, MSGINSTUPDATE$) ;* Update message * SchedDetRec = Database_Services('ReadDataRow', 'SCHED_DET_NG', SchedDetKeyID) * WorkOrderNo = SchedDetRec * Work_Order_Services('UpdateReceivedQty', WorkOrderNo) * Work_Order_Services('UpdateReleasedQty', WorkOrderNo) * Work_Order_Services('UpdateShippedQty', WorkOrderNo) * * Next SchedDetKeyID * end * * Msg(@WINDOW,MsgUp) * * return * * SAPAudit: * * WONo = 171188 * WOMatKeys = Xlate('WO_LOG', WONo, 'WO_MAT_KEY', 'X') * BatchIds = Xlate('WO_LOG', WONo, 'SAP_BATCH_NO', 'X') * SAPYields = Xlate('WO_LOG', WONo, 'WO_MAT_SAP_YIELD', 'X') * SAPScrap = Xlate('WO_LOG', WONo, 'WO_MAT_SAP_CONFIRM_SCRAP', 'X') * * ReportData = 'WO_MAT Key, SAP Batch Id, SAP Yield, SAP Scrap':CRLF$ * For each WOMatKey in WOMatKeys using @VM setting vPos * ReportData := WOMatKey:',':BatchIds<0, vPos>:',':SAPYields<0, vPos>:',':SAPScrap<0, vPos>:CRLF$ * Next WOMatKey * * OSWrite ReportData on 'D:\FITemp\SAPExport.csv' * * return * * * PushCode: * * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,OBJ_REACT_STATUS', '', '', '') * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,RDS_UNLOAD_EVENTS', '', '', '') * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,DBW_RDS_OVERVIEW_NEPP_EVENTS', '', '', '') * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,SCAN_SERVICES', '', '', '') * * return * * * CleanEPP: * debug * WONo = 171177 * CassList = Database_Services('ReadDataRow', 'SYSLISTS', 'TEST_DANIEL') * For each CassNo in CassList using @FM setting fPos * WMIKey = WONo:'*1*':CassNo * WMOKey = WONo:'*1*':CassNo * WOMatKey = WONo:'*':CassNo * Database_Services('DeleteDataRow', 'WM_IN', WMIKey) * Database_Services('DeleteDataRow', 'WM_OUT', WMOKey) * Database_Services('DeleteDataRow', 'WO_MAT', WOMatKey) * Next CassNo * * For CassNo = 39 to 52 Step 1 * WMOKey = WONo:'*1*':CassNo * Database_Services('DeleteDataRow', 'WM_OUT', WMOKey) * Next CassNo * * return * * * QAMetUpdate: * debug * WONo = 171309 * * For CassNo = 8 to 24 * WOMatQAKey = WONo:'*':CassNo * //PSN_Services('UpdateQAMetrologyLimits', WOMatQAKey, 'QA', '1ADE', 'L') * PSN_Services('UpdateAllQAMetrologyLimits', WOMatQAKey) * If Error_Services('HasError') then ErrMsg(Error_Services('GetMessage')) * Next CassNo * debug * return * * * ReactStatus: * * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,REPORT_SERVICES_DEV', '', '', '') * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,OBJ_REACT_STATUS', '', '', '') * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,QA_SERVICES', '', '', '') * * return * * FormList: * * ReportList = '' * List = Get_Repos_Entities('LSL2', 'OIWIN', '', False$) * For each Row in List using @FM setting fPos * ReportList = Field(Row, '*', 4) * Next Row * * LastLaunch = 0 * FormCounts = '' * EOF = False$ * Open 'FORM_METRICS' to hTable then * Select hTable * Loop * Readnext Key else EOF = True$ * Until EOF * FormName = Field(Key, '*', 1) * Locate FormName in ReportList using @FM setting fPos then * FormCounts = FormCounts + 1 * end * Repeat * end * * NumForms = DCount(ReportList, @FM) * For FormIndex = 1 to NumForms * FormCount = FormCounts * If FormCount EQ '' then FormCount = 0 * ReportList = FormCount * Next FormIndex * * ReportList = Insert(ReportList, 1, 0, 0, 'Form Name':@VM:'Launch Count') * Swap @VM with ',' in ReportList * Swap @FM with CRLF$ in ReportList * OSWrite ReportList on 'D:\FITemp\FormCounts.csv' * * return * * TestRep: * debug * KeyList = 73468 * For each KeyID in KeyList using @FM setting fPos then * TableName = 'NOTES' * * If TableName NE '' and KeyID NE '' then * TransID = '' * TransID<1> = 'WRITE' * TransID<2> = 'LSL2' * TransID<3> = 'LSL' * TransID<4> = TableName * TransID<5> = KeyID * Write_OI_To_Sql(TransID) * end * * //Running = Msg(@WINDOW, MsgUp, fPos, MSGINSTUPDATE$) ;* Update message * Next KeyID * return * * * * * * SendEmail: * * ConfigFile = '' * ConfigFile<1> = SendUsing_Port$ * ConfigFile<2> = '' * ConfigFile<3> = 25 ;* Server port * *ConfigFile<4> = 'appmail.eu.infineon.com' ;* IFX Mail server * ConfigFile<4> = 'mailrelay-external.infineon.com' * ConfigFile<5> = Yes$ ;* Authenticate * ConfigFile<6> = 'oinotify@infineon.com' ;* Username * ConfigFile<7> = 'oinotify1' ;* Password * ConfigFile<8> = No$ ;* Use SSL * * SentFrom = 'oinotify@infineon.com' * * Message = '' * Message<1> = 'Test' ; * Subject * Message<2> = SentFrom ; * From (email address) * Message<3> = 'dstieber@srpcs.com'; * Send to (email address) * Message<5> = '' ; * Blind Carbon Copy (email address) * Message<6> = '' ; * Reply To (email address) * Message<7> = 'TEXT' ; * Content Type (TEXT or HTML) * Message<8> = 'Testing' ; * Content / Body * Message<9> = '' ; * Attachment(s) (path to file name(s)) * * MsgSent = SRP_Send_Mail(Message, ConfigFile) * * return * * TestText: * * PrintPath = 'ZEBRA01' * NewPrintPath = Dialog_Box('NDW_EDIT_TEXT', @Window, PrintPath) * debug * * return * * * PushFix: * * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,REPORT_SERVICES_DEV2', '', '', '') * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,PRINTSETUP', '', '', '') * * return * * * KeyCheck: * * Open 'WO_MAT' to hTable then * Query = 'SELECT WO_MAT' * RList(Query, TARGET_ACTIVELIST$, '', '', '') * KeyID = '' * EOF = False$ * Counter = 0 * Loop * Counter += 1 * Readnext KeyID, Value else EOF = True$ * Until EOF * If Value then * !!! Error @VM in key ID * DEBUG * end else * Read Rec from hTable, KeyID else * !!! Error @FM in key ID * DEBUG * end * end * Send_Info('Key ':KeyID:' Loop ':Counter:' of ':@RecCount) * Repeat * * * end * * return * * * Location: * * * CurrLoc = Xlate('WO_MAT', '171087*16', 'CURR_LOCATION', 'X') * * return * * * TestDebug: * * S.WONo = '171087' * * CRLocs = '' * CRLocs<0, -1> = 'CR*BE' * CRLocs<0, -1> = 'CR*BO' * CRLocs<0, -1> = 'CR*TUN' * CRLocs<0, -1> = 'CR*EPR' * CRLocs<0, -1> = 'CR*FE' * CRLocs<0, -1> = 'CR*FEH' * CRLocs<0, -1> = 'CR*FO' * CRLocs<0, -1> = 'CR*FOH' * * LoadedData = '' * LocQueryList = CRLocs * * If @User4 EQ 'DANIEL_ST' and S.WONo EQ '171087' then debug * LoadedCassList = '' * ReactType = Xlate('WO_LOG', S.WONo, 'REACT_TYPE', 'X') * If ReactType NE 'EPP' then * If LocQueryList NE '' then * LoadedData = Location_Services('GetLocationCassInfoRList', S.WONo, LocQueryList) * end * end * * return * * * RejQty: * * Debug * WOMatKeys = '170520*11' ; //'171149*40':@VM:'170804*21' * For each WOMatKey in WOMatKeys using @VM setting vPos * WorkOrderNo = Field(WOMatKey, '*', 1) * ReactorType = XLATE('WO_LOG', WorkOrderNo, 'REACT_TYPE', 'X') * ReactorType = Field(ReactorType, @VM, 1) * CassetteQty = XLATE('WO_MAT', WOMatKey, 'WAFER_QTY', 'X') * RejectedWafers = XLATE('WO_MAT', WOMatKey, 'TOT_REJ_WFRS', 'X') * RejectedMUWafers = XLATE('WO_MAT', WOMatKey, 'TOT_REJ_MU_WFRS', 'X') * ProdTestWafers = XLATE('WO_MAT', WOMatKey, 'TW_PROD','X') * CurrWfrCount = XLATE('WO_MAT', WOMatKey, 'CURR_WFR_CNT', 'X') * * IF (RejectedWafers = '') then * RejectedWafers = 0 * END * IF (RejectedMUWafers = '') then * RejectedMUWafers = 0 * END * IF (ProdTestWafers = '') then * ProdTestWafers = 0 * END * * IF ((ReactorType = 'EPP') OR (ReactorType = 'EpiPro')) THEN * RejectedQty = RejectedWafers + RejectedMUWafers * END ELSE * RejectedQty = RejectedWafers + RejectedMUWafers + ProdTestWafers * END * * If ( (CurrWfrCount EQ 0) and (RejectedQty GE CassetteQty) ) then * Null ; // Mark cassette as full box reject * end * Next WOMatKey * * * RejectedWafers = 0 * RejectedMUWafers = 0 * ProdTestWafers = 0 * * Set_Status(0) * CassetteQty = XLATE('WO_MAT', WOMatKey, 'WAFER_QTY', 'X') * RejectedWafers = Sum(XLATE('WO_MAT', WOMatKey, 'TOT_REJ_WFRS', 'X')) * RejectedMUWafers = Sum(XLATE('WO_MAT', WOMatKey, 'TOT_REJ_MU_WFRS', 'X')) * * IF (RejectedWafers = '') then * RejectedWafers = 0 * END * IF (RejectedMUWafers = '') then * RejectedMUWafers = 0 * END * * RejectedQty = RejectedWafers + RejectedMUWafers * * return * * * Schedule: * * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,SCHEDULER_DEV_EVENTS', '', '', '') * * return * * * Status: * * debug * WOMatKey = '170964*21' * WMOKey = '170964*1*21' * WOMatRec = Database_Services('ReadDataRow', 'WO_MAT', WOMatKey) * WOMatStatus = obj_WO_Mat('CurrStatus', WOMatKey:@RM:WOMatRec) * ReportStatus = obj_WO_Mat('ReportStatus', WOMatKey:@RM:WOMatRec) * WMORec = Database_Services('ReadDataRow', 'WM_OUT', WMOKey) * WMOStatus = obj_WM_Out('CurrStatus', WMOKey:@RM:WMORec) * * * return * * CleanEvents: * debug * Events = Get_Repos_Entities('LSL2', 'OIEVENT', '', '', '', '', '') * For each Event in Events using @FM setting fPos * Key = 'LSL2*':Field(Event, '*', 3, 1):'*':Field(Event, '*', 4, 1) * Code = Database_Services('ReadDataRow', 'SYSREPOSEVENTS', Key) * OrigCode = Code * Swap '$insert sysprocs, ' with '$insert ' in Code * Swap '$INSERT SYSPROCS, ' with '$INSERT ' in Code * If Code NE OrigCode then * Database_Services('WriteDataRow', 'SYSREPOSEVENTS', Key, Code) * end * Next Event * * * // CleanStProcs * * StProcs = Get_Repos_Entities('LSL2', 'STPROC', '', '', '', '', '') * For each StProc in StProcs using @FM setting fPos * StProcName = Field(StProc, '*', 4, 1) * If StProcName NE 'TEST_DANIEL3' then * Key = StProcName:'*LSL2' * Code = Database_Services('ReadDataRow', 'SYSPROCS', Key) * OrigCode = Code * Swap '$insert sysprocs, ' with '$insert ' in Code * Swap '$INSERT SYSPROCS, ' with '$INSERT ' in Code * If Code NE OrigCode then * Database_Services('WriteDataRow', 'SYSPROCS', Key, Code) * end * end * Next StProc * * return * * * DeadCodeList: * * debug * DeadList = '' * STProcList = Get_Repos_Entities('LSL2', 'STPROC', '') * STProcList = SRP_Array('Rotate', STProcList, @FM, '*') * STProcList = STProcList<4> * STProcExeList = Get_Repos_Entities('LSL2', 'STPROCEXE', '') * STProcExeList = SRP_Array('Rotate', STProcExeList, @FM, '*') * STProcExeList = STProcExeList<4> * Swap '*' with @FM in STProcList * Swap '*' with @FM in STProcExeList * For each STProc in StProcList using @FM setting fPos * Locate STProc in STProcExeList using @FM setting dummy else * DeadList<-1> = STProc * end * Next STProc * Swap @FM with CRLF$ in DeadList * OSWrite DeadList on 'C:\Users\StieberD\Desktop\DeadList.txt' * * return * * * * PushSchema: * * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,COMM_RECIPE', '', '', '') * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,COPY_RDS_LAYER_RECORD_TO_SQL', '', '', '') * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,COPY_RECIPE_RECORD_TO_SQL', '', '', '') * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,OBJ_RDS_LAYER', '', '', '') * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,NDW_TOOL_PARMS_EVENTS', '', '', '') * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,OBJ_RECIPE', '', '', '') * * return * * * * * * ReactMode: * * debug * CurrModeKey = Xlate('REACTOR_CHILD_KEY_IDS_NG', 48, 1, 'X') * * * return * * * GanWIPJSON: * * JSON = Gan_Services('GetGaNWIPJSON') * * OSWrite JSON on 'C:\Users\StieberD\Documents\GaNWIP.json' * * * return * * * SAPScript: * * BadList = '' * KeyList = Database_Services('ReadDataRow', 'SYSLISTS', 'TEST_DANIEL8') * Def = "" * Def = "Scanning old records..." * Def = "GC" * Def = DCount(KeyList, @FM) * Def = 600 * MsgUp = Msg(@WINDOW, Def) ;* Start gas guage message * * For each Key in KeyList setting fPos * SAPBatchNo = Xlate('WO_MAT', Key, 'SAP_BATCH_NO', 'X') * SAPTxDTM = Xlate('WO_MAT', Key, 'SAP_TX_DTM', 'X') * IF SAPBatchNo[-1,1] EQ 'R' and SAPTxDTM EQ '' then * BadList<-1> = Key * end * Running = Msg(@WINDOW, MsgUp, fPos, MSGINSTUPDATE$) ;* Update message * Next Key * Database_Services('WriteDataRow', 'SYSLISTS', 'TEST_DANIEL9', BadList) * Msg(@WINDOW,MsgUp) * * * BadList = '' * KeyList = Database_Services('ReadDataRow', 'SYSLISTS', 'TEST_DANIEL10') * Def = "" * Def = "Scanning new records..." * Def = "GC" * Def = DCount(KeyList, @FM) * Def = 600 * MsgUp = Msg(@WINDOW, Def) ;* Start gas guage message * * For each Key in KeyList setting fPos * SAPBatchNo = Xlate('WO_MAT', Key, 'SAP_BATCH_NO', 'X') * SAPTxDTM = Xlate('WO_MAT', Key, 'SAP_TX_DTM', 'X') * IF SAPBatchNo[-1,1] EQ 'R' and SAPTxDTM EQ '' then * BadList<-1> = Key * end * Running = Msg(@WINDOW, MsgUp, fPos, MSGINSTUPDATE$) ;* Update message * Next Key * Database_Services('WriteDataRow', 'SYSLISTS', 'TEST_DANIEL11', BadList) * Msg(@WINDOW,MsgUp) * * * * * return * * * EPPMetReport: * * ReportData = '' * Headers = Database_Services('ReadDataRow', 'SYSLISTS', 'EPP_METROLOGY_HEADERS') * Columns = Xlate('EXPORTS', 'EPIPRO_METOROLGY', 'COLUMNS', 'X') * Swap @FM with @VM in Headers * ReportData<1> = Headers * * RDSFields = Database_Services('ReadDataRow', 'DICT.RDS', '%FIELDS%') * RDSColumns = RDSFields * RDSConvs = RDSFields * * WMOList = Database_Services('ReadDataRow', 'SYSLISTS', 'WM_OUT_401678F_20210831') * NumWMO = DCount(WMOList, @FM) * * Def = "" * Def = "Building report..." * Def = "GC" * Def = NumWMO * Def = 600 * MsgUp = Msg(@WINDOW, Def) ;* Start gas guage message * * For each WMOKey in WMOList using @FM setting fPos * Running = Msg(@WINDOW, MsgUp, fPos, MSGINSTUPDATE$) ;* Update message * RowIndex = fPos + 1 * ThisRDSList = Xlate('WM_OUT', WMOKey, 'RDS', 'X') * Zones = Xlate('WM_OUT', WMOKey, 'ZONE', 'X') * Pockets = Xlate('WM_OUT', WMOKey, 'POCKET', 'X') * SAPBatchNo = Xlate('WM_OUT', WMOKey, 'SAP_BATCH_NO', 'X') * PrevRDSNo = '' * For each RDSNo in ThisRDSList using @VM setting SlotNo * If RDSNo NE PrevRDSNo then Database_Services('ActivateRecord', 'RDS', RDSNo) * ReportRow = '' * For each Column in Columns using @VM setting cPos * Locate Column in RDSColumns using @VM setting ConvPos then * Conv = RDSConvs<0, ConvPos> * Begin Case * Case Column EQ 'WO' * ReportRow<0, cPos> = Field(WMOKey, '*', 1) * Case Column EQ 'SEQ' * ReportRow<0, cPos> = RDSNo * Case Column EQ 'ZONE' * ReportRow<0, cPos> = Zones<0, SlotNo> * Case Column EQ 'POCKET' * ReportRow<0, cPos> = Pockets<0, SlotNo> * Case Column EQ 'WM_OUT_KEY' * ReportRow<0, cPos> = WMOKey * Case Column EQ 'OUT_CASS_NO' * ReportRow<0, cPos> = Field(WMOKey, '*', 3) * Case Column EQ 'OUT_SLOT_NO' * ReportRow<0, cPos> = SlotNo * Case Column EQ 'SAP_BATCH_NO' * ReportRow<0, cPos> = SAPBatchNo * Case Otherwise$ * If Conv EQ '' then * ReportRow<0, cPos> = Calculate(Column) * end else * ReportRow<0, cPos> = OConv(Calculate(Column), Conv) * end * End Case * end * Next Column * PrevRDSNo = RDSNo * ReportData<-1> = ReportRow * Next RDSNo * * Next WMOKey * * Swap @VM with ',' in ReportData * Swap @FM with CRLF$ in ReportData * OSWrite ReportData on 'D:\FITemp\EPPMetReport.csv' * Msg(@WINDOW,MsgUp) * * return * * * SelectEPP: * * // DateOut GT 08/31/2021 = 19602 * RDSList = '' * WMOList = Database_Services('ReadDataRow', 'SYSLISTS', 'WM_OUT_401678F') * FilterWMOList = '' * NumWMO = DCount(WMOList, @FM) * For WMOIndex = 1 to NumWMO * Done = False$ * WMOKey = WMOList * ThisRDSList = Xlate('WM_OUT', WMOKey, 'RDS', 'X') * ThisRDSList = SRP_Array('Clean', ThisRDSList, 'TrimAndMakeUnique', @VM) * For each RDSNo in ThisRDSList using @VM * DateOut = Xlate('RDS', RDSNo, 'DATE_OUT', 'X') * If DateOut GT 19602 then * FilterWMOList<-1> = WMOKey * Done = True$ * end * Until Done * Next RDSNo * Next WMOIndex * Database_Services('WriteDataRow', 'SYSLISTS', 'WM_OUT_401678F_20210831', FilterWMOList) * * return * * * WfrCnt: * * WOMatKey = '171038*13' * WOMatRec = Database_Services('ReadDataRow', 'WO_MAT', WOMatKey) * debug * CurrWfrCnt = obj_WO_Mat('CurrWaferCnt', WOMatKey:@RM:WOMatRec) * * * return * * * * RDSList: * * RDSList = Database_Services('ReadDataRow', 'SYSLISTS', 'TEST_DANIEL_8') * For each RDSNo in RDSList using @FM * Database_Services('ActivateRecord', 'RDS', RDSNo) * RejCnt1 = SUM(XLATE('NCR', {NCR_KEYS}, 'REJ_CNT', 'X')) * RejCnt2 = {CUST_TOT_REJ} + {LSL_TOT_REJ} * If RejCnt1 NE RejCnt2 then * debug * end * * Next RDSNo * * * return * * * CustScrap: * * SearchDir = 'D:\FTP\FTP_IN_REPOSITORY\Batch\2022\03 (March)\' * InitDir SearchDir:'*' * FileList = DirList() * For each Filename in FileList using @FM * * OSRead FileData from SearchDir:Filename then * Swap TAB$ with @FM in FileData * If (Index(FileData, 'M015833', 1)) then * debug * end * end * Next Filename * * return * * YieldReport: * * WafersIn = 0 * WafersOut = 0 * CustScrap = 0 * IFXScrap = 0 * ProdTest = 0 * SRPTotal = 0 * * RDSList = Database_Services('ReadDataRow', 'SYSLISTS', 'TEST_DANIEL5') * For each RDSNo in RDSList using @FM * WafersIn += Xlate('RDS', RDSNo, 'WAFERS_IN', 'X') * WafersOut += Xlate('RDS', RDSNo, 'WFRS_OUT', 'X') * * // Scrap * ThisCustScrap = Xlate('RDS', RDSNo, 'CUST_TOT_REJ', 'X') * ThisIFXScrap = Xlate('RDS', RDSNo, 'LSL_TOT_REJ', 'X') * CustScrap += ThisCustScrap * IFXScrap += ThisIFXScrap * * // Prod Test * RDSLayerKeys = Xlate('RDS', RDSNo, 'RDS_LAYER_KEYS', 'X') * RDSTestKeys = Xlate('RDS_LAYER', RDSLayerKeys, 'RDS_TEST_KEYS', 'X') * ThisProdTest = obj_RDS_Test('ProdTestCount', RDSTestKeys) * ProdTest += ThisProdTest * * // SRP * SRPTotal += Xlate('RDS', RDSNo, 'RESEARCH_SRP_BILLABLE', 'X') * * Next RDSNo * * Debug * * return * * * ManRep: * * debug * For SK = 1667 to 1702 * TransactionID = Database_Services('ReadDataRow', 'REPLICATION_QUEUE_LSL2_WO_MAT', SK) * Write_OI_To_SQL(TransactionID) * If Error_Services('NoError') then * Database_Services('DeleteDataRow', 'REPLICATION_QUEUE_LSL2_WO_MAT', SK) * end * Next SK * * * * return * * * EPPReport: * * OSRead Report from 'D:\FITemp\book2.csv' then * * Swap CRLF$ with @FM in Report * Swap ',' with @VM in Report * NumRows = DCount(Report, @FM) * * Def = "" * Def = "Updating report..." * Def = "GC" * Def = NumRows * Def = 600 * MsgUp = Msg(@WINDOW, Def) ;* Start gas guage message * Running = Msg(@WINDOW, MsgUp, 1, MSGINSTUPDATE$) ;* Update message * * For RowIndex = 2 to NumRows * Row = Report * WONo = Row<0, 10> * CassNo = Row<0, 16> * WMOKey = WONo:'*1*':CassNo * If RowExists('WM_OUT', WMOKey) then * SAPBatchNo = Xlate('WM_OUT', WMOKey, 'SAP_BATCH_NO', 'X') * Row<0, 13> = SAPBatchNo * Report = Row * end * Running = Msg(@WINDOW, MsgUp, RowIndex, MSGINSTUPDATE$) ;* Update message * Next RowIndex * end * * Swap @FM with CRLF$ in Report * Swap @VM with ',' in Report * OSWrite Report on 'D:\FITemp\book3.csv' * Msg(@WINDOW,MsgUp) * * return * * * FormList: * * ReportList = '' * List = Get_Repos_Entities('LSL2', 'OIWIN', '', False$) * For each Row in List using @FM setting fPos * ReportList = Field(Row, '*', 4) * Next Row * * LastLaunch = 0 * FormCounts = '' * EOF = False$ * Open 'FORM_METRICS' to hTable then * Select hTable * Loop * Readnext Key else EOF = True$ * Until EOF * FormName = Field(Key, '*', 1) * If FormName EQ 'REACT_MODE_CHG' then * LaunchDTM = Field(Key, '*', 3) * If LaunchDTM GT LastLaunch then LastLaunch = LaunchDTM * end * Locate FormName in ReportList using @FM setting fPos then * FormCounts = FormCounts + 1 * end * Repeat * end * * debug * LastLaunch = OConv(LastLaunch, 'DT') * NumForms = DCount(ReportList, @FM) * For FormIndex = 1 to NumForms * FormCount = FormCounts * If FormCount EQ '' then FormCount = 0 * ReportList = FormCount * Next FormIndex * * ReportList = Insert(ReportList, 1, 0, 0, 'Form Name':@VM:'Launch Count') * Swap @VM with ',' in ReportList * Swap @FM with CRLF$ in ReportList * OSWrite ReportList on 'D:\FITemp\FormCounts.csv' * * return * * Fix: * debug * RDSList = Xlate('SYSLISTS', 'TEST_DANIEL6', '', 'X') * Open 'RDS' to TableVar then * Open 'DICT.RDS' to @Dict then * Make.List(0, RDSList, TableVar, @Dict) * * If Get_Status(errCodes) Then * FSMsg(errCodes) * end else * EOF = False$ * Loop * Readnext @ID else EOF = True$ * * Until EOF * * Repeat * end * end * end * * return * * RDSList = Database_Services('ReadDataRow', 'SYSLISTS', 'TEST_DANIEL_BAD') * * Def = "" * Def = "Scanning records..." * Def = "GC" * Def = DCount(RDSList, @FM) * Def = 600 * MsgUp = Msg(@WINDOW, Def) ;* Start gas guage message * * For each RDSNo in RDSList using @FM setting fPos * RRRec = Database_Services('ReadDataRow', 'REACT_RUN', RDSNo) * WfrStages = RRRec * Locate 'PLATO' in WfrStages using @VM setting PlatoPos then * Locate 'CAN_PRE' in WfrStages using @VM setting CanPrePos then * If PlatoPos LT CanPrePos then * BadList<-1> = RDSNo * end * end * end * GaNStageRoute = RRRec * Locate 'PLATO' in GaNStageRoute using @VM setting PlatoPos then * Locate 'CAN_PRE' in GaNStageRoute using @VM setting CanPrePos then * If PlatoPos LT CanPrePos then * Locate RDSNo in BadList using @FM setting bPos else * BadList<-1> = RDSNo * end * end * end * end * Running = Msg(@WINDOW, MsgUp, fPos, MSGINSTUPDATE$) ;* Update message * Next RDSNo * * Database_Services('WriteDataRow', 'SYSLISTS', 'TEST_DANIEL_BAD', BadList) * Msg(@WINDOW,MsgUp) * * return * * * Scan: * * debug * BadList = '' * RDSList = Database_Services('ReadDataRow', 'SYSLISTS', 'TEST_GAN') * * Def = "" * Def = "Scanning records..." * Def = "GC" * Def = DCount(RDSList, @FM) * Def = 600 * MsgUp = Msg(@WINDOW, Def) ;* Start gas guage message * * For each RDSNo in RDSList using @FM setting fPos * RRRec = Database_Services('ReadDataRow', 'REACT_RUN', RDSNo) * WfrStages = RRRec * Locate 'PLATO' in WfrStages using @VM setting PlatoPos then * Locate 'CAN_PRE' in WfrStages using @VM setting CanPrePos then * If PlatoPos LT CanPrePos then * BadList<-1> = RDSNo * end * end * end * GaNStageRoute = RRRec * Locate 'PLATO' in GaNStageRoute using @VM setting PlatoPos then * Locate 'CAN_PRE' in GaNStageRoute using @VM setting CanPrePos then * If PlatoPos LT CanPrePos then * Locate RDSNo in BadList using @FM setting bPos else * BadList<-1> = RDSNo * end * end * end * end * Running = Msg(@WINDOW, MsgUp, fPos, MSGINSTUPDATE$) ;* Update message * Next RDSNo * * Database_Services('WriteDataRow', 'SYSLISTS', 'TEST_DANIEL_BAD', BadList) * Msg(@WINDOW,MsgUp) * * return * * FormNames = '' * FormCounts = '' * EOF = False$ * Open 'FORM_METRICS' to hTable then * Select hTable * Loop * Readnext Key else EOF = True$ * Until EOF * FormName = Field(Key, '*', 1) * Locate FormName in FormNames using @VM setting vPos then * FormCounts<0, vPos> = FormCounts<0, vPos> + 1 * end else * FormNames<0, -1> = FormName * FormCounts<0, -1> = 1 * end * Repeat * end * ReportData = FormNames:@FM:FormCounts * * Swap @VM with ',' in ReportData * Swap @FM with CRLF$ in ReportData * OSWrite ReportData on 'D:\FITemp\FormCounts.csv' * * return * * debug * NCRRec = Database_Services('ReadDataRow', 'NCR', 185742) * RejQty = obj_NCR('RejQty', 185742:@RM:NCRRec) * * StationID = 'MESSA005_7300' * * NumLoop = 30 * LoopIndex = 1 * Loop * * Messaging_Services('SendMessage', 'RefreshSchedule', 'Response', @User4, 'DANIEL_ST', @User4, 'EventHandler', 'SCHEDULER_DEV' : ',OMNIEVENT,@MESSAGE,@ARGUMENTS') * LoopIndex += 1 * Sleepery(10000) * Until LoopIndex EQ NumLoop * Repeat * * end * * KeyList = Database_Services('ReadDataRow', 'SYSLISTS', 'TEST_DANIEL4') * For each Key in KeyList using @FM setting fPos * CurrStatus = Xlate('WO_MAT', '165242*39', 'CURR_STATUS', 'X') * Rec = Database_Services('ReadDataRow', 'WO_MAT', Key) * Database_Services('WriteDataRow', 'WO_MAT', Key, Rec, True$, False$, True$) * Next Key * * * Start_Window('NDW_FIND_LOCK_OWNER', '', 'RDS':@FM:511791) * * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,NCR_ACTIONS', '', '', '') * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,COMM_DIALOG_TOOL_STATUS', '', '', '') * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,WO_DAILY_SCHED_ALL_COMM', '', '', '') * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,NCR_ACTIONS', '', '', '') * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,COMM_WO_MAT_WFR', '', '', '') * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,OBJ_WO_MAT', '', '', '') * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,OBJ_RDS2', '', '', '') * return * end * * debug * Wfrs = Material_Services('GetAvailableMakeupWafers', 170929) * Start_Window('NDW_MAKEUP_WAFER_NCR', '', 4723) * * return * * FormNames = '' * FormCounts = '' * EOF = False$ * Open 'FORM_METRICS' to hTable then * Select hTable * Loop * Readnext Key else EOF = True$ * Until EOF * FormName = Field(Key, '*', 1) * Locate FormName in FormNames using @VM setting vPos then * FormCounts<0, vPos> = FormCounts<0, vPos> + 1 * end else * FormNames<0, -1> = FormName * FormCounts<0, -1> = 1 * end * Repeat * end * ReportData = FormNames:@FM:FormCounts * * Swap @VM with ',' in ReportData * Swap @FM with CRLF$ in ReportData * OSWrite ReportData on 'D:\FITemp\FormCounts.csv' * * return * * Dialog_Box('NDW_FIND_LOCK_OWNER', '', 'RDS':@FM:508982) * debug * WONo = 170877 * For CassNo = 11 to 32 * WOMatKey = WONo:'*':CassNo * WOMatQARec = Database_Services('ReadDataRow', 'WO_MAT_QA', WOMatKey) * If Error_Services('NoError') then * Stages = WOMatQARec * Props = WOMatQARec * For each Stage in Stages using @VM setting vPos * Prop = Props<0, vPos> * If ( (Stage EQ 'UNLOAD' or Stage EQ 'QA') and (Prop EQ 'THICK') ) then * WOMatQARec = '2.81' * end * Next Stage * Database_Services('WriteDataRow', 'WO_MAT_QA', WOMatKey, WOMatQARec, True$, False$, True$) * end else * ErrMsg(Error_Services('GetMessage')) * end * Next CassNo * * * * * return * * debug * WONo = 170964 * For CassNo = 1 to 30 * WMKey = WONo:'*1*':CassNo * WMRec = Database_Services('ReadDataRow', 'WM_IN', WMKey) * Database_Services('WriteDataRow', 'WM_IN', WMKey, WMRec) * WMRec = Database_Services('ReadDataRow', 'WM_OUT', WMKey) * Database_Services('WriteDataRow', 'WM_OUT', WMKey, WMRec) * Next CassNo * return * Counter = 0 * Def = "" * Def = "Updating statuses..." * Def = "GC" * Def = 3038 * Def = 600 * MsgUp = Msg(@WINDOW, Def) ;* Start gas guage message * For RDSNo = 506000 to 509038 * Counter += 1 * Running = Msg(@WINDOW, MsgUp, Counter, MSGINSTUPDATE$) ;* Update message * Material_Services('UpdateRDSStatus', RDSNo) * Next RDSNo * Msg(@WINDOW,MsgUp) * List = Database_Services('ReadDataRow', 'SYSLISTS', 'TEST_DANIEL4') * Def = "" * Def = "Cleaning queue..." * Def = "GC" * Def = DCount(List, @FM) * Def = 600 * MsgUp = Msg(@WINDOW, Def) ;* Start gas guage message * For each Key in List using @FM setting fPos * Running = Msg(@WINDOW, MsgUp, fPos, MSGINSTUPDATE$) ;* Update message * Database_Services('DeleteDataRow', 'POST_LOG', Key) * * Next Key * Msg(@WINDOW,MsgUp) * return * Authenticated = False$ * * If MemberOf(@USER4, 'OI_ADMIN') then * ParentForm = 'NDW_MAIN' * end else * ParentForm = 'LSL_MAIN2' * end * Loop * debug * Response = Dialog_Box('NDW_VERIFY_USER', @Window, @USER4) * Authenticated = Response<1> * If Not(Authenticated) then * ErrorMessage = 'You must reauthenticate to continue running your old version of OpenInsight.' * rv = Msg('', '', 'OK', '', 'Authentication Required':@FM:ErrorMessage) * end * Until Authenticated * Repeat * Security_Services('VerifyUserSessions') * * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,OBJ_NCR', '', '', '') * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,COMM_NCR', '', '', '') * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,RDS_UNLOAD_EVENTS', '', '', '') * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,NCR_ACTIONS', '', '', '') * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,WORK_ORDER_SERVICES', '', '', '') * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,MATERIAL_SERVICES', '', '', '') * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,WO_LOG_ACTIONS', '', '', '') * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,REACT_RUN_ACTIONS', '', '', '') * * return * * * BadList = '' * WOMatKeys = Database_Services('ReadDataRow', 'SYSLISTS', 'TEST_DANIEL4') * NumKeys = DCount(WOMatKeys, @FM) * Def = "" * Def = "Scanning WO_MAT records..." * Def = "GC" * Def = NumKeys * Def = 600 * MsgUp = Msg(@WINDOW, Def) ;* Start gas guage message * For each WOMatKey in WOMatKeys using @FM setting fPos * Running = Msg(@WINDOW, MsgUp, fPos, MSGINSTUPDATE$) ;* Update message * WOMatRec = Database_Services('ReadDataRow', 'WO_MAT', WOMatKey) * NCRNos = WOMatRec * NCRFinalSigs = WOMatRec * NumClosedNCRs = 0 * For each NCRNo in NCRNos using @VM setting vPos * NCRStatus = Xlate('NCR', NCRNo, 'STATUS', 'X') * If NCRStatus EQ 'C' then NumClosedNCRs += 1 * Next NCRNo * NCRNoCnt = COUNT(NCRNos,@VM) + (NCRNos NE '') * NCRSigCnt = COUNT(NCRFinalSigs,@VM) + (NCRFinalSigs NE '') * * If ( (NCRNoCnt NE NCRSigCnt) and (NCRNoCnt EQ NumClosedNCRs) ) then * BadList<-1> = WOMatKey * end * Next WOMatKey * Database_Services('WriteDataRow', 'SYSLISTS', 'TEST_DANIEL4_BAD', BadList) * Msg(@WINDOW,MsgUp) ;* Take message down * return * * * Database_Services('ActivateRecord', 'RDS', 477390) * WOMatKey = {WO_MAT_KEY} * WOMatRepStatus = obj_WO_Mat('ReportStatus', WOMatKey) * WOMatCurrStatus = obj_WO_Mat('CurrStatus', WOMatKey) * WOMatRepStatus = XLATE('WO_MAT',{WO_MAT_KEY},'REP_STATUS','X') * RunStatus = XLATE('REACT_RUN',@ID,'RUN_STATUS','X') * * RunStatus = OCONV(RunStatus,'[RUN_STATUS_CONV]') * * BEGIN CASE * CASE WOMatRepStatus NE '' AND RunStatus NE '' * Ans = WOMatRepStatus * * CASE WOMatRepStatus = '' AND RunStatus NE '' * Ans = RunStatus * * CASE WOMatRepStatus NE '' AND RunStatus = '' * Ans = WOMatRepStatus * * CASE 1 * Ans = '' * END CASE * * * * Material_Services('UpdateRDSStatus', 477390) * RDSList = Xlate('WO_STEP', '170520*1', 'RDS_KEY', 'X') * For each RDSNo in RDSList using @VM setting vPos * Material_Services('UpdateRDSStatus', RDSNo) * Next RDSNo * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,RDS_ACTIONS', 'Procedure', '', '') * * return * * WMOList = '' * WMOList<1> = 19 * WMOList<2> = 20 * WMOList<3> = 21 * WMOList<4> = 22 * WMOList<5> = 23 * For each CassNo in WMOList using @FM * WMOKey = '170820*1*':CassNo * Material_Services('PostWMOutUpdateRequest', WMOKey) * Next CassNo * * RDSList = '' * RDSList<1> = 506491 * RDSList<2> = 506492 * RDSList<3> = 506499 * RDSList<4> = 506500 * RDSList<5> = 506501 * RDSList<6> = 506502 * RDSList<7> = 506519 * RDSList<8> = 506522 * RDSList<9> = 506530 * RDSList<10> = 506532 * RDSList<11> = 506533 * RDSList<12> = 506537 * RDSList<13> = 506538 * For each RDSNo in RDSList using @FM * Material_Services('UpdateRDSStatus', RDSNo) * RunStatus = obj_React_Run('RunStatus', RDSNo) * RDS_React_Run(RDSNo) * * * * Next RDSNo * * return * * Counter = 1 * ReportData = '' * ReportData<1, 1> = 'RDSNo' * ReportData<1, 2> = 'COMB_STATUS' * ReportData<1, 3> = 'COMB_STATUS_STATIC' * For RDSNo = 505143 to 506143 * Counter += 1 * CombStatus = Xlate('RDS', RDSNo, 'COMB_STATUS', 'X') * CombStatusStatic = Xlate('RDS', RDSNo, 'COMB_STATUS_STATIC', 'X') * ReportData = RDSNo * ReportData = CombStatus * ReportData = CombStatusStatic * Next RDSNo * Swap @FM with CRLF$ in ReportData * Swap @VM with ',' in ReportData * OSWrite ReportData on 'D:\apps\Temp\COMB_STATUS.csv' * * return * * * Process: * * debug * KeyList = Database_Services('ReadDataRow', 'SYSLISTS', 'TEST_DANIEL4') * KeyList = Delete(KeyList, 1, 0, 0) * For each Key in KeyList using @FM setting fPos * Database_Services('DeleteDataRow', 'SQL_BACKLOG', Key) * Next Key * * * * return * debug * Counter = 0 * ErrorList = '' * TableName = 'RDS' * CursorVar = '' * Flag = '' * SortList = '#SEQ' * ReduceScript = 'WITH {SEQ} LT 400000' * Mode = 1 ; // Use next cursor available * EOF = False$ * * Reduce(ReduceScript, SortList, Mode, TableName, CursorVar, Flag) * If Flag then * Select TableName By SortList Using CursorVar then * Def = "" * Def = "Populating RDS COMB_STATUS_STATIC..." * Def = "GC" * Def = @RecCount * Def = 600 * MsgUp = Msg(@WINDOW, Def) ;* Start gas guage message * Loop * Readnext KeyID using CursorVar by AT else EOF = True$ * Until EOF * Counter += 1 * Running = Msg(@WINDOW, MsgUp, Counter, MSGINSTUPDATE$) ;* Update message * Material_Services('UpdateRDSStatus', KeyID) * If Error_Services('HasError') then * ErrorList<-1> = KeyID * end * Repeat * End else * status = Set_FSError() * end * end * Msg(@WINDOW,MsgUp) ;* Take message down * Database_Services('WriteDataRow', 'SYSLISTS', 'TEST_DANIEL4', ErrorList) * * return * * * Script: * * Def = "" * Def = "Posting Requests..." * Def = "GC" * Def = 77442 * Def = 600 * MsgUp = Msg(@WINDOW, Def) ;* Start gas guage message * * Counter = 0 * For RDSNo = 428000 to 505442 * Counter += 1 * Material_Services('PostRDSUpdateRequest', RDSNo) * Running = Msg(@WINDOW, MsgUp, Counter, MSGINSTUPDATE$) ;* Update message * Next RDSNo * * Msg(@WINDOW,MsgUp) ;* Take message down * * return * * * CompileMessage: * * Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'DANIEL_ST', 'RTP27,NDW_TOOL_STATUS_GAN_EVENTS', 'Procedure', '', '') * * return * * FormNames = '' * FormCounts = '' * EOF = False$ * Open 'FORM_METRICS' to hTable then * Select hTable * Loop * Readnext Key else EOF = True$ * Until EOF * FormName = Field(Key, '*', 1) * Locate FormName in FormNames using @VM setting vPos then * FormCounts<0, vPos> = FormCounts<0, vPos> + 1 * end else * FormNames<0, -1> = FormName * FormCounts<0, -1> = 1 * end * Repeat * end * ReportData = FormNames:@FM:FormCounts * * Swap @VM with ',' in ReportData * Swap @FM with CRLF$ in ReportData * OSWrite ReportData on 'D:\FITemp\FormCounts.csv' * * return * * LoopIndex = 0 * Loop * LoopIndex += 1 * Messaging_Services('SendMessage', 'RefreshSchedule', 'Response', @User4, 'MESSA005_15076', @User4, 'EventHandler', 'SCHEDULER_DEV' : ',OMNIEVENT,@MESSAGE,@ARGUMENTS') * Sleepery(20000) * Until LoopIndex EQ 10 * Repeat * * * return * * * Open 'REPLICATION_QUEUE_LSL2_WO_MAT' to TableHandle then * Select TableHandle * EOF = False$ * Loop * ReadNext @ID else EOF = True$ * Until EOF * TransType = Field(@ID, '*', 1) * If TransType EQ 'WRITE' then * Delete TableHandle, @ID then Null * end * Repeat * end * * * * * * * * return * * WONo = 170528 * CassNo = 29 * WOMatKey = WONo:'*':CassNo * WOMatRec = Database_Services('ReadDataRow', 'WO_MAT', WOMatKey) * GRProps = obj_WO_Mat('GetGRProps', WOMatKey:@RM:WOMatRec) * GRWfrQty * ScrapQty * ProdTWQty * AvailMUWfrQty * MUCassIDs * MUCassQtys * * return * * * 483953 * BadList = '' * NextRDSKey = 475000 * StartRDSKey = 400000 * StopRDSKey = Xlate('DICT.RDS', '%SK%', '', 'X') - 1 * NumKeys = StopRDSKey - StartRDSKey * Counter = 0 * * Def = "" * Def = "Scanning RDS records..." * Def = "GC" * Def = NumKeys * Def = 600 * MsgUp = Msg(@WINDOW, Def) ;* Start gas guage message * * For RDSNo = StartRDSKey to StopRDSKey * Counter += 1 * WOMatKey = Xlate('RDS', RDSNo, 'WO_MAT_KEY', 'X') * MakeupBox = Xlate('WO_MAT', WOMatKey, 'MAKEUP_BOX', 'X') * If MakeupBox NE True$ then * InvLocs = Xlate('WO_MAT', WOMatKey, 'INV_LOCATION', 'X') * InvActions = Xlate('WO_MAT', WOMatKey, 'INV_ACTION', 'X') * Locate 'PTO' in InvLocs using @VM setting vPos else * QASig = Xlate('RDS', RDSNo, 'SUP_VER_SIG', 'X') * If QASig NE '' then * BadList<-1> = RDSNo * end * end * end * Running = Msg(@WINDOW, MsgUp, Counter, MSGINSTUPDATE$) ;* Update message * Next RDSNo * Database_Services('WriteDataRow', 'SYSLISTS', 'TEST_DANIEL5', BadList) * * Msg(@WINDOW,MsgUp) ;* Take message down * * return * * * Fixit: * debug * Timestamp = Datetime() * ErrorList = '' * KeyList = Database_Services('ReadDataRow', 'SYSLISTS', 'TEST_DANIEL4') * NumKeys = DCount(KeyList, @FM) * * Def = "" * Def = "Fixing Material Log Entries..." * Def = "GC" * Def = NumKeys * Def = 600 * MsgUp = Msg(@WINDOW, Def) ;* Start gas guage message * * For each RDSNo in KeyList using @FM setting fPos * RDSNo = Xlate('WO_MAT', WOMatKey, 'RDS_NO', 'X') * WOMatKey = Xlate('RDS', RDSNo, 'WO_MAT_KEY', 'X') * If WOMatKey NE '' then * WOMatRec = Database_Services('ReadDataRow', 'WO_MAT', WOMatKey) * InvActions = WOMatRec * Locate '1QA' in InvActions using @VM setting vPos else * Locate 'LBLCHK' in InvActions using @VM setting vPos then * QASig = Xlate('RDS', RDSNo, 'SUP_VER_SIG', 'X') * QASigTime = Xlate('RDS', RDSNo, 'SUP_VER_SIG_TIME', 'X') * QASigDate = Xlate('RDS', RDSNo, 'SUP_VER_SIG_DATE', 'X') * QASigDTM = QASigDate + (QASigTime/86400) * WOMatRec = Insert(WOMatRec, 0, vPos, 0, '1QA') * WOMatRec = Insert(WOMatRec, 0, vPos, 0, 'CR') * WOMatRec = Insert(WOMatRec, 0, vPos, 0, 'QA') * WOMatRec = Insert(WOMatRec, 0, vPos, 0, 'OI ADMIN') * WOMatRec = Insert(WOMatRec, 0, vPos, 0, Timestamp) * WOMatRec = Insert(WOMatRec, 0, vPos, 0, '') * WOMatRec = Insert(WOMatRec, 0, vPos, 0, '') * * * WOMatRec = 'PLACE' * * WOMatRec = '1K' * * WOMatRec = 'PTI' * * WOMatRec = 'OI_ADMIN' * * WOMatRec = Timestamp * * WOMatRec = RDSNo * * WOMatRec = '' * * Database_Services('WriteDataRow', 'WO_MAT', WOMatKey, WOMatRec, True$, False$, True$) * If Error_Services('HasError') then * ErrorList<-1> = RDSNo * end * end * end * end else * ErrorList<-1> = RDSNo * end * Running = Msg(@WINDOW, MsgUp, fPos, MSGINSTUPDATE$) ;* Update message * Next WOMatKey * * Database_Services('WriteDataRow', 'SYSLISTS', 'TEST_DANIEL_ERROR', ErrorList) * * Msg(@WINDOW,MsgUp) ;* Take message down * * return * * debug * WOMatKey = '170542*30' * // Write success packaging * LogFile = 'WO_MAT' * Action = 'PACK' * WhCd = 'CR' * LocCd = 'PACK' * UserID = @User4 * Tag = 'Packaging complete' * ToolID = '' * * WONo = Field(WOMatKey, '*', 1, 1) * CassNo = Field(WOMatKey, '*', 2, 1) * * InvDTM = OCONV(Date(),'D4/'):' ':OCONV(Time(),'MTS') * Set_Status(0) * aiParms = 'WO_MAT':@RM:WONo:@RM:CassNo:@RM:WhCd:'*':LocCd:@RM:Action:@RM:InvDTM:@RM:UserID:@RM:Tag:@RM:ToolID * obj_WO_Mat('AddInvTrans', aiParms) * If Get_Status(errCode) then * debug * Null * end * * return * * Script: * * WOMatKey = '170599*2' * LogFile = 'WO_MAT' * Action = 'PLACE' * WhCd = 'CR' * LocCd = 'QA' * UserID = @User4 * Tag = '170599.2' * ToolID = '' * errCode = '' * WONo = Field(WOMatKey, '*', 1, 1) * CassNo = Field(WOMatKey, '*', 2, 1) * InvDTM = OCONV(Date(),'D4/'):' ':OCONV(Time(),'MTS') * * WOMLParms = LogFile:@RM * WOMLParms := InvDTM:@RM * WOMLParms := Action:@RM * WOMLParms := WhCd:@RM * WOMLParms := LocCd:@RM * WOMLParms := WONo:@RM * WOMLParms := CassNo:@RM * WOMLParms := UserID:@RM * WOMLParms := Tag:@RM * WOMLParms := ToolID * * Set_Status(0) * obj_WO_Mat_Log('Create',WOMLParms) * * aiParms = 'WO_MAT':@RM:WONo:@RM:CassNo:@RM:WhCd:'*':LocCd:@RM:Action:@RM:InvDTM:@RM:UserID:@RM:Tag:@RM:ToolID * obj_WO_Mat('AddInvTrans', aiParms) * * errCode = '' * * IF Get_Status(errCode) THEN * debug * end * * return * * Script: * debug * BadList = '' * RDSNos = 482815:@FM ; //Database_Services('ReadDataRow', 'SYSLISTS', 'TEST_DANIEL_LIST') * For each RDSNo in RDSNos using @FM setting fPos * WfrIDs = Xlate('REACT_RUN', RDSNo, 'IN_WFR_ID', 'X') * For each WfrID in WfrIDs using @VM setting vPos * GaN_Services('WithdrawWfr', RDSNo, WfrID) * Next WfrID * GaN_Services('SplitSelection', RDSNo) * ReactRunRec = Database_Services('ReadDataRow', 'REACT_RUN', RDSNo) * If Error_Services('NoError') then * ReactRunRec = '' * Database_Services('WriteDataRow', 'REACT_RUN', RDSNo, ReactRunRec, True$, False$, True$) * If Error_Services('HasError') then * BadList<-1> = RDSNo * end * end else * BadList<-1> = RDSNo * end * Next RDSNo * * Database_Services('WriteDataRow', 'SYSLISTS', 'TEST_DANIEL_ERROR', BadList) * * * return * * * * return * * OPEN 'SCHED_DET_NG' TO SchedDetTable then * OPEN 'DICT.SCHED_DET_NG' TO @DICT then * Today = Datetime() * SchedDetKeys = '' * SelectSent = 'SELECT SCHED_DET_NG WITH STOP_DTM GE ':Today:' BY REACT_NO' * * RList(SelectSent,TARGET_ACTIVELIST$,'','','') * IF Get_Status(errCode) THEN * ErrMsg(errCode) * RETURN * END * * Done = 0 * @ID = '' * LOOP * PrevSchedDetKey = @ID * READNEXT @ID ELSE Done = 1 * UNTIL Done * SchedDetKeys<-1> = @ID * REPEAT * Database_Services('WriteDataRow', 'SYSLISTS', 'TEST_DANIEL2', SchedDetKeys) * end * end * * * return * * WONo = 170326 * For CassNo = 1 to 76 step 1 * WOMatKey = WONo:'*':CassNo * WOMatRec = Database_Services('ReadDataRow', 'WO_MAT', WOMatKey) * WOMatRec = WONo:'*1*':CassNo * WOMatRec = WONo:'*1*':CassNo * Database_Services('WriteDataRow', 'WO_MAT', WOMatKey, WOMatRec, True$, False$, True$) * Next CassNo * * * KeyList = Database_Services('ReadDataRow', 'SYSLISTS', 'TEST_DANIEL4') * For each RDSNo in KeyList using @FM * * RDSTestKeys = Xlate('RDS', RDSNo, 'RDS_TEST_KEYS', 'X') * If RDSTestKeys NE '' then * For each RDSTestKey in RDSTestKeys using @VM * RDSTestRec = Database_Services('ReadDataRow', 'RDS_TEST', RDSTestKey) * RDSTestRec = 'LSL_8IN' * Database_Services('WriteDataRow', 'RDS_TEST', RDSTestKey, RDSTestRec) * Next RDSTestKey * end * * Next RDSNo * * CtrlVer = 1.2 * Msg(@Window, '', 'OK', '', 'Control Version':@FM:CtrlVer) * *Version = SRP_Get_FileVersion("D:\apps\OICurrent\SRPControls.ocx") * Version = SRP_Get_FileVersion("C:\Program Files (x86)\RevSoft\OIClient\SRPControls.ocx") * * return * * CutoffDate = Date() - 912 ; // 2.5 years * RemoveList = '' * KeyList = Database_Services('ReadDataRow', 'SYSLISTS', 'TEST_DANIEL') * For each WOMatKey in KeyList using @FM setting fPos * * WONo = Field(WOMatKey, '*', 1) * WOEntryDt = Xlate('WO_LOG', WONo, 'ENTRY_DATE', 'X') * If WOEntryDt LT CutoffDate then * RemoveList<-1> = WOMatKey * end * * ReactType = Xlate('WO_MAT', WOMatKey, 'REACTOR_TYPE', 'X') * If ReactType EQ 'EPP' then * * end else * RDSNo = Xlate('WO_MAT', WOMatKey, 'RDS_NO', 'X') * DateOut = Xlate('RDS', RDSNo, 'DATE_OUT', 'X') * CutoffDate = Date() - 730 * If ( (DateOut LT CutoffDate) or (DateOut EQ '') ) then * // Old makeup cassette * end * end * * Next WOMatKey * * Database_Services('WriteDataRow', 'SYSLISTS', 'TEST_DANIEL2', RemoveList) * * return * * * WOMatKey = '170484*9' * WOMatRec = Database_Services('ReadDataRow', 'WO_MAT', WOMatKey) * debug * GRProps = obj_WO_Mat('GetGRProps',WOMatKey:@RM:WOMatRec) * * WMOKey = '170328*1*62' * WMORec = Database_Services('ReadDataRow', 'WM_OUT', WMOKey) * CurrStatus = obj_WM_Out('CurrStatus', WMOKey:@RM:WMORec) * RepStatus = Xlate('WM_OUT', WMOKey, 'REP_STATUS', 'X') * * * WOMatKey = '170328*62' * WOMatRec = Database_Services('ReadDataRow', 'WO_MAT', WOMatKey) * RepStatus = obj_WO_Mat('ReportStatus', WOMatKey:@RM:WOMatRec) * * WOStepKey = '170422*1' * LoadCount = Sum(Xlate('WO_STEP', WOStepKey, 'ALL_RDS_WFRS_EPI_LOAD', 'X')) * WONo = 170328 * EventWfrs = 444 * WOQty = Xlate('WO_LOG', WONo, 'QTY', 'X') * FirstWfr = (WOQty - EventWfrs) / 25 * FirstWfr = FirstWfr[-1, 'B.'] * FirstWfr = (FirstWfr * .25) + 1 * * return * * * StartDate = Date() - 1 * EndDate = Date() - 1 * * For Date = StartDate to EndDate Step 1 * * Reactor_Services('ClearWafersExpected', OConv(Date, 'D')) * Reactor_Services('ClearWafersProcessed', OConv(Date, 'D')) * Reactor_Services('CreatePerformanceTrackers', OConv(Date, 'D'), True$) * Reactor_Services('UpdatePerformanceTrackers', OConv(Date, 'D'), True$) * * Next Date * * * For Date = StartDate to EndDate Step 1 * * Reactor_Services_Dev('ClearWafersExpectedDev', OConv(Date, 'D')) * Reactor_Services_Dev('ClearWafersProcessedDev', OConv(Date, 'D')) * Reactor_Services_Dev('CreatePerformanceTrackersDev', OConv(Date, 'D'), True$) * Reactor_Services_Dev('UpdatePerformanceTrackersDev', OConv(Date, 'D'), True$) * * Next Date * * ZombieList = Database_Services('ReadDataRow', 'SYSLISTS', 'TEST_DANIEL') * For each EventID in ZombieList using @FM setting fPos * Database_Services('DeleteDataRow', 'SCHED_DET_NG', EventID, True$, False$) * Next EventID * * * * RDSList = '' * RDSList<-1> = 469318 * RDSList<-1> = 469320 * RDSKey = Dialog_Box('NDW_RDS_QUERY', @Window, RDSList) * Debug * Messaging_Services('SendMessage', 'RefreshSchedule', 'Response', '', 'All', '', 'EventHandler', 'SCHEDULER_DEV' : ',OMNIEVENT,@MESSAGE,@ARGUMENTS') * EOF = False$ * Query = 'SELECT WO_SCHEDULE_NG WITH UNSCHED_QTY EQ 0' * RList(Query, TARGET_ACTIVELIST$, '', '', '') * Loop * Readnext WOLogKeyID else EOF = True$ * Until EOF = True$ * Database_Services('DeleteDataRow', 'WO_SCHEDULE_NG', WOLogKeyID) * Repeat * * * WOMatKey = Xlate('RDS', 469320, 'WO_MAT_KEY', 'X') * WOMatKey = Xlate('RDS', 469318, 'WO_MAT_KEY', 'X') * * RType = Xlate('RDS', 469320, 'REACTOR_TYPE', 'X') * RType = Xlate('RDS', 469318, 'REACTOR_TYPE', 'X') * * RxList = Reactor_Services('GetReactorNumbers') * For each Reactor in RxList using @FM setting vPos * * ReactRec = Database_Services('ReadDataRow', 'REACTOR', Reactor) * If ReactRec NE '' then * ReactRec = '' * Database_Services('WriteDataRow', 'REACTOR', Reactor, ReactRec, True$, False$, True$) * end * * Next Reactor * * return * * KeyList = Database_Services('ReadDataRow', 'SYSLISTS', 'TEST_DANIEL') * * Def = "" * Def = "Populating Test Wafer Data..." * Def = "GC" * Def = Dcount(KeyList, @FM) * Def = 600 * MsgUp = Msg(@WINDOW, Def) ;* Start gas guage message * * For each RDSNo in KeyList using @FM setting fPos * * ReactRunRec = Database_Services('ReadDataRow', 'REACT_RUN', RDSNo) * Database_Services('WriteDataRow', 'REACT_RUN', RDSNo, ReactRunRec, True$, False$, True$) * Running = Msg(@WINDOW, MsgUp, fPos, MSGINSTUPDATE$) ;* Update message * Next RDSNo * * Msg(@WINDOW,MsgUp) ;* Take message down * * return * * * TestRevDotNetCommon: * * //Define the dotNet version * RevDotNetCommon = '' * DotNetHandle = StartDotNet("", '', RevDotNetCommon) * * DotNetDir = CheckDotNet('4.0'):'\' * SqlClientDLLPath = DotNetDir:'System.Data.dll' * ConnectionString = 'Password=mesa@1234@IQSDMS1!0987;Persist Security Info=True;User ID=IQSDMS1;Initial Catalog=G4Wafers_01;Data Source=messv01ec.ec.local\PROD1,53959' * //Specify the DLL * rv = Set_Property.NET(DotNetHandle, "AssemblyName", SqlClientDLLPath, RevDotNetCommon) * //Define the classes * SqlConnectionObj = Create_Class.NET(DotNetHandle, "System.Data.SqlClient.SqlConnection", 0, ConnectionString, 'System.String', RevDotNetCommon) * IF Get_Status(errCode) THEN * ErrMsg(errCode) * END else * mthds = Get_Info.Net(SqlConnectionObj, REVDOTNET_INFO_METHODS, RevDotNetCommon) * Set_Status(0) * rv = Send_Message.Net(SqlConnectionObj, "Open", RevDotNetCommon) * * IF Not(Get_Status(errCode)) THEN * ConnectionState = Get_Property.Net(SqlConnectionObj, "State", RevDotNetCommon) * * If ConnectionState EQ 'Open' then * SQLStatement = "select [Probe_Key] from [G4Wafers_01].[dbo].[Probe3]" * Params = SQLStatement:@FM:SqlConnectionObj * ParamTypes = 'System.String':@FM:'RevDotNet' * Set_Status(0) * SqlCommandObj = Create_Class.NET(DotNetHandle, "System.Data.SqlClient.SqlCommand", 0, Params, ParamTypes, RevDotNetCommon) * If Not(Get_Status(errCode)) then * SqlCommandMethods = Get_Info.Net(SqlCommandObj, REVDOTNET_INFO_METHODS) * Set_Status(0) * ProbeKey = Send_Message.Net(SqlCommandObj, "ExecuteScalar", RevDotNetCommon) * If Not(Get_Status(errCode)) then * If ( (ProbeKey NE 0) and (ProbeKey NE '') ) then * NewProbeKey = ProbeKey + 1 * SQLStatement = 'update [G4Wafers_01].[dbo].[Probe3] set [Probe_Key] = ':NewProbeKey:' where [Probe_Key] = ':ProbeKey * Set_Status(0) * rv = Set_Property.NET(SqlCommandObj, "CommandText", SQLStatement, RevDotNetCommon) * If Not(Get_Status(errCode)) then * Set_Status(0) * rv = Send_Message.Net(SqlCommandObj, "ExecuteNonQuery", RevDotNetCommon) * If Not(Get_Status(errCode)) then * // Verify Probe Key was updated * SQLStatement = "select [Probe_Key] from [G4Wafers_01].[dbo].[Probe3]" * Set_Status(0) * rv = Set_Property.NET(SqlCommandObj, "CommandText", SQLStatement, RevDotNetCommon) * If Not(Get_Status(errCode)) then * Set_Status(0) * VerifyProbeKey = Send_Message.Net(SqlCommandObj, "ExecuteScalar", RevDotNetCommon) * If Not(Get_Status(errCode)) then * If VerifyProbeKey NE NewProbeKey then * // Log error * end * end * end * end * end * end else * // Log error * end * end * end * rv = Send_Message.Net(SqlConnectionObj, 'Close', RevDotNetCommon) * ConnectionState = Get_Property.Net(SqlConnectionObj, "State", RevDotNetCommon) * end * end * end * Free_Class.Net('', RevDotNetCommon) * * return * * * Main: * * * objConnection = SQL_Services('GetConnectionObject', 'SPC') * * If objConnection then * * Query = "select [Probe_Key] from [G4Wafers_01].[dbo].[Probe2]" * SQL_Services('ExecuteQuery', objConnection, Query, True$) * * SQL_Services('DestroyConnectionObject', objConnection) * end * * * * return * * * * * Test5: * * ConnString = Database_Services('ReadDataRow', 'SERVERS', 'SPC') * ConnString = Delete(ConnString, 2, 0, 0) * ProviderIdx = IndexC(ConnString, 'Provider', 1) * ConnString = ConnString[(ProviderIdx + 1), 999] * ProviderEndIdx = Index(ConnString, ';', 1) * ConnString = ConnString[(ProviderEndIdx + 1), 999] * CIKey = 2409742 * InspReq = Xlate('CLEAN_INSP', CIKey, 'SPEC_INSP_REQ', 'X') * If InspReq EQ '' then InspReq = Xlate('CLEAN_INSP', CIKey, 'INSP_REQ', 'X') * * InspFreq = Xlate('CLEAN_INSP', CIKey, 'INSP_INTERVAL', 'X') * If InspFreq NE '' then * // Use the stored interval * RDSNo = Xlate('CLEAN_INSP', CIKey, 'RDS_NO', 'X') * PSNo = Xlate('CLEAN_INSP', CIKey, 'PS_NO', 'X') * WONo = Xlate('CLEAN_INSP', CIKey, 'WO_NO', 'X') * WOQty = Xlate('WO_LOG', WONo, 'QTY', 'X') * RunNo = Xlate('RDS', RDSNo, 'RUN_ORDER_NUM', 'X') * StageKey = PSNo:'*LWI' * InspInterval = Xlate('PRS_STAGE', StageKey, 'INSP_INTERVAL', 'X') * LastRun = ( (RunNo * 25) EQ WOQty ) * InspReq = ( (Mod((RunNo - 1), InspInterval) EQ 0) or LastRun ) * end else * // Use the current PRS_STAGE interval * InspReq = Xlate('CLEAN_INSP', CIKey, 'INSP_REQ', 'X') * end * * return * * * Export: * * NonEppList = '' * WOMatList = Database_Services('ReadDataRow', 'SYSLISTS', 'NULL_RDS_NON_EPP') * * For each WOMatKey in WOMatList using @FM setting fPos * * ReactorType = Xlate('WO_MAT', WOMatKey, 'REACTOR_TYPE', 'X') * If ReactorType NE 'EPP' and ReactorType NE 'GAN' then * NonEppList<-1> = WOMatKey * end * Next WOMatKey * * Database_Services('WriteDataRow', 'SYSLISTS', 'NULL_RDS_NON_EPP', NonEppList) * * NonEppList = Database_Services('ReadDataRow', 'SYSLISTS', 'NULL_RDS_NON_EPP') * Swap @FM with CRLF$ in NonEppList * OSWrite NonEppList on 'C:\Users\StieberD\Desktop\null-rds-non-epp.csv' * * * * return * * * * * WOMatPush: * * * WOMatKeyList = Database_Services('ReadDataRow', 'SYSLISTS', 'FABTIME_PUSH') * * * * NumWOMatKeys = DCount(WOMatKeyList, @FM) * * * * Def = "" * * Def = "Updating WO_MAT..." * * Def = "GC" * * Def = NumWOMatKeys * * Def = 600 * * MsgUp = Msg(@WINDOW, Def) ;* Start gas guage message * * Table = 'WO_MAT' * * WOMatKeyListIndex = 1 * * NewWOMatKeyList = WOMatKeyList * * Loop * * ID = WOMatKeyList * * Copy_Record_To_SQL(Table, ID, 1) * * NewWOMatKeyList = Delete(NewWOMatKeyList, 1, 0, 0) * * WOMatKeyListIndex += 1 * * Database_Services('WriteDataRow', 'SYSLISTS', 'FABTIME_PUSH', NewWOMatKeyList) * * Running = Msg(@WINDOW, MsgUp, WOMatKeyListIndex, MSGINSTUPDATE$) ;* Update message * * Until WOMatKeyListIndex GE NumWOMatKeys * * Repeat * * * * Msg(@WINDOW,MsgUp) ;* Take message down * * return * * * TaskSubmit: * * TaskID = RTI_Task_Submit('', 'TEST_DANIEL', '', '', '', '') * * If TaskID NE 0 then * Done = False$ * TaskResponse = '' * Loop * Status = RTI_Task_Status(TaskID, TaskResponse) * If (Status EQ 'COMPLETED') OR (Status EQ 'ERROR') then Done = True$ * Until Done * Repeat * end else * // Track if task id wasn't created at all. * end * StatusError = Get_Status(errCode) * If (Index(errCode, 'SHELLEXECUTE', 1)) NE 0 then StatusError = 0 * * * return * * retval = Utility("PRINTSETUP") * * IF NOT(ASSIGNED(PrinterID)) THEN PrinterID = '' * IF NOT(ASSIGNED(RetDefault)) THEN RetDefault = '' * * Printers = '' * Default = '' * * //PrintCount = PrintSetupNew(Printers,Default) ;* OI routine returns printer names, driver, port information * //end else * PrintCount = PrintSetup(PRN_GET$,'',Printers,Default) ;* OI routine returns printer names, driver, port information * //end * * DefPrinter = Default[1,','] * DefPort = FIELD(Default,',',3) * DefLine = DefPrinter:' on ':DefPort * * If Default NE 'Microsoft XPS Document Writer,winspool,Ne00:' then * Null * PrintSetup(PRN_SET$, 'Microsoft XPS Document Writer,winspool,Ne00:') * end * * return * * * // Import 6 inch Excel spreadsheet * * RetainFilepath = 'D:\Apps\Temp\6in-IFEPI GaN Retain Inventory.xlsx' * RetainFilepath = 'D:\Apps\Temp\8in-IFEpi GaN Retain Inventory.xlsx' * RetainFilepath = 'D:\Apps\Temp\Sample.xlsx' * RetainExcelHandle = Excel_Services('OpenDocument', RetainFilepath) * RetainWorksheet = 'Sheet1' * NumExcelRows = Excel_Services('GetNumRows', RetainExcelHandle, RetainWorksheet) * * Open 'DICT.REACT_RUN' to @DICT then * For ExcelRow = 2 to NumExcelRows * * RunID = Trim( Excel_Services('GetCellValue', RetainExcelHandle, RetainWorksheet, 'A', ExcelRow) ) * Convert @Upper.Case to @Lower.Case in RunID * RDSNo = '' * Column = 'GAN_RUN_ID' * SearchString = Column:@VM:RunID:@FM * Btree.Extract(SearchString, 'REACT_RUN', @DICT, RDSNo) * If RDSNo NE '' then * ReactRunRec = Database_Services('ReadDataRow', 'REACT_RUN', RDSNo) * If Error_Services('NoError') then * RRRecipe = ReactRunRec * RRPart = Xlate('REACT_RUN', RDSNo, 'EPI_PART_NO', 'X') * RRScribes = Xlate('REACT_RUN', RDSNo, 'WFR_SCRIBES', 'X') * InWfrIDs = ReactRunRec * * * Read the data from the Excel retain spreadsheet * * Recipe = Trim( Excel_Services('GetCellValue', RetainExcelHandle, RetainWorksheet, 'B', ExcelRow) ) * Pocket = Trim( Excel_Services('GetCellValue', RetainExcelHandle, RetainWorksheet, 'C', ExcelRow) ) * If Pocket _NEC 'ref' then * Scribe = Trim( Excel_Services('GetCellValue', RetainExcelHandle, RetainWorksheet, 'D', ExcelRow) ) * Grade = Trim( Excel_Services('GetCellValue', RetainExcelHandle, RetainWorksheet, 'E', ExcelRow) ) * Part = Trim( Excel_Services('GetCellValue', RetainExcelHandle, RetainWorksheet, 'F', ExcelRow) ) * WorkOrder = Trim( Excel_Services('GetCellValue', RetainExcelHandle, RetainWorksheet, 'G', ExcelRow) ) * RetainBox = Trim( Excel_Services('GetCellValue', RetainExcelHandle, RetainWorksheet, 'H', ExcelRow) ) * RetainSlot = Trim( Excel_Services('GetCellValue', RetainExcelHandle, RetainWorksheet, 'I', ExcelRow) ) * Operator = Trim( Excel_Services('GetCellValue', RetainExcelHandle, RetainWorksheet, 'J', ExcelRow) ) * RetainDTM = Trim( Excel_Services('GetCellValue', RetainExcelHandle, RetainWorksheet, 'K', ExcelRow) ) * CurrLoc = Trim( Excel_Services('GetCellValue', RetainExcelHandle, RetainWorksheet, 'L', ExcelRow) ) * Status = Trim( Excel_Services('GetCellValue', RetainExcelHandle, RetainWorksheet, 'M', ExcelRow) ) * Comment = Trim( Excel_Services('GetCellValue', RetainExcelHandle, RetainWorksheet, 'N', ExcelRow) ) * * Begin Case * Case Operator _EQC 'AH' * RetainSig = 'ANTHONY_H' * Case Operator _EQC 'SB' * RetainSig = 'SYEDA_B' * Case Operator _EQC 'PM' * RetainSig = 'PEYTON_M' * Case Operator _EQC 'JL' * RetainSig = 'JAVIER_L' * Case Operator _EQC 'PS' * RetainSig = 'PRISCILA_S' * Case Operator _EQC 'NC' * RetainSig = 'NIKOLAS_C' * Case Operator _EQC 'HG' * RetainSig = 'HECTOR_G' * Case Operator _EQC 'ES' * RetainSig = 'ESTEBAN_S' * Case Operator _EQC 'AD' * RetainSig = 'ALIYAH_D' * Case Operator _EQC 'LB' * RetainSig = 'LACEY_B' * Case Operator _EQC 'IP' * RetainSig = 'IAN_P' * Case Operator _EQC 'RC' * RetainSig = 'RYAN_C' * Case Operator _EQC 'GR' * RetainSig = 'GEORGE_R' * Case Operator _EQC 'AH/JL' * RetainSig = 'ANTHONY_H' * Case Operator _EQC 'NC/JL' * RetainSig = 'NIKOLAS_C' * Case Operator _EQC 'SW' * RetainSig = 'STEVEN_W' * Case Otherwise$ * RetainSig = '' * End Case * * // Truncate DTM to just the date, then convert to internal format * RetainDate = RetainDTM[1, 'F '] * RetainDate = IConv(RetainDate, 'D') * * * Clean the data * * // Format the Recipe * Convert @Lower.Case to @Upper.Case in Recipe * // Format the Pocket * If Pocket[1, 1] NE '0' then Pocket = '0':Pocket * // Format the Scribe * Convert @Lower.Case to @Upper.Case in Scribe * // Format the Grade * Begin Case * Case Grade _EQC 'aborted' * Grade = 'Aborted' * Case Grade _EQC 'CT' * Grade = 'CT' * Case ( (Grade _EQC 'Eng test') or (Grade _EQC 'Eng test') or (Grade _EQC 'Engtest') or (Grade _EQC 'Test') ) * Grade = 'Eng Test' * Case Grade _EQC 'Eq Failure' * Grade = 'EQ Failure' * Case Grade _EQC 'Mechanical' * Grade = 'Mechanical' * Case Grade _EQC 'NA' * Grade = 'NA' * Case Grade _EQC 'retain' * Grade = 'Retain' * Case Grade _EQC 'scrap' * Grade = 'Scrap' * Case Grade _EQC 'Terminated' * Grade = 'Terminated' * Case Grade _EQC '' * Grade = '' * Case Otherwise$ * Null * End Case * // Format the Part No * Convert @Lower.Case to @Upper.Case in Part * // Format the Current Location * Begin Case * Case CurrLoc _EQC 'Cleanroom' * CurrLoc = 'Cleanroom' * Case ( (CurrLoc _EQC 'Wafer Destroyed') or (CurrLoc _EQC 'Wafers Destroyed') or (CurrLoc _EQC 'Wasfer Destroyed') ) * CurrLoc = 'Wafer Destroyed' * Case CurrLoc _EQC 'Warehouse' * CurrLoc = 'Warehouse' * End Case * * * Write the data to the WO_WFR record * * WfrIndex = Pocket + 0 ; // Convert string to integer and trim 0 padding * * RRScribe = RRScribes<0, WfrIndex> * WfrID = InWfrIDs<0, WfrIndex> * WOWfrRec = Database_Services('ReadDataRow', 'WO_WFR', WfrID) * If Error_Services('NoError') then * WOWfrRec = Grade * WOWfrRec = RunID * WOWfrRec = Pocket * WOWfrRec = Scribe * WOWfrRec = RetainBox * WOWfrRec = RetainSlot * WOWfrRec = CurrLoc * WOWfrRec = Comment * WOWfrRec = Status * WOWfrRec = RetainSig * WOWfrRec = RetainDate * Database_Services('WriteDataRow', 'WO_WFR', WfrID, WOWfrRec, True$, False$, True$) * end * end * end * end * Next ExcelRow * end * Excel_Services('CloseDocument', RetainExcelHandle) * * // Import 8 inch Excel spreadsheet * * RetainFilepath = 'D:\Apps\Temp\8in-IFEpi GaN Retain Inventory.xlsx' * RetainExcelHandle = Excel_Services('OpenDocument', RetainFilepath) * RetainWorksheet = 'Sheet1' * NumExcelRows = Excel_Services('GetNumRows', RetainExcelHandle, RetainWorksheet) * * Open 'DICT.REACT_RUN' to @DICT then * For ExcelRow = 2 to NumExcelRows * * RunID = Trim( Excel_Services('GetCellValue', RetainExcelHandle, RetainWorksheet, 'A', ExcelRow) ) * Convert @Upper.Case to @Lower.Case in RunID * RDSNo = '' * Column = 'GAN_RUN_ID' * SearchString = Column:@VM:RunID:@FM * Btree.Extract(SearchString, 'REACT_RUN', @DICT, RDSNo) * If RDSNo NE '' then * ReactRunRec = Database_Services('ReadDataRow', 'REACT_RUN', RDSNo) * If Error_Services('NoError') then * RRRecipe = ReactRunRec * RRPart = Xlate('REACT_RUN', RDSNo, 'EPI_PART_NO', 'X') * RRScribes = Xlate('REACT_RUN', RDSNo, 'WFR_SCRIBES', 'X') * InWfrIDs = ReactRunRec * * * Read the data from the Excel retain spreadsheet * * Recipe = Trim( Excel_Services('GetCellValue', RetainExcelHandle, RetainWorksheet, 'B', ExcelRow) ) * Pocket = Trim( Excel_Services('GetCellValue', RetainExcelHandle, RetainWorksheet, 'C', ExcelRow) ) * If Pocket _NEC 'ref' then * Scribe = Trim( Excel_Services('GetCellValue', RetainExcelHandle, RetainWorksheet, 'D', ExcelRow) ) * Grade = Trim( Excel_Services('GetCellValue', RetainExcelHandle, RetainWorksheet, 'E', ExcelRow) ) * Part = Trim( Excel_Services('GetCellValue', RetainExcelHandle, RetainWorksheet, 'F', ExcelRow) ) * WorkOrder = Trim( Excel_Services('GetCellValue', RetainExcelHandle, RetainWorksheet, 'G', ExcelRow) ) * RetainBox = Trim( Excel_Services('GetCellValue', RetainExcelHandle, RetainWorksheet, 'H', ExcelRow) ) * RetainSlot = Trim( Excel_Services('GetCellValue', RetainExcelHandle, RetainWorksheet, 'I', ExcelRow) ) * Operator = Trim( Excel_Services('GetCellValue', RetainExcelHandle, RetainWorksheet, 'J', ExcelRow) ) * RetainDate = Trim( Excel_Services('GetCellValue', RetainExcelHandle, RetainWorksheet, 'K', ExcelRow) ) * CurrLoc = Trim( Excel_Services('GetCellValue', RetainExcelHandle, RetainWorksheet, 'L', ExcelRow) ) * Status = Trim( Excel_Services('GetCellValue', RetainExcelHandle, RetainWorksheet, 'M', ExcelRow) ) * Comment = Trim( Excel_Services('GetCellValue', RetainExcelHandle, RetainWorksheet, 'N', ExcelRow) ) * * Begin Case * Case Operator _EQC 'AH' * RetainSig = 'ANTHONY_H' * Case Operator _EQC 'SB' * RetainSig = 'SYEDA_B' * Case Operator _EQC 'PM' * RetainSig = 'PEYTON_M' * Case Operator _EQC 'JL' * RetainSig = 'JAVIER_L' * Case Operator _EQC 'PS' * RetainSig = 'PRISCILA_S' * Case Operator _EQC 'NC' * RetainSig = 'NIKOLAS_C' * Case Operator _EQC 'HG' * RetainSig = 'HECTOR_G' * Case Operator _EQC 'ES' * RetainSig = 'ESTEBAN_S' * Case Operator _EQC 'AD' * RetainSig = 'ALIYAH_D' * Case Operator _EQC 'LB' * RetainSig = 'LACEY_B' * Case Operator _EQC 'IP' * RetainSig = 'IAN_P' * Case Operator _EQC 'RC' * RetainSig = 'RYAN_C' * Case Operator _EQC 'GR' * RetainSig = 'GEORGE_R' * Case Operator _EQC 'AH/JL' * RetainSig = 'ANTHONY_H' * Case Operator _EQC 'NC/JL' * RetainSig = 'NIKOLAS_C' * Case Operator _EQC 'SW' * RetainSig = 'STEVEN_W' * Case Otherwise$ * RetainSig = '' * End Case * * // Truncate DTM to just the date, then convert to internal format * RetainDate = RetainDTM[1, 'F '] * RetainDate = IConv(RetainDate, 'D') * * * Clean the data * * // Format the Recipe * Convert @Lower.Case to @Upper.Case in Recipe * // Format the Pocket * If Pocket[1, 1] NE '0' then Pocket = '0':Pocket * // Format the Scribe * Convert @Lower.Case to @Upper.Case in Scribe * // Format the Grade * Begin Case * Case Grade _EQC 'aborted' * Grade = 'Aborted' * Case Grade _EQC 'CT' * Grade = 'CT' * Case ( (Grade _EQC 'Eng test') or (Grade _EQC 'Eng test') or (Grade _EQC 'Engtest') or (Grade _EQC 'Test') ) * Grade = 'Eng Test' * Case Grade _EQC 'Eq Failure' * Grade = 'EQ Failure' * Case Grade _EQC 'Mechanical' * Grade = 'Mechanical' * Case Grade _EQC 'NA' * Grade = 'NA' * Case Grade _EQC 'retain' * Grade = 'Retain' * Case Grade _EQC 'scrap' * Grade = 'Scrap' * Case Grade _EQC 'Terminated' * Grade = 'Terminated' * Case Grade _EQC '' * Grade = '' * Case Otherwise$ * Null * End Case * // Format the Part No * Convert @Lower.Case to @Upper.Case in Part * // Format the Current Location * Begin Case * Case CurrLoc _EQC 'Cleanroom' * CurrLoc = 'Cleanroom' * Case ( (CurrLoc _EQC 'Wafer Destroyed') or (CurrLoc _EQC 'Wafers Destroyed') or (CurrLoc _EQC 'Wasfer Destroyed') ) * CurrLoc = 'Wafer Destroyed' * Case CurrLoc _EQC 'Warehouse' * CurrLoc = 'Warehouse' * End Case * * * Write the data to the WO_WFR record * * WfrIndex = Pocket + 0 ; // Convert string to integer and trim 0 padding * * RRScribe = RRScribes<0, WfrIndex> * WfrID = InWfrIDs<0, WfrIndex> * WOWfrRec = Database_Services('ReadDataRow', 'WO_WFR', WfrID) * If Error_Services('NoError') then * WOWfrRec = Grade * WOWfrRec = RunID * WOWfrRec = Pocket * WOWfrRec = Scribe * WOWfrRec = RetainBox * WOWfrRec = RetainSlot * WOWfrRec = CurrLoc * WOWfrRec = Comment * WOWfrRec = Status * WOWfrRec = RetainSig * WOWfrRec = RetainDate * Database_Services('WriteDataRow', 'WO_WFR', WfrID, WOWfrRec, True$, False$, True$) * end * end * end * end * Next ExcelRow * end * Excel_Services('CloseDocument', RetainExcelHandle) * * return *