Added NCR barcode verification

This commit is contained in:
Infineon\Mitchem 2024-09-10 14:29:59 -07:00 committed by Infineon\StieberD
parent 9f4a3f94b5
commit bff81f70c4
8 changed files with 3092 additions and 388 deletions

File diff suppressed because it is too large Load Diff

View File

@ -607,74 +607,77 @@ RejMat:
ncrParms := '':@RM ;* Placeholder for RejWaferIDs ncrParms := '':@RM ;* Placeholder for RejWaferIDs
ncrParms := SlotNCRs ncrParms := SlotNCRs
Set_Status(0) BarcodeVerified = Dialog_Box('NDW_VERIFY_BARCODE', @Window, WMIKey, @User4)
NCRNo = obj_NCR('Create',ncrParms) ;* Create new NCR for this wafer/group of wafers If BarcodeVerified EQ TRUE$ then
errCode = '' Set_Status(0)
IF Get_Status(errCode) THEN NCRNo = obj_NCR('Create',ncrParms) ;* Create new NCR for this wafer/group of wafers
ErrMsg(errCode) errCode = ''
IF Get_Status(errCode) THEN
ErrMsg(errCode)
END ELSE END ELSE
RejDTM = OCONV(Date(),'D4/'):' ':OCONV(Time(),'MTS') RejDTM = OCONV(Date(),'D4/'):' ':OCONV(Time(),'MTS')
RejWfrIDs = '' RejWfrIDs = ''
NewSlotIDs = '' NewSlotIDs = ''
CurrSlotIDs = '' CurrSlotIDs = ''
RunLocs = '' RunLocs = ''
FOR N = 1 TO COUNT(InSlotNos,@VM) + (InSlotNos NE '') FOR N = 1 TO COUNT(InSlotNos,@VM) + (InSlotNos NE '')
* * * * Added 3/23/2016 JCH - wafer history * * * * * * * * Added 3/23/2016 JCH - wafer history * * * *
RejWfrID = WONo:'*':InCassNos<1,N>:'*':InSlotNos<1,N> RejWfrID = WONo:'*':InCassNos<1,N>:'*':InSlotNos<1,N>
RejWfrIDs<1,-1> = RejWfrID RejWfrIDs<1,-1> = RejWfrID
CurrSlotIDs<1,-1> = RejWfrID ;*Inbound box WfrID = SlotID CurrSlotIDs<1,-1> = RejWfrID ;*Inbound box WfrID = SlotID
Parms = RejWfrID:@RM ;* WfrID Parms = RejWfrID:@RM ;* WfrID
Parms := RejDTM:@RM ;* EventDtm Parms := RejDTM:@RM ;* EventDtm
Parms := @USER4:@RM ;* EventBy Parms := @USER4:@RM ;* EventBy
Parms := 'NCR':@RM ;* Event Parms := 'NCR':@RM ;* Event
Parms := '':@RM ;* NewSlotID Parms := '':@RM ;* NewSlotID
Parms := '':@RM ;* RunLoc Parms := '':@RM ;* RunLoc
Parms := NCRNo:@RM ;* NCRNo Parms := NCRNo:@RM ;* NCRNo
Parms := '':@RM ;* TWUse Parms := '':@RM ;* TWUse
Parms := RejWfrID:@RM ;* CurrSlotID Inbound box WfrID = SlotID Parms := RejWfrID:@RM ;* CurrSlotID Inbound box WfrID = SlotID
Parms := '':@RM ;* NewToolID Parms := '':@RM ;* NewToolID
Parms := '':@RM ;* CurrToolID Parms := '':@RM ;* CurrToolID
Parms := '':@RM ;* NewInvLoc Parms := '':@RM ;* NewInvLoc
Parms := '':@RM ;* CurrInvLoc Parms := '':@RM ;* CurrInvLoc
Parms := 'I' ;* WfrSide Parms := 'I' ;* WfrSide
obj_WO_Wfr('AddEvent',Parms) obj_WO_Wfr('AddEvent',Parms)
* * * * * * * * * *
LineNo = InSlotNos<1,N> LineNo = InSlotNos<1,N>
Set_Property(@WINDOW:'.SLOT_NO','CELLPOS','',COL$RDS:@FM:LineNo) Set_Property(@WINDOW:'.SLOT_NO','CELLPOS','',COL$RDS:@FM:LineNo)
Set_Property(@WINDOW:'.SLOT_NO','CELLPOS','',COL$RDS_STATUS:@FM:LineNo) Set_Property(@WINDOW:'.SLOT_NO','CELLPOS','',COL$RDS_STATUS:@FM:LineNo)
Set_Property(@WINDOW:'.SLOT_NO','CELLPOS','',COL$POCKET:@FM:LineNo) Set_Property(@WINDOW:'.SLOT_NO','CELLPOS','',COL$POCKET:@FM:LineNo)
Set_Property(@WINDOW:'.SLOT_NO','CELLPOS','',COL$ZONE:@FM:LineNo) Set_Property(@WINDOW:'.SLOT_NO','CELLPOS','',COL$ZONE:@FM:LineNo)
Set_Property(@WINDOW:'.SLOT_NO','CELLPOS','',COL$CHAR:@FM:LineNo) Set_Property(@WINDOW:'.SLOT_NO','CELLPOS','',COL$CHAR:@FM:LineNo)
Set_Property(@WINDOW:'.SLOT_NO','CELLPOS',NCRNo,COL$SLOT_NCR_NO:@FM:LineNo) Set_Property(@WINDOW:'.SLOT_NO','CELLPOS',NCRNo,COL$SLOT_NCR_NO:@FM:LineNo)
NEXT N NEXT N
END END
Set_Property(@WINDOW:'.SLOT','SELPOS',SlotSelection) ;* Toggle WM_IN select off Set_Property(@WINDOW:'.SLOT','SELPOS',SlotSelection) ;* Toggle WM_IN select off
Send_Event(@WINDOW,'WRITE') Send_Event(@WINDOW,'WRITE')
DetWindow = 'NCR' DetWindow = 'NCR'
DetKeys = NCRNo DetKeys = NCRNo
DefaultRec = '' DefaultRec = ''
RetKey = WMIKey RetKey = WMIKey
RetWin = @WINDOW RetWin = @WINDOW
RetPage = 1 RetPage = 1
RetCtrl = @WINDOW:'.SLOT' RetCtrl = @WINDOW:'.SLOT'
RetPos = 1:@FM:1 RetPos = 1:@FM:1
obj_Appwindow('ViewNewDetail',DetWindow:@RM:DetKeys:@RM:DefaultRec:@RM:RetKey:@RM:RetPage:@RM:RetCtrl:@RM:RetPos) obj_Appwindow('ViewNewDetail',DetWindow:@RM:DetKeys:@RM:DefaultRec:@RM:RetKey:@RM:RetPage:@RM:RetCtrl:@RM:RetPos)
End
RETURN RETURN

View File

