hexagon logo

Reprint Reports with New Filename

We are going to reduce my inspection plan in a cell from checking every part to checking every 5 parts. Reports are saved automatically to our network as the unique serial number. The CMM prompts the operator to scan the serial number with a barcode scanner and then the inspection begins. Our production software needs to verify that each serial number has a CMM report on our network or it wont let operators log out the parts.

So I did this but I think its kind of long. I basically just re dimensinoed the same circle (loc1-loc5), updated the assignments, and refreshed the label header so the reports looks nice. Everything works, it prints 5 reports, each with its own serial number as the filename and looks fine, its just looks like too much code. Does anyone have any advice to achieve this but with less code?

LOADPROBE/3X95_PROBE
TIP/TIP1, SHANKIJK=0, 0, 1, ANGLE=0
WORKPLANE/ZPLUS
SERIAL_NUMBER1 =COMMENT/INPUT,NO,FULL SCREEN=NO,

SCAN PART SERIAL NUMBER1

ASSIGN/SN1=SERIAL_NUMBER1.INPUT
SERIAL_NUMBER2 =COMMENT/INPUT,NO,FULL SCREEN=NO,

SCAN PART SERIAL NUMBER2

ASSIGN/SN2=SERIAL_NUMBER2.INPUT
SERIAL_NUMBER3 =COMMENT/INPUT,NO,FULL SCREEN=NO,

SCAN PART SERIAL NUMBER3

ASSIGN/SN3=SERIAL_NUMBER3.INPUT
SERIAL_NUMBER4 =COMMENT/INPUT,NO,FULL SCREEN=NO,

SCAN PART SERIAL NUMBER4

ASSIGN/SN4=SERIAL_NUMBER4.INPUT
SERIAL_NUMBER5 =COMMENT/INPUT,NO,FULL SCREEN=NO,

SCAN PART SERIAL NUMBER5

ASSIGN/SN5=SERIAL_NUMBER5.INPUT

************************HERES MY CIRCLE********************************

CIR1 =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
THEO/<0,0,0>,<0,0,-1>,2
ACTL/<0,0,0>,<0,0,-1>,2
TARG/<0,0,0>,<0,0,-1>
START ANG=0,END ANG=360
ANGLE VEC=<0,1,0>
DIRECTION=CCW
SHOW FEATURE PARAMETERS=NO
SHOW CONTACT PARAMETERS=YES
NUMHITS=3,DEPTH=0,PITCH=0
SAMPLE METHOD=SAMPLE_HITS
SAMPLE HITS=0,SPACER=0
AVOIDANCE MOVE=NO,DISTANCE=0.3937
FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
SHOW HITS=NO

****************PROGRAM ENDS - START DIMENSION AND PRINTING******************
COMMENT/REPT,

"Serial Number is "+SN1

DIM LOC1= LOCATION OF CIRCLE CIR1 UNITS=IN ,$
GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
AX NOMINAL +TOL -TOL MEAS DEV OUTTOL
X 0.0000 0.0020 0.0020 0.0000 0.0000 0.0000 ---#----
Y 0.0000 0.0020 0.0020 0.0000 0.0000 0.0000 ---#----
D 2.0000 0.0020 0.0020 2.0000 0.0000 0.0000 ---#----
END OF DIMENSION LOC1

ASSIGN/REPORT_LOC="\\\******************\\"
ASSIGN/REPORT_NAME=REPORT_LOC+SN1
PRINT/REPORT,EXEC MODE=END,$
TO_FILE=ON,OVERWRITE=REPORT_NAME,AUTO OPEN=ON,$
TO_PRINTER=OFF,COPIES=1,$
TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMEN SIONS=NO,$
TO_EXCEL=OFF,$
PREVIOUS_RUNS=KEEP_INSTANCES
REPORT/LABEL, FILENAME= FILE_HEADER.LBL
COMMENT/REPT,

"Serial Number is "+SN2

