hexagon logo

Do Until Pallet using Element function and Trace Fields

Do Until Pallet using Element function and Trace Fields

Here is a sample routine using the Do Until loop for a Pallet routine. I came across a post that Josh Carpenter posted a brief example of a Do Until routine.
I decided to give this a try using PC-DMIS 2022.1 with Trace Fields and the Element function. His example measurement units are in metric and I converted this sample to inches.
This example allows the routine to skip multiple pallet stations.
Josh Carpenter post link for Looping question: Unique Input for Each Part plus Skipping Stations - Starting on Post 2
Link: https://www.pcdmisforum.com/forum/pc...pping-stations

Here is the sample routine.


PART NAME  : Looping DoUntil Forum
REV NUMBER : 20220805
SER NUMBER :
STATS COUNT : 1
 
STARTUP    =ALIGNMENT/START,RECALL:USE_PART_SETUP,LIST=YES
            ALIGNMENT/END
            MODE/MANUAL
            FORMAT/TEXT,OPTIONS, ,HEADINGS,SYMBOLS, ;NOM,TOL,MEAS,DEV,OUTTOL, ,
            LOADPROBE/5BY50_M3_SH
            TIP/TIP1, SHANKIJK=0, 0, 1, ANGLE=0
            TRACEFIELD/DISPLAY=YES,REPORT=NO,DISPLAY MESSAGE=Enter Serial numbers per-part ; partSerialNo : 101,,103,104,105,,107,108,109,110,111,112,113,114,115,116
            TRACEFIELD/DISPLAY=YES,REPORT=NO,DISPLAY MESSAGE=Skip part Ex.(1) or parts Ex.(1,2,3) Enter in ascending order ; skipPartTrace : 2,6
            TRACEFIELD/DISPLAY=YES,REPORT=NO,DISPLAY MESSAGE=Report the skip part information? ; skipPartReportInfo : Yes
            TRACEFIELD/DISPLAY=YES,REPORT=NO,DISPLAY MESSAGE=Enter number of parts - First row X ; xCounterTrace : 4
            TRACEFIELD/DISPLAY=YES,REPORT=NO,DISPLAY MESSAGE=Enter number of parts - First column Y ; yCounterTrace : 4
            TRACEFIELD/DISPLAY=YES,REPORT=NO,DISPLAY MESSAGE=Enter offset distance - First row X Part 1 ; xOffsetPart1 : 0
            TRACEFIELD/DISPLAY=YES,REPORT=NO,DISPLAY MESSAGE=Enter offset distance - First row X Part 2 ; xOffsetPart2 : 3.937008
            TRACEFIELD/DISPLAY=YES,REPORT=NO,DISPLAY MESSAGE=Enter offset distance - First row X Part 3 ; xOffsetPart3 : 7.874016
            TRACEFIELD/DISPLAY=YES,REPORT=NO,DISPLAY MESSAGE=Enter offset distance - First row X Part 4 ; xOffsetPart4 : 11.81102
            TRACEFIELD/DISPLAY=YES,REPORT=NO,DISPLAY MESSAGE=Enter offset distance - First column Y Part 1 ; yOffsetPart1 : 0
            TRACEFIELD/DISPLAY=YES,REPORT=NO,DISPLAY MESSAGE=Enter offset distance - First column Y Part 2 ; yOffsetPart2 : -3.937008
            TRACEFIELD/DISPLAY=YES,REPORT=NO,DISPLAY MESSAGE=Enter offset distance - First column Y Part 3 ; yOffsetPart3 : -7.874016
            TRACEFIELD/DISPLAY=YES,REPORT=NO,DISPLAY MESSAGE=Enter offset distance - First column Y Part 4 ; yOffsetPart4 : -11.81102
            ASSIGN/SKIP_TRACE_CNT=1
            ASSIGN/PART_COUNT=0
            ASSIGN/Y_COUNTER=0
            ASSIGN/X_LOOP_END_COUNT=GETTRACEVALUE("xCounterTrace")
            ASSIGN/Y_LOOP_END_COUNT=GETTRACEVALUE("yCounterTrace")
            DO/
              ASSIGN/Y_COUNTER=Y_COUNTER+1
              IF/Y_COUNTER==1
                ASSIGN/FIXTURE_Y=GETTRACEVALUE("yOffsetPart1")
              END_IF/
              IF/Y_COUNTER==2
                ASSIGN/FIXTURE_Y=GETTRACEVALUE("yOffsetPart2")
              END_IF/
              IF/Y_COUNTER==3
                ASSIGN/FIXTURE_Y=GETTRACEVALUE("yOffsetPart3")
              END_IF/
              IF/Y_COUNTER==4
                ASSIGN/FIXTURE_Y=GETTRACEVALUE("yOffsetPart4")
              END_IF/
              ASSIGN/X_COUNTER=0
              DO/
                ASSIGN/PART_COUNT=PART_COUNT+1
                ASSIGN/X_COUNTER=X_COUNTER+1
                ASSIGN/SKIP_PART_TRACE=ELEMENT(SKIP_TRACE_CNT,",",GETTRACEVALUE("skipPartTrace"))
                ASSIGN/SKIP_PART=SKIP_PART_TRACE
                IF/PART_COUNT==SKIP_PART
                  ASSIGN/SER_NO_TRACE=ELEMENT(PART_COUNT,",",GETTRACEVALUE("partSerialNo"))
                  ASSIGN/SER_NO=SER_NO_TRACE
                  IF/GETTRACEVALUE("skipPartReportInfo")=="Yes"
                    COMMENT/REPT,
                    "SER_NO SKIP: "+SER_NO
                    "PART_COUNT SKIP: "+PART_COUNT
                    .
                  END_IF/
                  ASSIGN/SKIP_TRACE_CNT=SKIP_TRACE_CNT+1
                  IF_GOTO/PART_COUNT==SKIP_PART,GOTO = SKIP_PART_L1
                END_IF/
                ASSIGN/SER_NO_TRACE=ELEMENT(PART_COUNT,",",GETTRACEVALUE("partSerialNo"))
                ASSIGN/SER_NO=SER_NO_TRACE
                COMMENT/REPT,
                "SER_NO: "+SER_NO
                "PART_COUNT: "+PART_COUNT
                IF/X_COUNTER==1
                  ASSIGN/FIXTURE_X=GETTRACEVALUE("xOffsetPart1")
                END_IF/
                IF/X_COUNTER==2
                  ASSIGN/FIXTURE_X=GETTRACEVALUE("xOffsetPart2")
                END_IF/
                IF/X_COUNTER==3
                  ASSIGN/FIXTURE_X=GETTRACEVALUE("xOffsetPart3")
                END_IF/
                IF/X_COUNTER==4
                  ASSIGN/FIXTURE_X=GETTRACEVALUE("xOffsetPart4")
                END_IF/