@ -1369,84 +1369,87 @@ RejMat:
ncrParms := MUCassIDs:@RM ncrParms := MUCassIDs:@RM
ncrParms := MUSlotNos ncrParms := MUSlotNos
Set_Status(0) BarcodeVerified = Dialog_Box('NDW_VERIFY_BARCODE', @Window, WMOKey, @User4)
NCRNo = obj_NCR('Create',ncrParms) ;* Create new NCR for this wafer/group of wafers If BarcodeVerified EQ TRUE$ then
Set_Status(0)
IF Get_Status(errCode) THEN NCRNo = obj_NCR('Create',ncrParms) ;* Create new NCR for this wafer/group of wafers
ErrMsg(errCode)
END ELSE IF Get_Status(errCode) THEN
RejDTM = OCONV(Date(),'D4/'):' ':OCONV(Time(),'MTS') ErrMsg(errCode)
END ELSE
RejDTM = OCONV(Date(),'D4/'):' ':OCONV(Time(),'MTS')
RejWfrIDs = ''
CurrSlotIDs = ''
FOR N = 1 TO COUNT(OutSlotNos,@VM) + (OutSlotNos NE '')
* * * * Added 4/23/2016 JCH - wafer history * * * *
CurrSlotID = WONo:'*':OutCassNos<1,N>:'*':OutSlotNos<1,N>
CurrSlotIDs<1,-1> = CurrSlotID
IF MUWONos<1,N> = '' THEN
RejWfrID = WONo:'*':InCassNos<1,N>:'*':InSlotNos<1,N>
END ELSE
RejWfrID = MUWONos<1,N>:'*':MUCassIDs<1,N>:'*':MUSlotNos<1,N>
END
RejWfrIDs<1,-1> = RejWfrID
Parms = RejWfrID:@RM ;* WfrID
Parms := RejDTM:@RM ;* EventDtm
Parms := @USER4:@RM ;* EventBy
Parms := 'NCR':@RM ;* Event
Parms := '':@RM ;* NewSlotID
Parms := '':@RM ;* RunLoc
Parms := NCRNo:@RM ;* NCRNo
Parms := '':@RM ;* TWUse
Parms := CurrSlotID:@RM ;* CurrSlotID
Parms := '':@RM ;* NewToolID
Parms := '':@RM ;* CurrToolID
Parms := '':@RM ;* NewInvLoc
Parms := '':@RM ;* CurrInvLoc
Parms := 'O' ;* Wfr Side
obj_WO_Wfr('AddEvent',Parms)
LineNo = OutSlotNos<1,N>
Set_Property(@WINDOW:'.SLOT','CELLPOS','',COL$RDS_NO:@FM:LineNo)
Set_Property(@WINDOW:'.SLOT','CELLPOS','',COL$RDS_STATUS:@FM:LineNo)
Set_Property(@WINDOW:'.SLOT','CELLPOS','',COL$POCKET:@FM:LineNo)
Set_Property(@WINDOW:'.SLOT','CELLPOS','',COL$ZONE:@FM:LineNo)
Set_Property(@WINDOW:'.SLOT','CELLPOS','',COL$IN_CASS:@FM:LineNo)
Set_Property(@WINDOW:'.SLOT','CELLPOS','',COL$IN_SLOT:@FM:LineNo)
Set_Property(@WINDOW:'.SLOT','CELLPOS',NCRNo,COL$SLOT_NCR:@FM:LineNo)
Set_Property(@WINDOW:'.SLOT','CELLPOS','',COL$MU_WO_NO:@FM:LineNo)
Set_Property(@WINDOW:'.SLOT','CELLPOS','',COL$MU_WO_STEP:@FM:LineNo)
Set_Property(@WINDOW:'.SLOT','CELLPOS','',COL$MU_CASS_NO:@FM:LineNo)
Set_Property(@WINDOW:'.SLOT','CELLPOS','',COL$MU_SLOT_NO:@FM:LineNo)
NEXT N
END
RejWfrIDs = '' Set_Property(@WINDOW:'.SLOT','SELPOS',SlotSelection) ;* Toggle WM_IN select off
CurrSlotIDs = ''
FOR N = 1 TO COUNT(OutSlotNos,@VM) + (OutSlotNos NE '') Send_Event(@WINDOW,'WRITE')
* * * * Added 4/23/2016 JCH - wafer history * * * *
CurrSlotID = WONo:'*':OutCassNos<1,N>:'*':OutSlotNos<1,N>
CurrSlotIDs<1,-1> = CurrSlotID
IF MUWONos<1,N> = '' THEN
RejWfrID = WONo:'*':InCassNos<1,N>:'*':InSlotNos<1,N>
END ELSE
RejWfrID = MUWONos<1,N>:'*':MUCassIDs<1,N>:'*':MUSlotNos<1,N>
END
RejWfrIDs<1,-1> = RejWfrID
Parms = RejWfrID:@RM ;* WfrID
Parms := RejDTM:@RM ;* EventDtm
Parms := @USER4:@RM ;* EventBy
Parms := 'NCR':@RM ;* Event
Parms := '':@RM ;* NewSlotID
Parms := '':@RM ;* RunLoc
Parms := NCRNo:@RM ;* NCRNo
Parms := '':@RM ;* TWUse
Parms := CurrSlotID:@RM ;* CurrSlotID
Parms := '':@RM ;* NewToolID
Parms := '':@RM ;* CurrToolID
Parms := '':@RM ;* NewInvLoc
Parms := '':@RM ;* CurrInvLoc
Parms := 'O' ;* Wfr Side
obj_WO_Wfr('AddEvent',Parms)
LineNo = OutSlotNos<1,N>
Set_Property(@WINDOW:'.SLOT','CELLPOS','',COL$RDS_NO:@FM:LineNo)
Set_Property(@WINDOW:'.SLOT','CELLPOS','',COL$RDS_STATUS:@FM:LineNo)
Set_Property(@WINDOW:'.SLOT','CELLPOS','',COL$POCKET:@FM:LineNo)
Set_Property(@WINDOW:'.SLOT','CELLPOS','',COL$ZONE:@FM:LineNo)
Set_Property(@WINDOW:'.SLOT','CELLPOS','',COL$IN_CASS:@FM:LineNo)
Set_Property(@WINDOW:'.SLOT','CELLPOS','',COL$IN_SLOT:@FM:LineNo)
Set_Property(@WINDOW:'.SLOT','CELLPOS',NCRNo,COL$SLOT_NCR:@FM:LineNo)
Set_Property(@WINDOW:'.SLOT','CELLPOS','',COL$MU_WO_NO:@FM:LineNo)
Set_Property(@WINDOW:'.SLOT','CELLPOS','',COL$MU_WO_STEP:@FM:LineNo)
Set_Property(@WINDOW:'.SLOT','CELLPOS','',COL$MU_CASS_NO:@FM:LineNo)
Set_Property(@WINDOW:'.SLOT','CELLPOS','',COL$MU_SLOT_NO:@FM:LineNo)
NEXT N
END DetWindow = 'NCR'
DetKeys = NCRNo
Set_Property(@WINDOW:'.SLOT','SELPOS',SlotSelection) ;* Toggle WM_IN select off DefaultRec = ''
RetKey = WMOKey
Send_Event(@WINDOW,'WRITE') RetWin = @WINDOW
RetPage = 1
DetWindow = 'NCR' RetCtrl = @WINDOW:'.SLOT'
DetKeys = NCRNo RetPos = 1:@FM:1
DefaultRec = ''
RetKey = WMOKey obj_Appwindow('ViewNewDetail',DetWindow:@RM:DetKeys:@RM:DefaultRec:@RM:RetKey:@RM:RetPage:@RM:RetCtrl:@RM:RetPos)
RetWin = @WINDOW End
RetPage = 1
RetCtrl = @WINDOW:'.SLOT'
RetPos = 1:@FM:1
obj_Appwindow('ViewNewDetail',DetWindow:@RM:DetKeys:@RM:DefaultRec:@RM:RetKey:@RM:RetPage:@RM:RetCtrl:@RM:RetPos)
end else end else
// Cassette is on hold so material cannot be rejected. // Cassette is on hold so material cannot be rejected.
ErrorMessage = 'Create NCR denied!. The cassette must be taken off hold before rejecting material.' ErrorMessage = 'Create NCR denied!. The cassette must be taken off hold before rejecting material.'

View File