DIM LOC2= LOCATION OF CIRCLE CIR1 UNITS=IN ,$
GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
AX NOMINAL +TOL -TOL MEAS DEV OUTTOL
X 0.0000 0.0020 0.0020 0.0000 0.0000 0.0000 ---#----
Y 0.0000 0.0020 0.0020 0.0000 0.0000 0.0000 ---#----
D 2.0000 0.0020 0.0020 2.0000 0.0000 0.0000 ---#----
END OF DIMENSION LOC2

ASSIGN/REPORT_LOC="\\\******************\\"
ASSIGN/REPORT_NAME=REPORT_LOC+SN2
PRINT/REPORT,EXEC MODE=END,$
TO_FILE=ON,OVERWRITE=REPORT_NAME,AUTO OPEN=ON,$
TO_PRINTER=OFF,COPIES=1,$
TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMEN SIONS=NO,$
TO_EXCEL=OFF,$
PREVIOUS_RUNS=KEEP_INSTANCES
REPORT/LABEL, FILENAME= FILE_HEADER.LBL
COMMENT/REPT,

"Serial Number is "+SN3

DIM LOC3= LOCATION OF CIRCLE CIR1 UNITS=IN ,$
GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
AX NOMINAL +TOL -TOL MEAS DEV OUTTOL
X 0.0000 0.0020 0.0020 0.0000 0.0000 0.0000 ---#----
Y 0.0000 0.0020 0.0020 0.0000 0.0000 0.0000 ---#----
D 2.0000 0.0020 0.0020 2.0000 0.0000 0.0000 ---#----
END OF DIMENSION LOC3

ASSIGN/REPORT_LOC="\\\******************\\"
ASSIGN/REPORT_NAME=REPORT_LOC+SN3
PRINT/REPORT,EXEC MODE=END,$
TO_FILE=ON,OVERWRITE=REPORT_NAME,AUTO OPEN=ON,$
TO_PRINTER=OFF,COPIES=1,$
TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMEN SIONS=NO,$
TO_EXCEL=OFF,$
PREVIOUS_RUNS=KEEP_INSTANCES
REPORT/LABEL, FILENAME= FILE_HEADER.LBL
COMMENT/REPT,

"Serial Number is "+SN4

DIM LOC4= LOCATION OF CIRCLE CIR1 UNITS=IN ,$
GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
AX NOMINAL +TOL -TOL MEAS DEV OUTTOL
X 0.0000 0.0020 0.0020 0.0000 0.0000 0.0000 ---#----
Y 0.0000 0.0020 0.0020 0.0000 0.0000 0.0000 ---#----
D 2.0000 0.0020 0.0020 2.0000 0.0000 0.0000 ---#----
END OF DIMENSION LOC4

ASSIGN/REPORT_LOC="\\\******************\"
ASSIGN/REPORT_NAME=REPORT_LOC+SN4
PRINT/REPORT,EXEC MODE=END,$
TO_FILE=ON,OVERWRITE=REPORT_NAME,AUTO OPEN=ON,$
TO_PRINTER=OFF,COPIES=1,$
TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMEN SIONS=NO,$
TO_EXCEL=OFF,$
PREVIOUS_RUNS=KEEP_INSTANCES
REPORT/LABEL, FILENAME= FILE_HEADER.LBL
COMMENT/REPT,

"Serial Number is "+SN5

DIM LOC5= LOCATION OF CIRCLE CIR1 UNITS=IN ,$
GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
AX NOMINAL +TOL -TOL MEAS DEV OUTTOL
X 0.0000 0.0020 0.0020 0.0000 0.0000 0.0000 ---#----
Y 0.0000 0.0020 0.0020 0.0000 0.0000 0.0000 ---#----
D 2.0000 0.0020 0.0020 2.0000 0.0000 0.0000 ---#----
END OF DIMENSION LOC5

ASSIGN/REPORT_LOC="\\\******************\\"
ASSIGN/REPORT_NAME=REPORT_LOC+SN5
PRINT/REPORT,EXEC MODE=END,$
TO_FILE=ON,OVERWRITE=REPORT_NAME,AUTO OPEN=ON,$
TO_PRINTER=OFF,COPIES=1,$
TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMEN SIONS=NO,$
TO_EXCEL=OFF,$
PREVIOUS_RUNS=KEEP_INSTANCES