LOOP_ORIGIN    =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                NOM/XYZ,<0+0,0+0,0+0>,$
                MEAS/XYZ,<FIXTURE_X,FIXTURE_Y,0+0>,$
                NOM/IJK,<0+0,0+0,1+0>,$
                MEAS/IJK,<0+0,0+0,1+0>
A1             =ALIGNMENT/START,RECALL:USE_ACTIVE_ALIGNMENT(STARTUP),LIST=YES
                  ALIGNMENT/TRANS,XAXIS,LOOP_ORIGIN
                  ALIGNMENT/TRANS,YAXIS,LOOP_ORIGIN
                ALIGNMENT/END
F1             =GENERIC/CIRCLE,DEPENDENT,CARTESIAN,OUT,$
                NOM/XYZ,<0,0,0>,$
                MEAS/XYZ,<0,0,0>,$
                NOM/IJK,<0,0,1>,$
                MEAS/IJK,<0,0,1>,$
                DIAMETER/1,1
    DIM LOC1= LOCATION OF CIRCLE F1  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 ----#----
    Z       0.0000     0.0020     0.0020     0.0000     0.0000     0.0000 ----#----
    END OF DIMENSION LOC1
                ASSIGN/DATE=SYSTEMDATE("ddMMMyyyy")
                ASSIGN/TIME=SYSTEMTIME("HHmm")
                ASSIGN/PARTNAME=STR(GETTEXT(191,1,{FILEHEDR}))
                ASSIGN/PDFNAME="C:\\Users\\Public\\Documents\\"+PARTNAME+"_"+TIME+"_"+DATE+".PDF"