@ -483,75 +483,78 @@ RejMat:
ncrParms := RejWaferIDs:@RM ;* Rejected Wafer ID's ncrParms := RejWaferIDs:@RM ;* Rejected Wafer ID's
ncrParms := PrevNCRNos ;* Previous NCR No's ncrParms := PrevNCRNos ;* Previous NCR No's
Set_Status(0) BarcodeVerified = Dialog_Box('NDW_VERIFY_BARCODE', @Window, RDSNo, @User4)
If BarcodeVerified EQ TRUE$ then
NCRNo = obj_NCR('Create',ncrParms) ;* Create new NCR for this wafer/group of wafers Set_Status(0)
SAPBatchNo = Get_Property(@WINDOW:'.SAP_BATCH_NO','DEFPROP')
MUFlag = XLATE('WO_MAT', WOMatKey, 'MakeupBox', 'X') NCRNo = obj_NCR('Create',ncrParms) ;* Create new NCR for this wafer/group of wafers
SAPBatchNo = Get_Property(@WINDOW:'.SAP_BATCH_NO','DEFPROP')
IF Get_Status(errCode) THEN MUFlag = XLATE('WO_MAT', WOMatKey, 'MakeupBox', 'X')
ErrMsg(errCode)
END ELSE IF Get_Status(errCode) THEN
IF SAPBatchNo NE '' THEN ErrMsg(errCode)
IF SAPBatchNo[-1,1] NE 'R' THEN END ELSE
MUFlag = Xlate('NCR', NCRNo, 'MAKEUP_BOX', 'X') IF SAPBatchNo NE '' THEN
MUFlag = OCONV(MUFlag ,'BYes,') IF SAPBatchNo[-1,1] NE 'R' THEN
PartNoID = Xlate('NCR', NCRNo, 'WO_MAT_PART_NO', 'X') MUFlag = Xlate('NCR', NCRNo, 'MAKEUP_BOX', 'X')
RejCnt = Xlate('NCR', NCRNo, 'REJ_CNT', 'X') MUFlag = OCONV(MUFlag ,'BYes,')
Recipients = XLATE('NOTIFICATION', 'NCR_AFTER_GR', NOTIFICATION_USER_ID$, 'X') PartNoID = Xlate('NCR', NCRNo, 'WO_MAT_PART_NO', 'X')
SentFrom = @USER4 RejCnt = Xlate('NCR', NCRNo, 'REJ_CNT', 'X')
Subject = 'SAP Post - GR Scrap Qty - NCR Reported' ;* Modified subject line - dkk 7/17/14 Recipients = XLATE('NOTIFICATION', 'NCR_AFTER_GR', NOTIFICATION_USER_ID$, 'X')
Message = "NCR: ":NCRNo:CRLF$:"Batch_No: ":SAPBatchNo:CRLF$:"MU Box: ":MUFlag:CRLF$:"Epi PN: ":PartNoID:CRLF$:"Qty: ":RejCnt ;* Added Epi PN on the end - dkk 7/17/14 SentFrom = @USER4
AttachWindow = 'NCR' Subject = 'SAP Post - GR Scrap Qty - NCR Reported' ;* Modified subject line - dkk 7/17/14
AttachKey = NCRNo Message = "NCR: ":NCRNo:CRLF$:"Batch_No: ":SAPBatchNo:CRLF$:"MU Box: ":MUFlag:CRLF$:"Epi PN: ":PartNoID:CRLF$:"Qty: ":RejCnt ;* Added Epi PN on the end - dkk 7/17/14
SendToGroup = '' AttachWindow = 'NCR'
Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup AttachKey = NCRNo
obj_Notes('Create',Parms) SendToGroup = ''
Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup
obj_Notes('Create',Parms)
END
END
RejDTM = OCONV(Date(),'D4/'):' ':OCONV(Time(),'MTS')
RejWfrIDs = ''
CurrSlotIDs = ''
sCnt = COUNT(SlotNos,@VM) + (SlotNos NE '')
FOR N = 1 TO sCnt
* * * * Added 3/23/2016 JCH - wafer history * * * *
RejWfrID = RejWaferIDs<1,N>
CurrSlotID = WONo:'*':CassNo:'*':SlotNos<1,N>
Convert '.' To '*' In RejWfrID
RejWfrIDs<1,-1> = RejWfrID
CurrSlotIDs<1,-1> = CurrSlotID
Parms = RejWfrID:@RM ;* WfrID
Parms := RejDTM:@RM ;* EventDtm
Parms := @USER4:@RM ;* EventBy
Parms := 'NCR':@RM ;* Event
Parms := '':@RM ;* NewSlotID
Parms := '':@RM ;* RunLoc
Parms := NCRNo:@RM ;* NCRNo
Parms := '':@RM ;* TWUse
Parms := CurrSlotID:@RM ;* CurrSlotID
Parms := '':@RM ;* NewToolID
Parms := '':@RM ;* CurrToolID
Parms := '':@RM ;* NewInvLoc
Parms := '':@RM ;* CurrInvLoc
Parms := 'O' ;* Wfr Side
obj_WO_Wfr('AddEvent',Parms)
* * * * * * * * *
LineNo = SlotNos<1,N>
NEXT N
END END
END
RejDTM = OCONV(Date(),'D4/'):' ':OCONV(Time(),'MTS') Set_Property(@WINDOW:'.SLOT','SELPOS',SlotSelection) ;* Toggle WM_IN select off
Set_Property(@WINDOW, 'SAVEWARN', False$)
RejWfrIDs = '' rv = Dialog_Box('NCR', @WINDOW, NCRNo)
CurrSlotIDs = '' Send_Event(@WINDOW, 'READ')
end
sCnt = COUNT(SlotNos,@VM) + (SlotNos NE '')
FOR N = 1 TO sCnt
* * * * Added 3/23/2016 JCH - wafer history * * * *
RejWfrID = RejWaferIDs<1,N>
CurrSlotID = WONo:'*':CassNo:'*':SlotNos<1,N>
Convert '.' To '*' In RejWfrID
RejWfrIDs<1,-1> = RejWfrID
CurrSlotIDs<1,-1> = CurrSlotID
Parms = RejWfrID:@RM ;* WfrID
Parms := RejDTM:@RM ;* EventDtm
Parms := @USER4:@RM ;* EventBy
Parms := 'NCR':@RM ;* Event
Parms := '':@RM ;* NewSlotID
Parms := '':@RM ;* RunLoc
Parms := NCRNo:@RM ;* NCRNo
Parms := '':@RM ;* TWUse
Parms := CurrSlotID:@RM ;* CurrSlotID
Parms := '':@RM ;* NewToolID
Parms := '':@RM ;* CurrToolID
Parms := '':@RM ;* NewInvLoc
Parms := '':@RM ;* CurrInvLoc
Parms := 'O' ;* Wfr Side
obj_WO_Wfr('AddEvent',Parms)
* * * * * * * * *
LineNo = SlotNos<1,N>
NEXT N
END
Set_Property(@WINDOW:'.SLOT','SELPOS',SlotSelection) ;* Toggle WM_IN select off
Set_Property(@WINDOW, 'SAVEWARN', False$)
rv = Dialog_Box('NCR', @WINDOW, NCRNo)
Send_Event(@WINDOW, 'READ')
end else end else
// Cassette is on hold so material cannot be rejected. // Cassette is on hold so material cannot be rejected.
ErrorMessage = 'Create NCR denied!. The cassette must be taken off hold before rejecting material.' ErrorMessage = 'Create NCR denied!. The cassette must be taken off hold before rejecting material.'

View File

@ -179,7 +179,7 @@ Display_Message:
If LongLen EQ TitleLen then If LongLen EQ TitleLen then
PixMult = 5.9 ; // Title is bold so it requires more pixels PixMult = 5.9 ; // Title is bold so it requires more pixels
end else end else
PixMult = 5.2 ; // 5.1 wasn't quite enough for some lines PixMult = 6 ; // 5.2 wasn't quite enough for some lines
end end
ItemWidth = PixMult * LongLen ItemWidth = PixMult * LongLen
@ -240,7 +240,7 @@ Display_Message:
If ComboVisible then Set_Property(Subclass, 'OLE.ComboDropDown[' : CtrlEntIdSub : ']', False$) If ComboVisible then Set_Property(Subclass, 'OLE.ComboDropDown[' : CtrlEntIdSub : ']', False$)
end end
* ShowAtY = CtrlYpos + CtrlHeight * ShowAtY = CtrlYpos + CtrlHeight
ShowAtY = CtrlYpos + 2 ShowAtY = CtrlYpos + 2
// The SRP Popup display should be at least as wide as the control for visual purposes. Add an extra pixel of // The SRP Popup display should be at least as wide as the control for visual purposes. Add an extra pixel of
// width to account for the cell border. // width to account for the cell border.
If CtrlWidth GT FullWidth then FullWidth = CtrlWidth If CtrlWidth GT FullWidth then FullWidth = CtrlWidth
@ -356,3 +356,4 @@ Display_Message:
Done = True$ Done = True$
return return

View File

