hexagon logo

Program set ups

So do you all have a standard program setup that you do for most of your parts. If so what do you include in your code?

STARTUP =ALIGNMENT/START,RECALL:USE_PART_SETUP,LIST=YES
ALIGNMENT/END
MODE/MANUAL
FORMAT/TEXT,OPTIONS, ,HEADINGS,SYMBOLS, ;NOM,TOL,MEAS,DEV,OUTTOL, ,
LOADPROBE/3X50
TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=0
MOVESPEED/ 100
SCANSPEED/40
PREHIT/0.05
RETRACT/0.05
TEMPCOMP/METHOD = AUTOMATIC,MATERIAL = Aluminium,CTE=23
,SET WARNING LIMIT = TRUE,MINIMUM = 18,MAXIMUM = 22
,PART SENSOR NUM=DEFAULT,X SCALE= 20,Y SCALE= 20,Z SCALE= 20,PART TEMP=20
COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,OVC=NO,
RUN SLOW TILL PROOFED
ADD SET UP PICTURE​
  • Our template program has evolved through many major changes over the last 17 years. This is the what we have been using for the last year or so and it change again in the next year or so.

    STARTUP =ALIGNMENT/START,RECALL:USE_PART_SETUP,LIST=YES
    ALIGNMENT/END
    $$ NO,
    =================================================
    REVISION HISTORY
    =================================================
    WORKPLANE/ZPLUS
    $$ NO,
    =================================================
    Rev:
    Date:
    WF#:
    Programmer:
    Description/Notes:
    =================================================
    $$ NO,
    =================================================
    CMM FIND INFO COMMANDS
    =================================================
    INFO =FILE/OPEN,C:\USERS\PUBLIC\DOCUMENTS\HEXAGON\PC-DMIS\2016.0\CMM_INFO.TXT,READ
    FOUND_CMMNUMBER=FILE/READLINE,INFO,{TEXT1}
    FOUND_SPEED=FILE/READLINE,INFO,{TEXT2}
    ASSIGN/CMMNUMBER=TEXT1
    ASSIGN/SPEED=TEXT2
    MOVESPEED/ 400
    FILE/CLOSE,INFO,KEEP
    IF/TEXT1>52000
    END_IF/
    IF/TEXT1<52000
    GOTO/SKIP_FLY
    END_IF/
    FLY/OFF
    $$ NO,
    =================================================
    MOTION CONTROL COMMANDS
    =================================================
    SKIP_FLY =LABEL/
    MODE/MANUAL
    WORKPLANE/ZPLUS
    PREHIT/0.15
    RETRACT/0.15
    TOUCHSPEED/ 2
    FASTPROBEMODE/ON
    FLY/ON
    SCANSPEED/6
    OPTIONPROBE/MAXFORCE=0.096,LOWFORCE=0.019,UPPERFORCE=0.072,TRI GGERFORCE=0.033,
    PROBEACCURACY=0.1,POSACCURACY=0.1,#RETURNDATA=7,
    RETURNSPEED=0.4,SCANPNTDENSITY=4,
    SCANACCELERATION=10,SCANOFFSETFORCE=0.06,
    PROBINGMODE=DFL,MANFINEPROBING=NO
    $$ NO,
    =================================================
    TEMP CONTROL COMMANDS
    =================================================
    $$ NO,
    =================================================
    OPERATOR INPUT AND DATAPAGE COMMANDS
    =================================================
    STATS/ON,DATAPAGE+,,OFFLINE=YES
    RECORD=DIMENSION,TRACE,FCF PROFILE,
    C1 =COMMENT/INPUT,NO,FULL SCREEN=NO,
    
    Enter Work Order Number
    Use period instead of slash
    
    COMMENT/REPT,
    
    TRACEFIELD/DISPLAY=NO,REPORT=NO,DISPLAY MESSAGE=Work Order Number ; Work Order Number : C1.INPUT
    COMMENT/REPT,
    "Work order number: " + C1.INPUT
    C2 =COMMENT/INPUT,NO,FULL SCREEN=NO,
    
    Enter Part Number
    
    TRACEFIELD/DISPLAY=NO,REPORT=NO,DISPLAY MESSAGE=Part Number ; Part Number : C2.INPUT
    C3 =COMMENT/INPUT,NO,FULL SCREEN=NO,
    
    Enter Clock Number
    
    TRACEFIELD/DISPLAY=NO,REPORT=NO,DISPLAY MESSAGE=Clock Number ; Clock Number : C3.INPUT
    COMMENT/REPT,
    "Employee Clock Number: " + C3.INPUT
    C4 =COMMENT/INPUT,NO,FULL SCREEN=NO,
    
    Enter Sample Number
    
    TRACEFIELD/DISPLAY=NO,REPORT=NO,DISPLAY MESSAGE=Sample Number ; Sample Number : C4.INPUT
    COMMENT/REPT,
    "Sample Number: " + C4.INPUT
    C5 =COMMENT/INPUT,NO,FULL SCREEN=NO,
    
    Enter Machine Number
    
    TRACEFIELD/DISPLAY=NO,REPORT=NO,DISPLAY MESSAGE=Machine ID ; Machine ID : C5.INPUT
    COMMENT/REPT,
    "Machine Number: " + C5.INPUT
    $$ NO,
    following TRACEFIELDs for future use ... input via read external file
    
    TRACEFIELD/DISPLAY=NO,REPORT=NO,DISPLAY MESSAGE=CMM Program ; CMM Program : STR(GETTEXT(191,1,{FILEHEDR}))
    TRACEFIELD/DISPLAY=NO,REPORT=NO,DISPLAY MESSAGE=CMM Machine ID ; CMM Machine ID : CMMNUMBER
    $$ NO,
    =================================================
    PART SETUP AND MANUAL ALIGNMENT INSTRUCTIONS
    =================================================
    COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
    
    
    
    Setup instructions are defined here
    
    
    
    COMMENT/OPER,NO,FULL SCREEN=YES,AUTO-CONTINUE=NO,
    
    Please review the following information before continuing.
    
    Click OK after review to continue. Click CANCEL if information looks incorrect.
    
    Operator Inputs:
    
    "Work Order Number: " + C1.INPUT
    "Part Number: " + C2.INPUT
    "Employee Last Name: " + C3.INPUT
    "Sample Number: " + C4.INPUT
    "MFG Machine Number: " + C5.INPUT
    
    
    Fixture: <FIXTURE # or description of components>
    
    
    Probe: Tip1 1X30
    Tip2 1X15 shank
    Tip3 4X50
    Tip4 1X50
    Tip5 2X30
    Tip6 4X20
    Tip7 8X32 disk
    Tip9 6X30 disk
    Tip10 .5X20
    
    COMMENT1 =COMMENT/YESNO,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
    
    Do you want to see the set up picture?
    
    IF/COMMENT1.INPUT == "NO"
    GOTO/SKIP_PIC
    END_IF/
    $$ NO,
    Setup picture goes here as an imbedded external document
    SKIP_PIC =LABEL/


    This goes at the end of the program for stats update and pdf creation
    $$ NO,
    =================================================
    STATS UPDATE OPTIONS
    =================================================
    STATS/UPDATE
    $$ NO,
    =================================================
    PDF UPDATE OPTIONS
    =================================================
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,OVERWRITE=PRINTPATH,AUTO OPEN=OFF,$
    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=DELETE_INSTANCES
    ​​
  • TRACEFIELD/DISPLAY=YES,REPORT=NO,DISPLAY MESSAGE=Inspection Lot ; Inspection Lot :
    $$ NO,
                
                
    $$ NO,
                
                
    $$ NO,
                
                ********************************************
                
                
    MENU       =LABEL/
    $$ NO,
                
                ********************************************
                
                
    C1         =COMMENT/INPUT,NO,FULL SCREEN=NO,
                0) Calibrate Probe
                1) Run Part
                2) Fixture Setup
                3) Picture
                4) Manual Alignment
                
                5) QUIT
                
                
                IF_GOTO/C1.INPUT == 0,GOTO = CALIBRATE_PROBE
                IF_GOTO/C1.INPUT == 1,GOTO = RUN_PART
                IF_GOTO/C1.INPUT == 2,GOTO = FIXTURE_SETUP
                IF_GOTO/C1.INPUT == 3,GOTO = PICTURE
                IF_GOTO/C1.INPUT == 4,GOTO = MANUAL_ALIGNMENT
                IF_GOTO/C1.INPUT == 5,GOTO = PROGRAM_END
                COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
                INCORRECT INPUT!
                GOTO/MENU
    $$ NO,
                \
                \\
                \\\
    CALIBRATE_PROBE=LABEL/
                AUTOCALIBRATE/PROBE, PARAMETER_SET=ALL-TIPS-WITH-DEFAULTS, QUALTOOL_MOVED=NO,
                              CHECK COLLISION=NO, SHOW_SUMMARY=NO, OVERWRITE_RESULTSFILE=NO
                GOTO/MENU
    $$ NO,
                \
                \\
                \\\
    FIXTURE_SETUP=LABEL/
                COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
                1" dia  x 3/4" tall standoff
                X20 Y41
                X25 Y45
                X44 Y45
                
                25 X 25 Fixture Plate
                GOTO/MENU
    $$ NO,
                \
                \\
                \\\
    PICTURE    =LABEL/
    $$ NO,
                Form with at least a picture of the fixture setup and a picture of the part within the setup.
                GOTO/MENU
    $$ NO,
                \
                \\
                \\\
    MANUAL_ALIGNMENT=LABEL/ 
                MODE/MANUAL
    GOTO/MENU
    $$ NO,
                \
                \\
                \\\
    RUN_PART   =LABEL/
                MODE/DCC
    $$ NO,
                
    $$ NO,
                BODY OF PROGRAM
    $$ NO,
                \
                \\
                \\\
    $$ NO,
                //              PRINTING
                /
                Print and File or Just File as PDF
                COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
                Review Results  before deciding to print or not
    RESTART1   =LABEL/
                ASSIGN/OT=GETPROGRAMINFO("numoot")
    PRINT_CUE  =COMMENT/INPUT,NO,FULL SCREEN=NO,
                "Out of Tolerance Conditions = "+OT
                
                
                1  To Printer  AND  File  (OOT Condtions)
                2  To File only  (In Tolerance Part)
                
                IF/PRINT_CUE.INPUT<>1 AND PRINT_CUE.INPUT<>2
                  COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
                  INPUT INVALID
                  GOTO/RESTART1
                END_IF/
                IF_GOTO/PRINT_CUE.INPUT==1,GOTO = PRINT_AND_FILE
                IF_GOTO/PRINT_CUE.INPUT==2,GOTO = FILEONLY
    PRINT_AND_FILE=LABEL/
                PRINT/REPORT,EXEC MODE=END,$
                  TO_FILE=ON,AUTO=1,AUTO OPEN=OFF,$
                  TO_PRINTER=ON,COPIES=1,$
                  TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
                  REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
                  TO_EXCEL=OFF,$
                  PREVIOUS_RUNS=DELETE_INSTANCES
                GOTO/PRINT_END
    FILEONLY   =LABEL/
                PRINT/REPORT,EXEC MODE=END,$
                  TO_FILE=ON,AUTO=1,AUTO OPEN=OFF,$
                  TO_PRINTER=OFF,COPIES=1,$
                  TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
                  REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
                  TO_EXCEL=OFF,$
                  PREVIOUS_RUNS=DELETE_INSTANCES
                GOTO/PRINT_END
    PRINT_END  =LABEL/
                GOTO/MENU
    PROGRAM_END=LABEL/​
  • The backend of that starting with "PRINTING" looks like something I posted about 12-13 years ago. It was put together from bits and pieces other programmers gave me.
  • I probably stole it from you. I don't have many flashes of brilliance but I'm an excellent code thief.
  • I hope to start getting some revision control into my programs soon. I do something close when I have a job that requires serial or lot control.
  • Why the auto calibrate at the end of the program?
  • ??? Don't see that except in the middle of the code. ???

    This code is the bare bones of a menu system with options for Probe Calibration, Running a part, Grid plate setup description, Setup Phots, manual alignment and an option to quit. It also returns you to the menu once the routine has finished.
  • Ok then why cal in the middle of the program? I had a customer who sent me their program to use to do the same thing. Why?
  • Need to study flow control. What is happening is a menu appears with various numbered selections. One of the selections is calibration. If you enter a zero at the menu, then the program skips over everything until it reaches the label named Calibrate_probe. It then runs the calibration code until it gets to the GOTO/ Menu statement. The GOTO/ Menu statement then return the program to the Menu label. The menu appears and then the operator can make another choice.
  • Maybe I am not asking in a good way. I understand the program. I understand what you are coding.

    Let me ask this a different way. Why would anyone want or need to calibrate during a program or at the end of it. Why even have that as a choice?

    I guess I can see having it there if you run that part many times over and over.