Modified WM_IN ZPL label generation to include a 2D datamatrix

barcode. Implemented 2D barcode verification in PTI and FQA Label Check
Operations.

Bug fixes

Changed WMI 2D barcode to have 8 fields to keep code base simpler

minor changes to error message verbiage

Refactored code to use post log. Refactored code to not use multiple returns. Modfield input form fields to force upper case only.

changed LSL password verification to be case insensitive to avoid barcode scanning issues when caps lock is on

temporary change to allow 1D WMI scans at PTI while we exhaust current supply
This commit is contained in:
Infineon\Mitchem
2025-05-28 12:58:56 -07:00
committed by Stieber Daniel (CSC FI SPS MESLEO)
parent 2f6b376ece
commit b2c9e500f8
16 changed files with 5621 additions and 2639 deletions

View File

@ -15,6 +15,7 @@ $INSERT EPI_PART_EQUATES
$INSERT COMPANY_EQUATES
$INSERT CUST_EPI_PART_EQUATES
$INSERT PRS_STAGE_EQUATES
$INSERT UNIT_EQUATES
DECLARE FUNCTION FIELDCOUNT, MSG, Key_Sort, Get_Printer, SRP_Math, Set_Printer, Utility, obj_Install, Printer_Select, obj_Vendor_Code, Direct_Print, Environment_Services
DECLARE SUBROUTINE Extract_Si_Keys, Update_Index, ErrMsg
@ -48,129 +49,139 @@ EQU PS$RECIPE TO 3
EQU PS$FREQ TO 4
EQU PS$PATTERN TO 11
IF NOT(ASSIGNED(RdsIds)) THEN RdsIds = '' ;* 5/21/2005 - JCH - Added for Order Entry/Vision upgrade
IF NOT(ASSIGNED(MultiStep)) THEN MultiStep = '' ;* 5/21/2005 - JCH - Added for Order Entry/Vision upgrade
Main:
IF RdsIds = '' THEN RETURN 0 ;* 5/21/2005 - JCH - Added for Order Entry/Vision upgrade
IF MultiStep = '' THEN MultiStep = 0 ;* 5/21/2005 - JCH - Added for Order Entry/Vision upgrade
IF NOT(ASSIGNED(RdsIds)) THEN RdsIds = '' ;* 5/21/2005 - JCH - Added for Order Entry/Vision upgrade
IF NOT(ASSIGNED(MultiStep)) THEN MultiStep = '' ;* 5/21/2005 - JCH - Added for Order Entry/Vision upgrade
FileName = "Printing Label"
Title = "Printing Label"
IF RdsIds = '' THEN RETURN 0 ;* 5/21/2005 - JCH - Added for Order Entry/Vision upgrade
IF MultiStep = '' THEN MultiStep = 0 ;* 5/21/2005 - JCH - Added for Order Entry/Vision upgrade
PageInfo = ''
PageInfo<PI$LEFT> = 0.1
PageInfo<PI$TOP> = 0.1
PageInfo<PI$RIGHT> = 0.1
PageInfo<PI$BOTTOM> = 0.1
FileName = "Printing Label"
Title = "Printing Label"
PageSetup = '1' ;* Landscape
PrintSetup = '' ;* Preview
PageInfo = ''
PageInfo<PI$LEFT> = 0.1
PageInfo<PI$TOP> = 0.1
PageInfo<PI$RIGHT> = 0.1
PageInfo<PI$BOTTOM> = 0.1
PrinterID = ''
PrintPath = Printer_Select(PrinterID) ;* Popup is skipped IF Printer ID is passed
PageSetup = '1' ;* Landscape
PrintSetup = '' ;* Preview
If PrintPath NE '' then
If Environment_Services('GetLabelPrintMethod') _EQC 'OIPI' then
stat = Set_Printer("INIT",FileName,Title,PageInfo,PageSetup,PrintSetup,PrintPath)
end else
stat = Direct_Print('START', PrintPath<1>, '', '')
end
IF stat < 0 THEN GOTO OIPrint_Error
EQU DosPath$ TO 'C:\WINDOWS\OIZPL.TXT' ;* remove jch
CLOrientation = '' ;* used for printing on cleanroom labels
IF RdsIds THEN
Update_Index ("RDS", "WO", "")
Void = utility( 'CURSOR', 'H' )
IdCnt = fieldcount( RdsIds, @FM )
* sort by run order number
IF IdCnt > 1 THEN
RdsIds = key_sort( RdsIds, 'RDS', 'WO':@FM:'RUN_ORDER_NUM', 1, '', '' )
END
PrinterID = ''
PrintPath = Printer_Select(PrinterID) ;* Popup is skipped IF Printer ID is passed
If PrintPath NE '' then
// To work around the design flaws in the label printing logic regarding multiple RDS Key IDs
// while still preserving the variable names, the RdsIds values will be transferred to AllRdsIds
// and then each RDS Key ID will be parsed in a loop and passed into the RdsIds variable.
Transfer RdsIds to AllRdsIds
For Each RdsIds in AllRdsIds using @FM
IdCnt = fieldcount( RdsIds, @FM )
GOSUB PrintCleanRoomLabels
Next RdsIds
If Environment_Services('GetLabelPrintMethod') _EQC 'OIPI' then
stat = Set_Printer("INIT",FileName,Title,PageInfo,PageSetup,PrintSetup,PrintPath)
end else
stat = Direct_Print('START', PrintPath<1>, '', '')
end
// Restore RdsIds variable for other processes that need it to be intact.
Transfer AllRdsIds to RdsIds
IF stat GE 0 THEN
UniqueWOs = ''
CustNos = ''
CompositeKeys = ''
IdCnt = fieldcount( RdsIds, @FM )
IF MultiStep > 0 THEN
EQU DosPath$ TO 'C:\WINDOWS\OIZPL.TXT' ;* remove jch
WOStepKeys = XLATE('RDS',RdsIds,RDS_WO_STEP_KEY$,'X') ;* 5/21/2005 - JCH - Added for Order Entry/Vision upgrade
FOR I = 1 TO IdCnt
ThisWO = WOStepKeys<I>
CONVERT '*' TO '.' IN ThisWO
CassNo = XLATE('RDS',RdsIds<I>,'CASS_NO','X')
WOMatRec = XLATE('WO_MAT',ThisWO:'*':CassNo,'','X')
ReShipCustNo = WOMatRec<WO_MAT_RESHIP_CUST_NO$>
If ReShipCustNo EQ '' then
CustNo = XLATE( 'WO_LOG', ThisWO, wo_log_cust_no$, 'X' )
end else
CustNo = ReShipCustNo
end
LOCATE ThisWO : '*' : CustNo IN CompositeKeys USING @VM SETTING FPos ELSE
UniqueWOs<1,-1> = ThisWO
CustNos<1,-1> = CustNo
CompositeKeys<1,-1> = ThisWO : '*' : CustNo
CLOrientation = '' ;* used for printing on cleanroom labels
IF RdsIds THEN
Update_Index ("RDS", "WO", "")
Void = utility( 'CURSOR', 'H' )
IdCnt = fieldcount( RdsIds, @FM )
* sort by run order number
IF IdCnt > 1 THEN
RdsIds = key_sort( RdsIds, 'RDS', 'WO':@FM:'RUN_ORDER_NUM', 1, '', '' )
END
NEXT I
END ELSE
AllWOs = XLATE( 'RDS', RdsIds, rds_wo$, 'X' )
FOR I = 1 TO IdCnt
ThisWO = AllWOs<I>
CassNo = XLATE('RDS',RdsIds<I>,'CASS_NO','X')
WOMatRec = XLATE('WO_MAT',ThisWO:'*':CassNo,'','X')
ReShipCustNo = WOMatRec<WO_MAT_RESHIP_CUST_NO$>
If ReShipCustNo EQ '' then
CustNo = XLATE( 'WO_LOG', ThisWO, wo_log_cust_no$, 'X' )
end else
CustNo = ReShipCustNo
end
LOCATE ThisWO : '*' : CustNo IN CompositeKeys USING @VM SETTING Fpos ELSE
UniqueWOs<1,-1> = ThisWO
CustNos<1,-1> = CustNo
CompositeKeys<1,-1> = ThisWO : '*' : CustNo
END
NEXT I
END
// To work around the design flaws in the label printing logic regarding multiple RDS Key IDs
// while still preserving the variable names, the RdsIds values will be transferred to AllRdsIds
// and then each RDS Key ID will be parsed in a loop and passed into the RdsIds variable.
Transfer RdsIds to AllRdsIds
For Each RdsIds in AllRdsIds using @FM
IdCnt = fieldcount( RdsIds, @FM )
GOSUB PrintCleanRoomLabels
Next RdsIds
// Restore RdsIds variable for other processes that need it to be intact.
Transfer AllRdsIds to RdsIds
UniqueWOs = ''
CustNos = ''
CompositeKeys = ''
IdCnt = fieldcount( RdsIds, @FM )
IF MultiStep > 0 THEN
WOStepKeys = XLATE('RDS',RdsIds,RDS_WO_STEP_KEY$,'X') ;* 5/21/2005 - JCH - Added for Order Entry/Vision upgrade
FOR I = 1 TO IdCnt
ThisWO = WOStepKeys<I>
CONVERT '*' TO '.' IN ThisWO
CassNo = XLATE('RDS',RdsIds<I>,'CASS_NO','X')
WOMatRec = XLATE('WO_MAT',ThisWO:'*':CassNo,'','X')
ReShipCustNo = WOMatRec<WO_MAT_RESHIP_CUST_NO$>
If ReShipCustNo EQ '' then
CustNo = XLATE( 'WO_LOG', ThisWO, wo_log_cust_no$, 'X' )
end else
CustNo = ReShipCustNo
end
LOCATE ThisWO : '*' : CustNo IN CompositeKeys USING @VM SETTING FPos ELSE
UniqueWOs<1,-1> = ThisWO
CustNos<1,-1> = CustNo
CompositeKeys<1,-1> = ThisWO : '*' : CustNo
END
NEXT I
END ELSE
AllWOs = XLATE( 'RDS', RdsIds, rds_wo$, 'X' )
FOR I = 1 TO IdCnt
ThisWO = AllWOs<I>
CassNo = XLATE('RDS',RdsIds<I>,'CASS_NO','X')
WOMatRec = XLATE('WO_MAT',ThisWO:'*':CassNo,'','X')
ReShipCustNo = WOMatRec<WO_MAT_RESHIP_CUST_NO$>
If ReShipCustNo EQ '' then
CustNo = XLATE( 'WO_LOG', ThisWO, wo_log_cust_no$, 'X' )
end else
CustNo = ReShipCustNo
end
LOCATE ThisWO : '*' : CustNo IN CompositeKeys USING @VM SETTING Fpos ELSE
UniqueWOs<1,-1> = ThisWO
CustNos<1,-1> = CustNo
CompositeKeys<1,-1> = ThisWO : '*' : CustNo
END
NEXT I
END
GOSUB PrintWOLabels ;* Activated WO label printing again -dkk 12/3/14
WONo = XLATE('RDS',RdsIds<1>,RDS_WO$,'X')
CustNo = XLATE('WO_LOG',WONo,WO_LOG_CUST_NO$,'X')
Void = UTILITY( 'CURSOR', 'A' )
END
end
GOSUB PrintWOLabels ;* Activated WO label printing again -dkk 12/3/14
GoSub EndPrint
WONo = XLATE('RDS',RdsIds<1>,RDS_WO$,'X')
CustNo = XLATE('WO_LOG',WONo,WO_LOG_CUST_NO$,'X')
Void = UTILITY( 'CURSOR', 'A' )
END
* * * * * *
OIPrint_Error:
* * * * * *
end
RETURN
* * * * * *
EndPrint:
* * * * * *
If Environment_Services('GetLabelPrintMethod') _EQC 'OIPI' then
stat = Set_Printer("TERM")
end else
stat = Direct_Print('STOP')
end
end
RETURN
return
* * * * * * * * * * * * Local Subroutines * * * * * * * * * * * *
@ -246,9 +257,7 @@ PrintCleanRoomLabels:
PSNIds = XLATE( 'RDS', RdsIds, rds_prod_spec_id$, 'X' )
SpecType = OCONV( XLATE( 'RDS', RdsIds, 'SPEC_TYPE', 'X' ), '[SPEC_TYPE_CONV]' )
SubPartNum = XLATE( 'RDS', RdsIds, 'SUB_PART_NUM', 'X' )
RecipeInfo = XLATE( 'RECIPE', RecipeIDS, 'RECIPE_NAME_NO', 'X' )
ThickVar = XLATE( 'PROD_SPEC', PSNIds, 'THICK_MEASURE_L1', 'X' )
ResVar = XLATE( 'PROD_SPEC', PSNIds, 'RES_MEASURE_L1', 'X' )
ConVar = XLATE( 'PROD_SPEC', PSNIds, 'CON_MEASURE_L1', 'X' )
@ -618,16 +627,16 @@ PrintCleanRoomLabels:
END
swap '~' with fmt( ' ', 'L#2' ) in PrintThickPrintVar
swap 'æm' with 'um' in PrintThickTargets
swap 'ê-cm' with 'ohm.cm' in PrintThickTargets
swap 'ê/Ü' with 'ohm/sq' in PrintThickTargets
swap '' with 'A' in PrintThickTargets
swap UNIT_MICROMETER$ with 'um' in PrintThickTargets
swap UNIT_OHM_CM$ with 'ohm.cm' in PrintThickTargets
swap UNIT_OHM_PER_SQ$ with 'ohm/sq' in PrintThickTargets
swap UNIT_A$ with 'A' in PrintThickTargets
swap '~' with fmt( ' ', 'L#2' ) in PrintResPrintVar
swap 'æm' with 'um' in PrintResTargets
swap 'ê-cm' with 'ohm.cm' in PrintResTargets
swap 'ê/Ü' with 'ohm/sq' in PrintResTargets
swap '' with 'A' in PrintResTargets
swap UNIT_MICROMETER$ with 'um' in PrintResTargets
swap UNIT_OHM_CM$ with 'ohm.cm' in PrintResTargets
swap UNIT_OHM_PER_SQ$ with 'ohm/sq' in PrintResTargets
swap UNIT_A$ with 'A' in PrintResTargets
//only print cheat sheet label on cassette #1
IF CassNo EQ 1 then
@ -644,6 +653,7 @@ RETURN
* * * * * * *
PrintLabel:
* * * * * * *
* Standard RDS Label print method
IF PrintSpecType EQ 'Production' THEN PrintSpecType = 'Prod'
IF PrintSpecType EQ 'Pre-Production' THEN PrintSpecType = 'Pre'
@ -659,71 +669,71 @@ PrintLabel:
PrintQARecipe = FIELD(PrintRecipe, @VM, 1)
PrintCompany = PrintCompany[1,32]
//looping instead of using ^PQ2 since I have to set sequential key in 2D barcode
// Looping instead of using ^PQ2 since I have to set sequential key in 2D barcode
Str = ''
For cnt = 1 to 2
Str := '^XA'
Str := '^LH0,0'
Str := '^PR1' ;* Print speed 2 inches per second
Str := '^LL406' ;* Label length @203 dpi
Str := '^PW900'
Str := '^MD0' ;* Media darkness
Str := '^MMT' ;* Media mode t=tear off mode
*Str := '^PQ2' ;* Print 2 labels for each pass through here
For cnt = 1 to 2
Str := '^XA'
Str := '^LH0,0'
Str := '^PR1' ;* Print speed 2 inches per second
Str := '^LL406' ;* Label length @203 dpi
Str := '^PW900'
Str := '^MD5' ;* Media darkness
Str := '^MMT' ;* Media mode t=tear off mode
*Str := '^PQ2' ;* Print 2 labels for each pass through here
****** First Line, Cust, WO and RO
Str := '^FO25,25^AC,18^FDCust: ^FS':CRLF$
Str := '^FO95,14^A045,35^FD':PrintCompany:'^FS':CRLF$
Str := '^FO570,25^AC18^FDWO: ^FS':CRLF$
Str := '^FO610,14^A045,35^FD':PrintWO:'^FS':CRLF$
Str := '^FO730,25^AC18^FDRO: ^FS':CRLF$
Str := '^FO770,14^A045,35^FD':PrintRONum:'^FS':CRLF$
****** Second Line, Cust Spec, PSN and Type
Str := '^FO25,75^AC18^FD(P)Cust Spec: ^FS':CRLF$
Str := '^FO185,65^A045,35^FD':CustEpiPartSpecNo:'^FS':CRLF$
Str := '^FO25,95^BY2,2.0^B3,,50,N^FDP':CustEpiPartSpecNo:'^FS':CRLF$
Str := '^FO640,75^AC18^FDPSN:^FS':CRLF$
Str := '^FO690,65^A045,35^FD':PrintPSN:'^FS':CRLF$
Str := '^FO630,125^AC18^FDType:^FS':CRLF$
Str := '^FO690,115^A045,30^FD':PrintSpecType:'^FS':CRLF$
****** Third Line, Sub Lot, Qty and RDS
Str := '^FO25,175^AC18^FD(2T)Sub Lot:^FS':CRLF$
Str := '^FO175,165^A045,35^FD':PrintLotNum:'^FS':CRLF$
Str := '^FO25,195^BY1,3.0^B3,,50,N^FD2T':PrintLotNum:'^FS':CRLF$
Str := '^FO400,175^AC18^FD(Q)Qty:^FS':CRLF$
Str := '^FO500,165^A045,35^FD':PrintQty:'^FS':CRLF$
Str := '^FO400,195^B3,,50,N^FDQ':PrintQty:'^FS':CRLF$
Str := '^FO590,175^AC18^FD(1T)RDS: ^FS':CRLF$
Str := '^FO690,165^A045,35^FD':PrintRDSId:'^FS':CRLF$
Str := '^FO630,195^B3,,50,N^FD1T':PrintRDSId:'^FS':CRLF$
****** Fourth Line, SubPN, Vendor and QA Metrology recipe
Str := '^FO25,275^AC18^FD(S)Sub PN:^FS':CRLF$
Str := '^FO145,265^A045,35^FD':PrintSubPartNum:'^FS':CRLF$
Str := '^FO25,295^B3,,50,N^FDS':PrintSubPartNum:'^FS':CRLF$
Str := '^FO400,275^AC18^FD(1V)Vend:^FS':CRLF$
Str := '^FO510,265^A045,35^FD':PrintSuppCd:'^FS':CRLF$
Str := '^FO400,295^B3,,50,N^FD1V':PrintSuppCd:'^FS':CRLF$
Str := '^FO590,275^AC18^FD':PrintQARecipe:'^FS':CRLF$
****** Fifth Line, Motto and Data Matrix barcode
Str := '^FO25,370^A045,28':CRLF$
Str := "^FDWe do what we promise. That's quality made by Infineon.^FS":CRLF$
Str := '^FO725,320^CI28':CRLF$
Str := '^BXN,2,200^FDP':CustEpiPartSpecNo:'|S':PrintSubPartNum:'|1T':PrintRDSId:'|2T':PrintLotNum:'|':PrintPSN:'|Q':PrintQty:'|1V':PrintSuppCd:'|SEQ':cnt:'^FS':CRLF$
****** End the print job (ZPL script)
Str:= '^XZ'
Next
****** First Line, Cust, WO and RO
Str := '^FO25,25^AC,18^FDCust: ^FS':CRLF$
Str := '^FO95,14^A045,35^FD':PrintCompany:'^FS':CRLF$
Str := '^FO570,25^AC18^FDWO: ^FS':CRLF$
Str := '^FO610,14^A045,35^FD':PrintWO:'^FS':CRLF$
Str := '^FO730,25^AC18^FDRO: ^FS':CRLF$
Str := '^FO770,14^A045,35^FD':PrintRONum:'^FS':CRLF$
****** Second Line, Cust Spec, PSN and Type
Str := '^FO25,75^AC18^FD(P)Cust Spec: ^FS':CRLF$
Str := '^FO185,65^A045,35^FD':CustEpiPartSpecNo:'^FS':CRLF$
Str := '^FO25,95^BY2,2.0^B3,,50,N^FDP':CustEpiPartSpecNo:'^FS':CRLF$
Str := '^FO640,75^AC18^FDPSN:^FS':CRLF$
Str := '^FO690,65^A045,35^FD':PrintPSN:'^FS':CRLF$
Str := '^FO630,125^AC18^FDType:^FS':CRLF$
Str := '^FO690,115^A045,30^FD':PrintSpecType:'^FS':CRLF$
****** Third Line, Sub Lot, Qty and RDS
Str := '^FO25,175^AC18^FD(2T)Sub Lot:^FS':CRLF$
Str := '^FO175,165^A045,35^FD':PrintLotNum:'^FS':CRLF$
Str := '^FO25,195^BY1,3.0^B3,,50,N^FD2T':PrintLotNum:'^FS':CRLF$
Str := '^FO400,175^AC18^FD(Q)Qty:^FS':CRLF$
Str := '^FO500,165^A045,35^FD':PrintQty:'^FS':CRLF$
Str := '^FO400,195^B3,,50,N^FDQ':PrintQty:'^FS':CRLF$
Str := '^FO590,175^AC18^FD(1T)RDS: ^FS':CRLF$
Str := '^FO690,165^A045,35^FD':PrintRDSId:'^FS':CRLF$
Str := '^FO630,195^B3,,50,N^FD1T':PrintRDSId:'^FS':CRLF$
****** Fourth Line, SubPN, Vendor and QA Metrology recipe
Str := '^FO25,275^AC18^FD(S)Sub PN:^FS':CRLF$
Str := '^FO145,265^A045,35^FD':PrintSubPartNum:'^FS':CRLF$
Str := '^FO25,295^B3,,50,N^FDS':PrintSubPartNum:'^FS':CRLF$
Str := '^FO400,275^AC18^FD(1V)Vend:^FS':CRLF$
Str := '^FO510,265^A045,35^FD':PrintSuppCd:'^FS':CRLF$
Str := '^FO400,295^B3,,50,N^FD1V':PrintSuppCd:'^FS':CRLF$
Str := '^FO590,275^AC18^FD':PrintQARecipe:'^FS':CRLF$
****** Fifth Line, Motto and Data Matrix barcode
Str := '^FO25,370^A045,28':CRLF$
Str := "^FDWe do what we promise. That's quality made by Infineon.^FS":CRLF$
Str := '^FO725,320^CI28':CRLF$
Str := '^BXN,2,200^FDP':CustEpiPartSpecNo:'|S':PrintSubPartNum:'|1T':PrintRDSId:'|2T':PrintLotNum:'|':PrintPSN:'|Q':PrintQty:'|1V':PrintSuppCd:'|SEQ':cnt:'^FS':CRLF$
****** End the print job (ZPL script)
Str:= '^XZ'
Next
If Environment_Services('GetLabelPrintMethod') _EQC 'OIPI' then
stat = Set_Printer('TEXT',Str)
end else
stat = Direct_Print('PRINT', Str)
end
If Environment_Services('GetLabelPrintMethod') _EQC 'OIPI' then
stat = Set_Printer('TEXT',Str)
end else
stat = Direct_Print('PRINT', Str)
end
RETURN
@ -783,7 +793,6 @@ PrintWOLabel:
END ELSE
Str:= '^FO70,30^A0220,210^FD':PrintUniqueWO:'^FS':CRLF$
END
CustName = XLATE( 'COMPANY', CustNo, 'ABBREV_OR_CO_NAME', 'X' )
@ -801,6 +810,7 @@ PrintWOLabel:
end else
stat = Direct_Print('PRINT', Str)
end
RETURN
@ -826,10 +836,10 @@ PrintCheatSheetLabel:
WaferSize = XLATE('EPI_PART', CustPart, EPI_PART_SUB_WAFER_SIZE$, 'X')
*Field(SpecSub, @VM, QSSubWafersize$)
convert char(248) to @fm in SpecEpi ;* char(248) is used to separate layers
layerCount = fieldcount( SpecEpi, @fm )
layerInfo = SpecEpi<layerCount>
//if this is just 1 layer, we're returning that info, if 3 layers, we're returning layer 3 (combo)
convert char(248) to @fm in SpecEpi ;* char(248) is used to separate layers
layerCount = fieldcount( SpecEpi, @fm )
layerInfo = SpecEpi<layerCount>
//if this is just 1 layer, we're returning that info, if 3 layers, we're returning layer 3 (combo)
ThkData = Field(layerInfo, @VM, QSEpiThickMeasure$)
ResData = Field(layerInfo, @VM, QSEpiResMeasure$)