@ -1,12 +1,58 @@
Compile function NCR_Services(@Service, @Params) Compile function NCR_Services(@Service, @Params)
#pragma precomp SRP_PreCompiler #pragma precomp SRP_PreCompiler
$insert LOGICAL /***********************************************************************************************************************
Declare subroutine Set_Status, Logging_Services, Error_Services Name : NCR_Services
Declare function Environment_Services, Logging_Services, SRP_Datetime, Utility
EQU CRLF$ TO \0D0A\ Description : Handler program for all NCR services.
EQU TAB$ TO CHAR(9)
Notes : Application errors should be logged using the Error Services module. There are a few methodological
assumptions built into way errors are managed which are important to understand in order to properly
work with Error Services:
- The term 'top' refers to the originating procedure of a call stack and the term 'bottom' refers to
the last routine (or the current routine) within a call stack. Within the OpenInsight Debugger
this will appear backwards since the originating procedure always appears at the bottom of the
list and the current routine appears at the top of the list. We are using this orientation because
it is common to refer to the process of calling other procedures as 'drilling down'.
- The reason for defining the orientation of the call stack is because Error_Services allows for
multiple error conditions to be appended to an original error. In most cases this will happen when
a procedure at the bottom of the stack generates an error condition and then returns to its
calling procedure. This higher level procedure can optionally add more information relevant to
itself. This continues as the call stack 'bubbles' its way back to the top to where the
originating procedure is waiting.
- Native OpenInsight commands that handle errors (e.g., Set_Status, Set_FSError, Set_EventStatus)
preserve their error state until explicitly cleared. This can hinder the normal execution of code
since subsequent procedures (usually SSPs) will fail if a pre-existing error condition exists.
Our philosophy is that error conditions should automatically be cleared before a new procedure
is executed to avoid this problem. However, the nature of Basic+ does not make this easy to
automate for any given stored procedure. Therefore, if a stored procedure wants to conform to our
philosophy then it should include a call into the 'Clear' service request at the top of the
program. Alternatively this can be done through a common insert (see SERVICE_SETUP for example.)
- Service modules will use the SERVICE_SETUP insert and therefore automatically clear out any
error conditions that were set before.
Parameters :
Service [in] -- Name of the service being requested
Param1-10 [in/out] -- Additional request parameter holders
Response [out] -- Response to be sent back to the Controller (MCP) or requesting procedure
Metadata :
History : (Date, Initials, Notes)
08/29/24 djm Add ProcessScanData service and Service header.
***********************************************************************************************************************/
$insert APP_INSERTS
$Insert SERVICE_SETUP
Declare subroutine Set_Status, Logging_Services, Error_Services, Obj_Notes, Set_Property, Obj_Wo_Mat, Hold_Services
Declare function Environment_Services, Logging_Services, SRP_Datetime, Utility, Scan_Services, Error_Services
Declare function Database_Services, Signature_Services, Epipro_Services, Rds_Services, Memberof, Datetime
Declare function Get_Property
EQU COL$RDS_NO TO 1 EQU COL$RDS_NO TO 1
EQU COL$REACTOR TO 2 EQU COL$REACTOR TO 2
@ -16,180 +62,525 @@ GoToService
Return Response or "" Return Response or ""
//----------------------------------------------------------------------------- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Service Parameter Options
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Options SCAN_TYPES = 'CASSETTE_1', 'CASSETTE_2', 'WM_IN_1', 'WM_IN_2'
//----------------------------------------------------------------------------------------------------------------------
// SERVICES // SERVICES
//----------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
Service SendToSPC(NCRNo, RDSList, ReactorType, PSNo, DeptResp, LossCode, LossDesc, LossStage, LossBy, ACCode, ACDesc)
Headers = 'Logging DTM' : @FM : 'Machine' : @FM : 'Level' : @FM : 'Log'
ColumnWidths = 20 : @FM : 12 : @FM : 7 : @FM : 500
Machine = Environment_Services('GetServer')
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\NCR'
makeDirSuccess = Utility("MAKEDIR", LogPath)
LogDate = Oconv(Date(), 'D4/')
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : '_NcrSendToSpc.csv'
objLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, ' ', Headers, ColumnWidths, False$, False$)
RdsNos = ''
RdsCount = 0
ReactorList = ''
ReactorCount = 0
RejCntList = ''
RejCntCount = 0
RDSCnt = DCOUNT(RDSList<1>,@VM)
If RDSCnt GT 0 then
FOR I = 1 TO RDSCnt
If RdsNos NE '' then
RdsNos := ', '
end
RdsNos := RDSList<COL$RDS_NO, I>
RdsCount += Num(RDSList<COL$RDS_NO, I>)
If ReactorList NE '' then
ReactorList := ', '
end
ReactorList := RDSList<COL$REACTOR, I>
ReactorCount += Num(RDSList<COL$REACTOR, I>)
If RejCntList NE '' then
RejCntList := ', '
end
RejCntList := RDSList<COL$REJ_CNT, I>
RejCntCount += Num(RDSList<COL$REJ_CNT, I>)
Next I
end
LogMessage = 'Attempting to send NCR data to SPC. Data: {'
LogMessage := 'NCR No: ' : NCRNo
LogMessage := ', RDS Nos: ' : RdsNos
LogMessage := ', Reactors: ' : ReactorList
LogMessage := ', Reject Counts: ' : RejCntList
LogMessage := ', Reactor Type: ' : ReactorType
LogMessage := ', PSN: ' : PSNo
LogMessage := ', Responsible Dept: ' : DeptResp
LogMessage := ', Loss Code: ' : LossCode
LogMessage := ', Loss Desc: ' : LossDesc
LogMessage := ', Loss Stage: ' : LossStage
LogMessage := ', Loss By: ' : LossBy
LogMessage := ', AC Code: ' : ACCode
LogMessage := ', AC Desc: ' : ACDesc
LogMessage := '}'
LogDate = Oconv(Date(), 'D4/')
LogData = ''
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') ; // Logging DTM
LogData<2> = Machine
LogData<3> = 'INFO'
LogData<4> = LogMessage
Logging_Services('AppendLog', objLog, LogData, @RM, @FM, False$)
ArgsNotNull = NCRNo NE '' and RDSList NE '' and ReactorType NE '' and PSNo NE ''
ArgsNotNull = ArgsNotNull EQ True$ and DeptResp NE '' and LossCode NE ''
ArgsNotNull = ArgsNotNull EQ True$ and LossDesc NE '' and LossStage NE ''
ArgsNotNull = ArgsNotNull EQ True$ and LossBy NE '' and ACCode NE '' and ACDesc NE ''
RdsListCountsAtLeastOne = RdsCount GE 1 and ReactorCount GE 1 and RejCntCount GE 1
RdsListCountsEqual = RdsCount EQ ReactorCount and ReactorCount EQ RejCntCount
If ArgsNotNull EQ True$ and RdsListCountsAtLeastOne NE False$ and RdsListCountsEqual NE False$ then
DataLines = ''
FOR I = 1 TO RDSCnt //----------------------------------------------------------------------------------------------------------------------
// ProcessScanData
DataLine = QUOTE(NCRNo):TAB$ //
DataLine := QUOTE(RDSList<COL$RDS_NO, I>):TAB$ // ScanData - [Required]
// ScanType - [Required]
IF ReactorType = 'P' OR ReactorType = 'EPP' THEN // FirstCassID - [Required]
DataLine := QUOTE('EP':RDSList<COL$REACTOR, I>):TAB$ ;* EpiPRO reactors in SPC have "EP" on the front. // OperatorID - [Required]
END ELSE //
DataLine := QUOTE(RDSList<COL$REACTOR, I>):TAB$ // Returns the current stage of a lot. Replaces CURR_STAGE calculated column.
END //----------------------------------------------------------------------------------------------------------------------
Service ProcessScanData(ScanData, ScanType = SCAN_TYPES, FirstCassID, OperatorID)
DataLine := QUOTE(RDSList<COL$REJ_CNT, I>):TAB$
DataLine := QUOTE(PSNo):TAB$ If (ScanData NE '') then
DataLine := QUOTE(DeptResp):TAB$ // Code 3of9 encodes the asterisk and underscore characters. These need to be decoded.
DataLine := QUOTE(LossCode):TAB$ ScanData = Scan_Services('DecodeScanData', ScanData)
DataLine := QUOTE(LossDesc):TAB$
DataLine := QUOTE(LossStage):TAB$ If Error_Services('NoError') then
DataLine := QUOTE(LossBy):TAB$
DataLine := QUOTE(ACCode):TAB$ ColumnIndex = ''
DataLine := QUOTE(ACDesc):TAB$ ColumnValue = ''
// Identify the scan data based on the data identifier prefix (if any). Otherwise, assume this is a
DataLines := DataLine:CRLF$ // type of cassette ID (i.e., RDS or WMO).
Begin Case
NEXT I
Case ScanType EQ 'WM_IN_1'
DateTime = SRP_Datetime("Now") ValidCassID = False$
Year = SRP_Datetime("Year", DateTime) cnt = Count(ScanData, '|')
Month = SRP_Datetime("Month", DateTime) if cnt NE 0 then
Day = SRP_Datetime("Day", DateTime) Error_Services('Add', 'Wrong label - Scan 2D Top Label')
return
FileName = NCRNo : '_NCR_Data_' : Year : Month : Day : '.txt' end else
Path = Environment_Services('GetSPCDataPath') CassetteID = ScanData
Swap 'FDI' with '' in CassetteID
DOSFile = Path : '\' : FileName Swap '^FS' with '' in CassetteID
Convert '.' to '*' in CassetteID
Set_Status(0) WMIRow = Database_Services('ReadDataRow', 'WM_IN', CassetteID)
If Error_Services('NoError') then
OSRead DOSRecord FROM DOSFile ELSE ValidCassID = True$
ErrCode = Status() end
IF ErrCode = 4 THEN ScanData = CassetteID
DOSRecord = '' ;* File doesn't exist If ScanData NE FirstCassID then
END ELSE Error_Services('Add', 'Lot Label does not match the expected lot in OI. | Please correct this issue and then retry.')
* ErrMsg('Unable to read DOS file "SPC_Data.TXT" for update. ':ErrCode:' Please try again.') ;* Remarked out per Chad Becker request - dkk 12/9/14 end
RETURN end
END
END If ValidCassID EQ False$ then
Error_Services('Add', 'Unrecognized scan data: ':ScanData)
DOSRecord := DataLines end
OSWrite DOSRecord ON DOSFile Response = ScanData
ErrCode = Status() Case ScanType EQ 'WM_IN_2'
ErrorMessage = '' ValidCassID = False$
Begin Case ScanMismatch = False$
Case ErrCode EQ 1 cnt = Count(ScanData, '|')
ErrorMessage = 'Bad filename.' if cnt NE 0 then
Case ErrCode EQ 2 Error_Services('Add', 'Wrong label Scan 2D Bottom Label')
ErrorMessage = 'Cannot write to file. Access denied.' return
Case ErrCode EQ 3 end else
ErrorMessage = 'Disk or directory full.' CassetteID = ScanData
Case ErrCode EQ 4 Swap 'FDI' with '' in CassetteID
ErrorMessage = 'File does not exist.' Swap '^FS' with '' in CassetteID
Case ErrCode EQ 5 Convert '.' to '*' in CassetteID
ErrorMessage = 'Unknown error.' WMIRow = Database_Services('ReadDataRow', 'WM_IN', CassetteID)
Case ErrCode EQ 6 If Error_Services('NoError') then
ErrorMessage = 'Attempt to write to a read-only file.' ValidCassID = True$
End Case end
ScanData = CassetteID
LogDate = Oconv(Date(), 'D4/') If ScanData NE FirstCassID then
LogData = '' ScanMismatch = True$
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') ; // Logging DTM end
LogData<2> = Machine end
If ErrorMessage NE '' then
ErrorMessage = 'Error in ' : Service : '. When attempting to write the NCR data to a file the following error occurred. ' : ErrorMessage If ScanMismatch EQ True$ then
LogData<3> = 'ERROR' ValidCassID = False$
LogData<4> = ErrorMessage If (RowExists('WM_IN', FirstCassID) EQ True$) And (RowExists('WM_IN', CassetteID) EQ True$) then
Logging_Services('AppendLog', objLog, LogData, @RM, @FM, False$) // Place first cassette on hold
Error_Services('Add', ErrorMessage) WONo = Field(FirstCassID, '*', 1, 1)
end else CassNo = Field(FirstCassID, '*', 3, 1)
LogData<3> = 'INFO' HoldEntity = 'WM_IN'
LogData<4> = 'Sucessfully sent NCR ' : NCRNo : ' data to SPC in file ' : DOSFile : '.' HoldEntityID = FirstCassID
Logging_Services('AppendLog', objLog, LogData, @RM, @FM, False$)
end WOMatKey = WONo:'*':CassNo
end else CtrlEntID = 'NCR_SERVICES' ;* Control checked/unchecked
ErrorMessage = 'Error in ' : Service : '. One or more arguments were null or malformed.' OriginFlag = '' ;* Flag to indicate a hold initiated from the packagaing form
LogDate = Oconv(Date(), 'D4/') HoldData = ''
LogData = '' HoldData<1> = OperatorID
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') ; // Logging DTM HoldData<2> = 'Lot placed on hold due to NCR Barcode verification mismatch.'
LogData<2> = Machine HoldData<3> = False$
LogData<3> = 'ERROR' Hold_Services('OnHold', WOMatKey, HoldEntity, HoldEntityID, 'HOLD', HoldData, OperatorID)
LogData<4> = ErrorMessage
Logging_Services('AppendLog', objLog, LogData, @RM, @FM, False$) // Place Second cassette on hold
Error_Services('Add', ErrorMessage) WONo = Field(CassetteID, '*', 1, 1)
end CassNo = Field(CassetteID, '*', 3, 1)
HoldEntity = 'WM_IN'
HoldEntityID = CassetteID
WOMatKey = WONo:'*':CassNo
CtrlEntID = 'NCR_SERVICES' ;* Control checked/unchecked
OriginFlag = '' ;* Flag to indicate a hold initiated from the packagaing form
HoldData = ''
HoldData<1> = OperatorID
HoldData<2> = 'Lot placed on hold due to NCR Barcode verification mismatch.'
HoldData<3> = False$
Hold_Services('OnHold', WOMatKey, HoldEntity, HoldEntityID, 'HOLD', HoldData, OperatorID)
Message = 'NCR Label verification failed due to mismatched barcodes. Both cassettes placed on hold - Supervisor, Lead, or Engineering disposition required.':CRLF$ |
: 'WM_IN Label #1: ':FirstCassID:CRLF$ |
: 'WM_IN Label #2: ':CassetteID:CRLF$ |
: 'Operator: ':OperatorID
Error_Services('Add', Message)
end else
Error_Services('Add', 'Unrecognized scan data: ':ScanData)
end
end
If ValidCassID EQ False$ then
Error_Services('Add', 'Unrecognized scan data: ':ScanData)
end
Response = ScanData
Case ScanType EQ 'CASSETTE_1'
// Assume this is intended to be a Cassette ID scan (either WMO or RDS). Only if this is a
// non-existent carrier will the scan data be considered invalid.
cnt = DCount(ScanData, '|')
if cnt NE 8 then
CassetteID = 0
Error_Services('Add', 'Wrong label - Scan 2D Top Label')
return
end else
// RDS should be 3rd position
CassetteID = Field(ScanData, '|', 3)
Seq1 = Field(ScanData, '|', 8)
end
// Strip '1T', 'I', and 'O' prefixes.
If CassetteID[1, 2] EQ '1T' then
CassetteID[1, 2] = ''
If ((CassetteID[1, 1] EQ 'O') or (CassetteID[1, 1] EQ 'I')) then CassetteID[1, 1] = ''
end
If ( (CassetteID[1, 1] EQ 'O') or (CassetteID[1, 1] EQ 'I') ) then CassetteID[1, 1] = ''
ValidCassID = False$ ; // Assume Cassette ID is not valid for now.
RDSCass = Count(CassetteID, '.') EQ 0 AND Num(CassetteID)
GaNCass = Count(CassetteID, '.') EQ 1 AND not(RDSCass)
EPPCass = Count(CassetteID, '.') EQ 2 AND not(RDSCass) AND not(GaNCass)
Begin Case
Case GaNCass
Convert '.' to '*' in CassetteID
WOMatRow = Database_Services('ReadDataRow', 'WO_MAT', CassetteID)
If Error_Services('NoError') then
ValidCassID = True$
end
Case EPPCass
Convert '.' to '*' in CassetteID
WMOutRow = Database_Services('ReadDataRow', 'WM_OUT', CassetteID)
If Error_Services('NoError') then
ValidCassID = True$
end
Case RDSCass
RDSRow = Database_Services('ReadDataRow', 'RDS', CassetteID)
If Error_Services('NoError') then
ValidCassID = True$
end
End Case
If ( (Seq1 EQ 'SEQ1') or (Seq1 EQ 'SEQ2') ) then
Set_Property(@Window, '@SEQ1', Seq1)
end else
Error_Services('Add', 'Error reading sequence information')
end
If ValidCassID EQ False$ then
Error_Services('Add', 'Unrecognized scan data: ':ScanData)
end
ScanData = CassetteID
If ScanData NE FirstCassID then
Error_Services('Add', 'Lot Label does not match the expected lot in OI. | Please correct this issue and then retry.')
end
Response = ScanData
Case ScanType EQ 'CASSETTE_2'
// Assume this is intended to be a Cassette ID scan (either WMO or RDS). Only if this is a
// non-existent carrier will the scan data be considered invalid.
cnt = DCount(ScanData, '|')
if cnt NE 8 then
CassetteID = 0
Error_Services('Add', 'Wrong label Scan 2D Bottom Label')
return
end else
// RDS should be 3rd position
SecondCassID = Field(ScanData, '|', 3)
Seq2 = Field(ScanData, '|', 8)
end
// Strip '1T', 'I', and 'O' prefixes.
If SecondCassID[1, 2] EQ '1T' then
SecondCassID[1, 2] = ''
If ( (SecondCassID[1, 1] EQ 'O') or (SecondCassID[1, 1] EQ 'I') ) then SecondCassID[1, 1] = ''
end
If ( (SecondCassID[1, 1] EQ 'O') or (SecondCassID[1, 1] EQ 'I') ) then SecondCassID[1, 1] = ''
ValidCassID = False$ ; // Assume Cassette ID is not valid for now.
ScanMismatch = False$
SeqMismatch = False$
SeqError = False$
Convert '*' to '.' in FirstCassID
If Error_Services('NoError') then
ValidCassID = True$
If (SecondCassID NE FirstCassID) then
ScanMismatch = True$
end else
Seq1 = Get_Property(@Window, '@SEQ1')
Begin Case
Case ( (Seq2 NE 'SEQ1') and (Seq2 NE 'SEQ2') )
SeqError = True$
Case (Seq2 EQ Seq1)
SeqMismatch = True$
End Case
end
end
If ValidCassID EQ False$ then Error_Services('Add', 'Unrecognized scan data: ':ScanData)
If (ScanMismatch EQ True$) AND (ValidCassID EQ True$) then
// Check if first cassette ID is a valid RDS or WM_OUT key
Convert '.' to '*' in FirstCassID
ValidCassID = False$
Begin Case
Case ( RowExists('RDS', FirstCassID) EQ True$ )
ValidCassID = True$
WONo = Xlate('RDS', FirstCassID, 'WO', 'X')
CassNo = Xlate('RDS', FirstCassID, 'CASS_NO', 'X')
HoldEntity = 'RDS'
Case ( RowExists('WM_OUT', FirstCassID) EQ True$ )
ValidCassID = True$
WONo = Field(FirstCassID, '*', 1, 1)
CassNo = Field(FirstCassID, '*', 3, 1)
HoldEntity = 'WM_OUT'
Case ( RowExists('WM_IN', FirstCassID) EQ True$ )
ValidCassID = True$
WONo = Field(FirstCassID, '*', 1, 1)
CassNo = Field(FirstCassID, '*', 3, 1)
HoldEntity = 'WM_IN'
Case ( RowExists('WO_MAT', FirstCassID) EQ True$ )
ValidCassID = True$
WONo = Field(FirstCassID, '*', 1, 1)
CassNo = Field(FirstCassID, '*', 2, 1)
HoldEntity = 'WO_MAT'
Case Otherwise$
Null
End Case
HoldEntityID = FirstCassID
// Place first cassette on hold
WOMatKey = WONo:'*':CassNo
CtrlEntID = 'NCR_SERVICES' ;* Control checked/unchecked
OriginFlag = '' ;* Flag to indicate a hold initiated from the packagaing form
HoldData = ''
HoldData<1> = OperatorID
HoldData<2> = 'Lot placed on hold due to NCR Barcode verification mismatch.'
HoldData<3> = False$
Hold_Services('OnHold', WOMatKey, HoldEntity, HoldEntityID, 'HOLD', HoldData, OperatorID)
// Check if second cassette ID is a valid RDS or WM_OUT key
Convert '.' to '*' in SecondCassID
ValidCassID = False$
Begin Case
Case ( RowExists('RDS', SecondCassID) EQ True$ )
ValidCassID = True$
WONo = Xlate('RDS', SecondCassID, 'WO', 'X')
CassNo = Xlate('RDS', SecondCassID, 'CASS_NO', 'X')
HoldEntity = 'RDS'
ValidCassID = True$
Case ( RowExists('WM_OUT', SecondCassID) EQ True$ )
ValidCassID = True$
WONo = Field(SecondCassID, '*', 1, 1)
CassNo = Field(SecondCassID, '*', 3, 1)
HoldEntity = 'WM_OUT'
Case ( RowExists('WM_IN', SecondCassID) EQ True$ )
WONo = Field(SecondCassID, '*', 1, 1)
CassNo = Field(SecondCassID, '*', 3, 1)
HoldEntity = 'WM_IN'
ValidCassID = True$
Case ( RowExists('WO_MAT', SecondCassID) EQ True$ )
WONo = Field(SecondCassID, '*', 1, 1)
CassNo = Field(SecondCassID, '*', 2, 1)
HoldEntity = 'WO_MAT'
ValidCassID = True$
Case Otherwise$
Null
End Case
If ValidCassID EQ True$ then
HoldEntityID = SecondCassID
WOMatKey = WONo:'*':CassNo
// Place second cassette on hold
CtrlEntID = 'NCR_SERVICES' ;* Control checked/unchecked
OriginFlag = '' ;* Flag to indicate a hold initiated from the packagaing form
HoldData = ''
HoldData<1> = OperatorID
HoldData<2> = 'Lot placed on hold due to NCR Barcode verification mismatch.'
HoldData<3> = False$
Hold_Services('OnHold', WOMatKey, HoldEntity, HoldEntityID, 'HOLD', HoldData, OperatorID)
end
Message = 'NCR Label verification failed due to mismatched barcodes. Both cassettes placed on hold - Supervisor, Lead, or Engineering disposition required.':CRLF$ |
: 'Cassette Label #1: ':FirstCassID:CRLF$ |
: 'Cassette Label #2: ':SecondCassID:CRLF$ |
: 'Operator: ':OperatorID
Error_Services('Add', Message)
end else if (SeqMismatch EQ True$) then
//do sequence mismatch stuff here
Message = 'NCR Label verification failed due to operator double-scanning barcode.':CRLF$ |
: 'Cassette: ':FirstCassID:CRLF$ |
: 'Operator: ':OperatorID
Error_Services('Add', Message)
end else if (SeqError EQ True$) then
Error_Services('Add', 'Error reading sequence information')
end
ScanData = ''
ScanData = SecondCassID
Response = ScanData
End Case
end
end else
Error_Services('Add', 'ScanData argument was missing in the ' : Service : ' service.')
end
end service end service
Service SendToSPC(NCRNo, RDSList, ReactorType, PSNo, DeptResp, LossCode, LossDesc, LossStage, LossBy, ACCode, ACDesc)
Headers = 'Logging DTM' : @FM : 'Machine' : @FM : 'Level' : @FM : 'Log'
ColumnWidths = 20 : @FM : 12 : @FM : 7 : @FM : 500
Machine = Environment_Services('GetServer')
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\NCR'
makeDirSuccess = Utility("MAKEDIR", LogPath)
LogDate = Oconv(Date(), 'D4/')
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : '_NcrSendToSpc.csv'
objLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, ' ', Headers, ColumnWidths, False$, False$)
RdsNos = ''
RdsCount = 0
ReactorList = ''
ReactorCount = 0
RejCntList = ''
RejCntCount = 0
RDSCnt = DCOUNT(RDSList<1>,@VM)
If RDSCnt GT 0 then
FOR I = 1 TO RDSCnt
If RdsNos NE '' then
RdsNos := ', '
end
RdsNos := RDSList<COL$RDS_NO, I>
RdsCount += Num(RDSList<COL$RDS_NO, I>)
If ReactorList NE '' then
ReactorList := ', '
end
ReactorList := RDSList<COL$REACTOR, I>
ReactorCount += Num(RDSList<COL$REACTOR, I>)
If RejCntList NE '' then
RejCntList := ', '
end
RejCntList := RDSList<COL$REJ_CNT, I>
RejCntCount += Num(RDSList<COL$REJ_CNT, I>)
Next I
end
LogMessage = 'Attempting to send NCR data to SPC. Data: {'
LogMessage := 'NCR No: ' : NCRNo
LogMessage := ', RDS Nos: ' : RdsNos
LogMessage := ', Reactors: ' : ReactorList
LogMessage := ', Reject Counts: ' : RejCntList
LogMessage := ', Reactor Type: ' : ReactorType
LogMessage := ', PSN: ' : PSNo
LogMessage := ', Responsible Dept: ' : DeptResp
LogMessage := ', Loss Code: ' : LossCode
LogMessage := ', Loss Desc: ' : LossDesc
LogMessage := ', Loss Stage: ' : LossStage
LogMessage := ', Loss By: ' : LossBy
LogMessage := ', AC Code: ' : ACCode
LogMessage := ', AC Desc: ' : ACDesc
LogMessage := '}'
LogDate = Oconv(Date(), 'D4/')
LogData = ''
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') ; // Logging DTM
LogData<2> = Machine
LogData<3> = 'INFO'
LogData<4> = LogMessage
Logging_Services('AppendLog', objLog, LogData, @RM, @FM, False$)
ArgsNotNull = NCRNo NE '' and RDSList NE '' and ReactorType NE '' and PSNo NE ''
ArgsNotNull = ArgsNotNull EQ True$ and DeptResp NE '' and LossCode NE ''
ArgsNotNull = ArgsNotNull EQ True$ and LossDesc NE '' and LossStage NE ''
ArgsNotNull = ArgsNotNull EQ True$ and LossBy NE '' and ACCode NE '' and ACDesc NE ''
RdsListCountsAtLeastOne = RdsCount GE 1 and ReactorCount GE 1 and RejCntCount GE 1
RdsListCountsEqual = RdsCount EQ ReactorCount and ReactorCount EQ RejCntCount
If ArgsNotNull EQ True$ and RdsListCountsAtLeastOne NE False$ and RdsListCountsEqual NE False$ then
DataLines = ''
FOR I = 1 TO RDSCnt
DataLine = QUOTE(NCRNo):TAB$
DataLine := QUOTE(RDSList<COL$RDS_NO, I>):TAB$
IF ReactorType = 'P' OR ReactorType = 'EPP' THEN
DataLine := QUOTE('EP':RDSList<COL$REACTOR, I>):TAB$ ;* EpiPRO reactors in SPC have "EP" on the front.
END ELSE
DataLine := QUOTE(RDSList<COL$REACTOR, I>):TAB$
END
DataLine := QUOTE(RDSList<COL$REJ_CNT, I>):TAB$
DataLine := QUOTE(PSNo):TAB$
DataLine := QUOTE(DeptResp):TAB$
DataLine := QUOTE(LossCode):TAB$
DataLine := QUOTE(LossDesc):TAB$
DataLine := QUOTE(LossStage):TAB$
DataLine := QUOTE(LossBy):TAB$
DataLine := QUOTE(ACCode):TAB$
DataLine := QUOTE(ACDesc):TAB$
DataLines := DataLine:CRLF$
NEXT I
DateTime = SRP_Datetime("Now")
Year = SRP_Datetime("Year", DateTime)
Month = SRP_Datetime("Month", DateTime)
Day = SRP_Datetime("Day", DateTime)
FileName = NCRNo : '_NCR_Data_' : Year : Month : Day : '.txt'
Path = Environment_Services('GetSPCDataPath')
DOSFile = Path : '\' : FileName
Set_Status(0)
OSRead DOSRecord FROM DOSFile ELSE
ErrCode = Status()
IF ErrCode = 4 THEN
DOSRecord = '' ;* File doesn't exist
END ELSE
* ErrMsg('Unable to read DOS file "SPC_Data.TXT" for update. ':ErrCode:' Please try again.') ;* Remarked out per Chad Becker request - dkk 12/9/14
RETURN
END
END
DOSRecord := DataLines
OSWrite DOSRecord ON DOSFile
ErrCode = Status()
ErrorMessage = ''
Begin Case
Case ErrCode EQ 1
ErrorMessage = 'Bad filename.'
Case ErrCode EQ 2
ErrorMessage = 'Cannot write to file. Access denied.'
Case ErrCode EQ 3
ErrorMessage = 'Disk or directory full.'
Case ErrCode EQ 4
ErrorMessage = 'File does not exist.'
Case ErrCode EQ 5
ErrorMessage = 'Unknown error.'
Case ErrCode EQ 6
ErrorMessage = 'Attempt to write to a read-only file.'
End Case
LogDate = Oconv(Date(), 'D4/')
LogData = ''
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') ; // Logging DTM
LogData<2> = Machine
If ErrorMessage NE '' then
ErrorMessage = 'Error in ' : Service : '. When attempting to write the NCR data to a file the following error occurred. ' : ErrorMessage
LogData<3> = 'ERROR'
LogData<4> = ErrorMessage
Logging_Services('AppendLog', objLog, LogData, @RM, @FM, False$)
Error_Services('Add', ErrorMessage)
end else
LogData<3> = 'INFO'
LogData<4> = 'Sucessfully sent NCR ' : NCRNo : ' data to SPC in file ' : DOSFile : '.'
Logging_Services('AppendLog', objLog, LogData, @RM, @FM, False$)
end
end else
ErrorMessage = 'Error in ' : Service : '. One or more arguments were null or malformed.'
LogDate = Oconv(Date(), 'D4/')
LogData = ''
LogData<1> = Oconv(Date(), 'D4/') : ' ' : Oconv(Time(), 'MTS') ; // Logging DTM
LogData<2> = Machine
LogData<3> = 'ERROR'
LogData<4> = ErrorMessage
Logging_Services('AppendLog', objLog, LogData, @RM, @FM, False$)
Error_Services('Add', ErrorMessage)
end
end service