SKIP_PART_L1    =LABEL/
              UNTIL/X_COUNTER==X_LOOP_END_COUNT
            UNTIL/Y_COUNTER==Y_LOOP_END_COUNT
            ASSIGN/TOTAL_PART_COUNT=PART_COUNT-(SKIP_TRACE_CNT-1)
$$ YES,
            "TOTAL PART_COUNT: "+TOTAL_PART_COUNT+" of "+PART_COUNT
            PRINT/REPORT,EXEC MODE=END,$
              TO_FILE=OFF,OVERWRITE=PDFNAME,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=KEEP_INSTANCES

Parents
  • Hello folks,

    I have the problem that it doesn't jump to the second row, but stays in the first row forever...​
    Maybe someone can help Slight smile

    STARTUP    =ALIGNMENT/START,RECALL:USE_PART_SETUP,LIST=YES
                ALIGNMENT/END
                MODE/MANUAL
                FORMAT/TEXT,OPTIONS, ,HEADINGS,SYMBOLS, ;NOM,TOL,MEAS,DEV,OUTTOL, ,
                LOADPROBE/PRB92_DRM3_5
                TIP/TIP1, SHANKIJK=0, 0, 1, ANGLE=90
                TRACEFIELD/DISPLAY=YES,REPORT=NO,DISPLAY MESSAGE=Enter Serial numbers per-part ; partSerialNo : 1,2,3,4,5,6,7,8,9,10
                TRACEFIELD/DISPLAY=YES,REPORT=NO,DISPLAY MESSAGE=Skip part Ex.(1) or parts Ex.(1,2,3) Enter in ascending order ; skipPartTrace :
                TRACEFIELD/DISPLAY=YES,REPORT=NO,DISPLAY MESSAGE=Enter number of parts - First row X ; xCounterTrace : 5
                TRACEFIELD/DISPLAY=YES,REPORT=NO,DISPLAY MESSAGE=Enter number of rows ; yCounterTrace : 2
                TRACEFIELD/DISPLAY=YES,REPORT=NO,DISPLAY MESSAGE=Enter offset distance - First row X Part 1 ; xOffsetPart1 : 0
                TRACEFIELD/DISPLAY=YES,REPORT=NO,DISPLAY MESSAGE=Enter offset distance - First row X Part 2 ; xOffsetPart2 : 24
                TRACEFIELD/DISPLAY=YES,REPORT=NO,DISPLAY MESSAGE=Enter offset distance - First row X Part 3 ; xOffsetPart3 : 48
                TRACEFIELD/DISPLAY=YES,REPORT=NO,DISPLAY MESSAGE=Enter offset distance - First row X Part 4 ; xOffsetPart3 : 72
                TRACEFIELD/DISPLAY=YES,REPORT=NO,DISPLAY MESSAGE=Enter offset distance - First row X Part 5 ; xOffsetPart3 : 96
                TRACEFIELD/DISPLAY=YES,REPORT=NO,DISPLAY MESSAGE=Enter offset distance - First column Y Part 1 ; yOffsetPart1 : 0
                TRACEFIELD/DISPLAY=YES,REPORT=NO,DISPLAY MESSAGE=Enter offset distance - First column Y Part 2 ; yOffsetPart2 : -26.7
    CYL1       =FEAT/CYLINDER,CARTESIAN,IN,LEAST_SQR
                THEO/<366.1325,200.7608,94.1266>,<0,0,1>,6,7.7083
                ACTL/<366.1059,200.1466,94.5486>,<0.0008086,-0.0009008,0.9999993>,6.0089,6.2955
                MEAS/CYLINDER,6
                  HIT/BASIC,NORMAL,<365.6202,203.7167,90.3096>,<0.1707707,-0.9853108,0>,<366.0037,203.1526,91.4037>,USE THEO=YES
                  HIT/BASIC,NORMAL,<363.2076,201.4273,90.2831>,<0.9750078,-0.2221705,0>,<363.9286,198.0757,91.4541>,USE THEO=YES
                  HIT/BASIC,NORMAL,<368.8273,199.4429,90.2725>,<-0.8983379,0.4393051,0>,<369.1082,200.1378,91.4872>,USE THEO=YES
                  HIT/BASIC,NORMAL,<368.73,199.2595,97.9808>,<-0.865785,0.5004162,0>,<366.7885,203.0698,97.6984>,USE THEO=YES
                  HIT/BASIC,NORMAL,<366.1138,203.7608,97.9563>,<0.0062177,-0.9999807,0>,<363.4321,198.7796,97.5408>,USE THEO=YES
                  HIT/BASIC,NORMAL,<363.1389,200.562,97.966>,<0.997802,0.066266,0>,<368.7446,198.7039,97.4646>,USE THEO=YES
                ENDMEAS/
    LIN1       =FEAT/LINE,CARTESIAN,UNBOUNDED
                THEO/<329.1322,201.1996,42.0829>,<0,-1,0>
                ACTL/<329.1474,200.3534,42.1652>,<0.0060708,-0.9999816,0>
                MEAS/LINE,3,ZPLUS
                  HIT/BASIC,NORMAL,<329.1363,201.1996,42.0723>,<-1,0,0>,<329.1536,200.3534,42.1253>,USE THEO=YES
                  HIT/BASIC,NORMAL,<329.1243,177.2588,42.0787>,<-1,0,0>,<329.2725,178.1053,42.1635>,USE THEO=YES
                  HIT/BASIC,NORMAL,<329.1362,152.9391,42.0978>,<-1,0,0>,<329.5155,140.3268,42.2068>,USE THEO=YES
                ENDMEAS/
    PNT1       =FEAT/POINT,CARTESIAN
                THEO/<362.1447,200.8556,99.0167>,<0,0,1>
                ACTL/<362.4215,201.2952,99.0155>,<-0.0151699,-0.0103431,0.9998314>
                MEAS/POINT,1,WORKPLANE
                  HIT/BASIC,NORMAL,<362.1447,200.8556,99.0167>,<0,0,1>,<362.4215,201.2952,99.0155>,USE THEO=YES
                ENDMEAS/
    A1         =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
                  ALIGNMENT/LEVEL,ZPLUS,CYL1
                  ALIGNMENT/ROTATE,XPLUS,TO,LIN1,ABOUT,ZPLUS
                  ALIGNMENT/TRANS,XAXIS,CYL1
                  ALIGNMENT/TRANS,YAXIS,CYL1
                  ALIGNMENT/TRANS,ZAXIS,PNT1
                  ALIGNMENT/ROTATE_OFFSET,90,ABOUT,ZPLUS
                ALIGNMENT/END
                MODE/DCC
                CLEARP/ZPLUS,10,ZPLUS,0,ON
                MOVE/CLEARPLANE
                ASSIGN/SKIP_TRACE_CNT=1
                ASSIGN/PART_COUNT=0
                ASSIGN/Y_COUNTER=0
                ASSIGN/X_LOOP_END_COUNT=GETTRACEVALUE("xCounterTrace")
                ASSIGN/Y_LOOP_END_COUNT=GETTRACEVALUE("yCounterTrace")
                DO/
                  ASSIGN/Y_COUNTER=Y_COUNTER+1
                  IF/Y_COUNTER==1
                    ASSIGN/FIXTURE_Y=GETTRACEVALUE("yOffsetPart1")
                  END_IF/
                  IF/Y_COUNTER==2
                    ASSIGN/FIXTURE_Y=GETTRACEVALUE("yOffsetPart2")
                  END_IF/
                  ASSIGN/X_COUNTER=0
                  DO/
                    ASSIGN/PART_COUNT=PART_COUNT+1
                    ASSIGN/X_COUNTER=X_COUNTER+1
                    ASSIGN/SKIP_PART_TRACE=ELEMENT(SKIP_TRACE_CNT,",",GETRACEVALUE("skipPartTrace"))
                    ASSIGN/SKIP_PART=SKIP_PART_TRACE
                    IF/PART_COUNT==SKIP_PART
                      ASSIGN/SER_NO_TRACE=ELEMENT(PART_COUNT,",",GETTRACEVALUE("partSerialNo"))
                      ASSIGN/SER_NO=SER_NO_TRACE
                      IF/GETTRACEVALUE("skipPartReportInfo")=="Yes"
                      END_IF/
                      ASSIGN/SKIP_TRACE_CNT=SKIP_TRACE_CNT+1
                      IF_GOTO/PART_COUNT==SKIP_PART,GOTO = SKIP_PART_L1
                    END_IF/
                    ASSIGN/SER_NO_TRACE=ELEMENT(PART_COUNT,",",GETTRACEVALUE("partSerialNo"))
                    ASSIGN/SER_NO=SER_NO_TRACE
                    IF/X_COUNTER==1
                      ASSIGN/FIXTURE_X=GETTRACEVALUE("xOffsetPart1")
                    END_IF/
                    IF/X_COUNTER==2
                      ASSIGN/FIXTURE_X=GETTRACEVALUE("xOffsetPart2")
                    END_IF/
                    IF/X_COUNTER==3
                      ASSIGN/FIXTURE_X=GETTRACEVALUE("xOffsetPart3")
                    END_IF/
                    IF/X_COUNTER==4
                      ASSIGN/FIXTURE_X=GETTRACEVALUE("xOffsetPart4")
                    END_IF/
                    IF/X_COUNTER==5
                      ASSIGN/FIXTURE_X=GETTRACEVALUE("xOffsetPart5")
                    END_IF/
    LOOP_ORIGIN    =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                    NOM/XYZ,<0+0,0+0,0+0>,$
                    MEAS/XYZ,<FIXTURE_X,FIXTURE_Y,0+0>,$
                    NOM/IJK,<0+0,0+0,1+0>,$
                    MEAS/IJK,<0+0,0+0,1+0>
    A2             =ALIGNMENT/START,RECALL:A1,LIST=YES
                      ALIGNMENT/TRANS,XAXIS,LOOP_ORIGIN
                      ALIGNMENT/TRANS,YAXIS,LOOP_ORIGIN
                    ALIGNMENT/END
                    MOVE/CLEARPLANE
    CYL_D6         =FEAT/CONTACT/CYLINDER/ADAPTIVE_CYLINDER_CONCENTRIC_CIRCLE_SCAN,CARTESIAN,IN,LEAST_SQR
                    THEO/<0,0,-1.4>,<0,0,1>,6,14
                    ACTL/<0,0,-1.4>,<0,0,1>,6,14
                    TARG/<0,0,-1.4>,<0,0,1>
                    START ANG=0,END ANG=0
                    ANGLE VEC=<1,0,0>
                    DIRECTION=CCW
                    SHOW FEATURE PARAMETERS=NO
                    SHOW CONTACT PARAMETERS=YES
                      NUMHITS=5,NUMLEVELS=3,DEPTH=0,END OFFSET=0,PITCH=0
                      SAMPLE METHOD=SAMPLE_HITS
                      SAMPLE HITS=0,SPACER=0
                      AVOIDANCE MOVE=NO
                      FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
                    SHOW HITS=NO
                  UNTIL/X_COUNTER==X_LOOP_END_COUNT
                UNTIL/Y_COUNTER==Y_LOOP_END_COUNT​
  • Changed it. But still behaves the same Disappointed
Reply Children
No Data