Multiple parts on a fixture plate__"Macro" program

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Multiple parts on a fixture plate__"Macro" program

    With much help, I was finally able to piece together something I have been working on for a while. Would like to share with the forum:

    Code:
    STARTUP    =ALIGNMENT/START,RECALL:USE_PART_SETUP,LIST=YES
                ALIGNMENT/END
                RECALL/ALIGNMENT,EXTERNAL,FIXT_ALN_FAKE
                LOADPROBE/7107_Y_1BY20
                TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=0
    GROUP_COUNTPROMPT_AND_SERIALNUMBER=GROUP/SHOWALLPARAMS=YES
    COUNT_PROMPT   =COMMENT/INPUT,NO,FULL SCREEN=NO,
                  How many parts are you inspecting?
                  ASSIGN/TOTAL_PARTS=COUNT_PROMPT.INPUT
                  ASSIGN/SER=0
                  DO/
                    ASSIGN/SER=SER+1
    SER_PROMPT     =COMMENT/INPUT,NO,FULL SCREEN=NO,
                    Please enter the Serial Number of the
                    "part at FIXTURE POSITION# "+SER+"."
    RUN_PROMPT     =COMMENT/INPUT,NO,FULL SCREEN=NO,
                    Please enter the Run Number of the
                    "part at FIXTURE POSITION# "+SER+"."
                    ASSIGN/SER_NUM[SER]=SER_PROMPT.INPUT
                    ASSIGN/RUN_NUM[SER]=RUN_PROMPT.INPUT
                  UNTIL/SER==TOTAL_PARTS
                ENDGROUP/ID=GROUP_COUNTPROMPT_AND_SERIALNUMBER
                RECALL/ALIGNMENT,EXTERNAL,FIXT_ALN_FAKE
                ASSIGN/CURR_POS=0
                DO/
                  ASSIGN/CURR_POS=CURR_POS+1
                  COMMENT/REPT,
                  "Serial Number: "+SER_NUM[CURR_POS]
                  COMMENT/REPT,
                  "Run Number: "+RUN_NUM[CURR_POS]
                  ASSIGN/PROG_NAME=GETPROGRAMINFO ("PARTNAME")
                  ASSIGN/REPORT_NAME="X:\\XXXXXX\\XXXXXXX\\XXXXXX\\PALLET_MACRO_MASTER\\"+PROG_NAME+"__"+SER_NUM[CURR_POS]+"-.PDF"
                  IF/CURR_POS==1
                    ASSIGN/FIXT_X=0
                    ASSIGN/FIXT_Y=0
                    ASSIGN/FIXT_Z=0
                  END_IF/
                  IF/CURR_POS==2
                    ASSIGN/FIXT_X=6
                    ASSIGN/FIXT_Y=0
                    ASSIGN/FIXT_Z=0
                  END_IF/
                  IF/CURR_POS==3
                    ASSIGN/FIXT_X=12
                    ASSIGN/FIXT_Y=0
                    ASSIGN/FIXT_Z=0
                  END_IF/
                  IF/CURR_POS==4
                    ASSIGN/FIXT_X=0
                    ASSIGN/FIXT_Y=6
                    ASSIGN/FIXT_Z=0
                  END_IF/
                  IF/CURR_POS==5
                    ASSIGN/FIXT_X=6
                    ASSIGN/FIXT_Y=6
                    ASSIGN/FIXT_Z=0
                  END_IF/
                  IF/CURR_POS==6
                    ASSIGN/FIXT_X=12
                    ASSIGN/FIXT_Y=6
                    ASSIGN/FIXT_Z=0
                  END_IF/
                  RECALL/ALIGNMENT,EXTERNAL,FIXT_ALN_FAKE
    PO_PNT       =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                  NOM/XYZ,<0+0,0+0,0+0>,$
                  MEAS/XYZ,<FIXT_X,FIXT_Y,FIXT_Z>,$
                  NOM/IJK,<0+0,0+0,0+0>,$
                  MEAS/IJK,<0+0,0+0,0+0>
    A1_INIT_ALN  =ALIGNMENT/START,RECALL:FIXT_ALN_FAKE,LIST=YES
                    ALIGNMENT/TRANS,XAXIS,PO_PNT
                    ALIGNMENT/TRANS,YAXIS,PO_PNT
                    ALIGNMENT/TRANS,ZAXIS,PO_PNT
                  ALIGNMENT/END
      $$ NO,
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
                  Actual program goes here
    
                  Ensure all "F5" settings are correct and prg
                  has +0-s all throughout
                  (in F5 treat thro values as is stored in part coordinates
                  is NOT CHECKED, in F5 update theo values while in
                  loops is NOT CHECKED)
    
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    
      $$ NO,
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
                  Print command goes here
    
                  Ensure "always" is selected for header options
                  on insp rpt
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    
                  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_NAME,$
                    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
                    TO_EXCEL=OFF,$
                    PREVIOUS_RUNS=KEEP_INSTANCES
                UNTIL/CURR_POS==TOTAL_PARTS
    Hopefully this can help someone who works in a high production environment like me.

    Be mindful of your F5 settings. ALL NOMINAL FIELDS FOR ALL FEATURES (just nom, not theo), AND ANY MOVE POINTS, MOVE INCREMENTS, WHATEVER MUST HAVE +0 OR *1
    of you'll get screwed up by the loop.

    Just figure out where the parts will be on your plate to modify the XYZ IF statements as needed, fix the file path for the PDF rpt output to go where you want, make sure all your recall alignments are good, and then go to town.

    Happy programming!
    Last edited by DAN_M; 01-08-2020, 10:35 AM.

Related Topics

Collapse

Working...
X