View File

@ -0,0 +1,201 @@
Compile function NDW_VERIFY_BARCODE_EVENTS(CtrlEntId, Event, @PARAMS)
/***********************************************************************************************************************
This program is proprietary and is not to be used by or disclosed to others, nor is it to be copied without written
permission from Infineon.
Name : NDW_NDW_VERIFY_BARCODE_Events
Description : This function acts as a commuter module for all events related to this window.
Notes : Commuter Modules are automatically called from the Promoted_Events function which is called by the
application-specific promoted event handler. This makes it possible to add QuickEvents that need to
execute Basic+ logic without having use the Form Designer to make the association, although this is
limited to the events which are currently promoted.
If the form needs to call the commuter module directly then the QuickEvent parameters should be
formatted like this:
'@SELF','@EVENT',['@PARAM1','@PARAMx']
Parameters :
CtrlEntId [in] -- The fully qualified name of the control calling the promoted event
Event [in] -- The event being executed. See the Notes section regarding "PRE" events
Param1-15 [in] -- Additional event parameter holders
EventFlow [out] -- Set to 1 or 0 so the calling event knows whether or not to chain forward. See comments in
EVENT_SETUP insert
History : (Date, Initials, Notes)
08/29/2024 djm Created initial commuter module. Adapted from NDW_PACKAGING_EVENTS.
***********************************************************************************************************************/
#pragma precomp SRP_PreCompiler
#window NDW_VERIFY_BARCODE
$insert APP_INSERTS
$insert EVENT_SETUP
$insert MSG_EQUATES
$insert LSL_USERS_EQUATES
$insert MESSAGE_BOX_EQUATES
$insert SRP_POPUP_EQUATES
$INSERT LOGICAL
Equ MSG_WIDTH$ to 600
Declare subroutine SRP_Show_Window, ErrMsg, PlaceDialog
Declare function Database_Services, Security_Services, MemberOf, Form_Services, Scan_Services
Declare function Message_Box, SRP_Get_Window_Rect, GetTickCount, Ncr_Services
SubclassInfo = Form_Services('FindSubclassControl')
Subclass = SubclassInfo<1>
// Update the arguments so that the OpenInsight OLE event will treate the ActiveX event as a native event handler.
If Event EQ 'OLE' then
Transfer Event to OIEvent
Transfer Param1 to Event
Transfer Param2 to Param1
Transfer Param3 to Param2
end
GoToEvent Event for CtrlEntId else
// Event not implemented
end
Return EventFlow or 1
//-----------------------------------------------------------------------------
// EVENT HANDLERS
//-----------------------------------------------------------------------------
Event WINDOW.CREATE(CreateParam)
Gosub GetLotID
Set_Property(@Window:'.EDL_CASS_SCAN_1', 'ENABLED', True$)
Set_Property(@Window:'.EDL_CASS_SCAN_1', 'FOCUS', True$)
PlaceDialog(-2, -2)
end event
Event EDL_CASS_SCAN_1.LOSTFOCUS(Flag, FocusID)
If Flag EQ 1 then
ScanData = Get_Property(CtrlEntID, 'TEXT')
ExpectedLot = Get_Property(@Window:'.EDL_LOT_ID', 'TEXT')
OperatorID = @User4
If ScanData NE '' then
If Parent EQ 'WM_IN' then
ScanData = NCR_Services('ProcessScanData', ScanData, 'WM_IN_1', ExpectedLot, OperatorID)
end else
ScanData = NCR_Services('ProcessScanData', ScanData, 'CASSETTE_1', ExpectedLot, OperatorID)
End
If Error_Services('NoError') then
Set_Property(CtrlEntID, 'TEXT', ScanData)
Set_Property(@Window:'.EDL_CASS_SCAN_2', 'ENABLED', True$)
Set_Property(@Window:'.EDL_CASS_SCAN_2', 'FOCUS', True$)
Set_Property(CtrlEntID, 'ENABLED', False$)
end else
GoSub ClearForm
ErrorMessage = Error_Services('GetMessage')
MsgStruct = ""
MsgStruct<MTEXTWIDTH$> = MSG_WIDTH$
Msg(@Window, MsgStruct, 'PROCESS_ERROR', '', ErrorMessage)
Set_Property(CtrlEntId, 'FOCUS', True$)
end
end
end
end event
Event EDL_CASS_SCAN_2.LOSTFOCUS(Flag, FocusID)
If Flag EQ 1 then
ScanData = Get_Property(CtrlEntID, 'TEXT')
If ScanData NE '' then
FirstCassID = Get_Property(@Window:'.EDL_CASS_SCAN_1', 'TEXT')
OperatorID = @User4
If Parent EQ 'WM_IN' then
ScanData = NCR_Services('ProcessScanData', ScanData, 'WM_IN_2', FirstCassID, OperatorID)
end else
ScanData = NCR_Services('ProcessScanData', ScanData, 'CASSETTE_2', FirstCassID, OperatorID)
End
If Error_Services('NoError') then
Set_Property(CtrlEntID, 'TEXT', ScanData)
SuccessMessage = 'NCR verification complete!'
MsgStruct = ""
MsgStruct<MTEXTWIDTH$> = MSG_WIDTH$
Msg(@Window, MsgStruct, 'PROCESS_COMPLETE', '', SuccessMessage)
End_Dialog(@Window, True$)
end else
ErrorMessage = Error_Services('GetMessage')
If IndexC(ErrorMessage, 'Unrecognized scan data:', 1) or IndexC(ErrorMessage, 'Error reading sequence information', 1) then
Set_Property(@Window:'.EDL_CASS_SCAN_2', 'TEXT', '')
MsgStruct = ""
MsgStruct<MTEXTWIDTH$> = MSG_WIDTH$
Msg(@Window, MsgStruct, 'PROCESS_ERROR', '', ErrorMessage)
Set_Property(CtrlEntId, 'FOCUS', True$)
end else
GoSub ClearForm
MsgStruct = ""
MsgStruct<MTEXTWIDTH$> = MSG_WIDTH$
Msg(@Window, MsgStruct, 'PROCESS_ERROR', '', ErrorMessage)
If Count(ErrorMessage, 'NCR Label verification failed due to mismatched barcodes.') NE 0 then
End_Dialog(@Window, False$)
End else
Set_Property(@Window:'.EDL_CASS_SCAN_1', 'FOCUS', True$)
end
end
end
end
end
end event
Event PUB_ENG_OVERRIDE.CLICK()
VerifyParams = @USER4 : @FM : 'ENGINEERING':@VM:'ENG_TECH' : @FM : '' : @FM : 'Override required by a member of ENGINEERING or ENG_TECH groups'
Response = Dialog_Box('NDW_VERIFY_USER', @WINDOW, VerifyParams)
Valid = Response<1>
OverrideUser = Response<2>
If Valid then
End_Dialog(@Window, True$)
end
end event
Event PUB_CANCEL.CLICK()
End_Dialog(@Window, False$)
end event
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Internal GoSubs
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ClearForm:
Set_Property(@Window:'.EDL_CASS_SCAN_1' , 'TEXT' , '')
Set_Property(@Window:'.EDL_CASS_SCAN_2' , 'TEXT' , '')
Set_Property(@Window:'.EDL_CASS_SCAN_1' , 'ENABLED', 1)
Set_Property(@Window:'.EDL_CASS_SCAN_2' , 'ENABLED', -1)
Set_Property(@Window:'.EDL_LOT_ID' , 'ENABLED', -1)
return
GetLotID:
LotID = Param1
Set_Property(@Window:'.EDL_LOT_ID', 'TEXT', LotID)
return

View File

@ -66,11 +66,11 @@ If Event EQ 'OLE' then
Transfer Param1 to Event Transfer Param1 to Event
Transfer Param2 to Param1 Transfer Param2 to Param1
Transfer Param3 to Param2 Transfer Param3 to Param2
* Transfer Param4 to Param3 Transfer Param4 to Param3
* Transfer Param5 to Param4 Transfer Param5 to Param4
* Transfer Param6 to Param5 Transfer Param6 to Param5
* Transfer Param7 to Param6 Transfer Param7 to Param6
* Transfer Param8 to Param7 Transfer Param8 to Param7
end end
GoToEvent Event for CtrlEntID GoToEvent Event for CtrlEntID
@ -218,9 +218,9 @@ Event PUB_OK.CLICK()
NumGroups = DCount(Groups, @VM) NumGroups = DCount(Groups, @VM)
If NumGroups GT 1 then If NumGroups GT 1 then
Swap @VM with ' or ' in Groups Swap @VM with ' or ' in Groups
Message = 'User is not a member of the ' : Groups : ' groups.' Message = 'User is not a member of ':@TM:'the ' : Groups : ' groups.'
end else end else
Message = 'User is not a member of the ' : Group : ' group.' Message = 'User is not a member of ':@TM:'the ' : Group : ' group.'
end end
Form_Services('DisplayControlMessage', Message, 'Incorrect Group', @Window : '.EDL_USERNAME', 'VALIDATION', 'RGB(229,20,0)') Form_Services('DisplayControlMessage', Message, 'Incorrect Group', @Window : '.EDL_USERNAME', 'VALIDATION', 'RGB(229,20,0)')