serial number displayed on the report from a looped program in X and in Y axis

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

  • serial number displayed on the report from a looped program in X and in Y axis

    how this program works is you hover over the first part it askes you how many parts in each row and how many rows and from those trace fields it sets up the loops in x and in y also at the beginning it asks you what serial number you are starting at . that parts great works perfect the issue im having is at the beginning of where i start reporting i have a few more assignments that i push to a tracefield to report in our stats file as well as put it on the report and it seems like it works sorta but after a few parts it seems to lose a spot. in my pdf see the pic below any ideas????? serial number issue 4.png
    Code:
    MODE/MANUAL
    MANRETRACT/2.54
    FORMAT/TEXT,OPTIONS, ,HEADINGS,SYMBOLS, ;MEAS,NOM,TOL,DEV,OUTTOL, ,
    WORKPLANE/ZPLUS
    LOADPROBE/13_3MM
    TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=0
    DISPLAYPRECISION/6
    FLY/ON
    TRACEFIELD/DISPLAY=YES,REPORT=NO,DISPLAY MESSAGE=Type starting Serial # ; Serial_# : 0183
    ASSIGN/V1=GETTRACEVALUE("Serial_#")
    TRACEFIELD/DISPLAY=YES,REPORT=NO,DISPLAY MESSAGE=How many Rows? ; X_axis : 2
    ASSIGN/V4=GETTRACEVALUE("X_axis")
    TRACEFIELD/DISPLAY=YES,REPORT=NO,DISPLAY MESSAGE=How many Pieces in Each Row? ; Y_axis : 3
    ASSIGN/V5=GETTRACEVALUE("Y_axis")
    $$ NO,
    
    WORKPLANE/ZPLUS
    PREHIT/0.125
    RETRACT/0.125
    MOVESPEED/ 50
    TOUCHSPEED/ 2
    SCANSPEED/5
    WRISTSPEED/ 50
    OPTIONPROBE/MAXFORCE=0.098,LOWFORCE=0.03,UPPERFORCE=0.06,TRIGG ERFORCE=0.045,
    PROBEACCURACY=0.1,POSACCURACY=0.1,#RETURNDATA=7,
    RETURNSPEED=1,SCANPNTDENSITY=32,
    SCANACCELERATION=10,SCANOFFSETFORCE=0.1,
    PROBINGMODE=DFL,MANFINEPROBING=NO
    $$ NO,
    
    COMMENT/OPER,NO,FULL SCREEN=YES,AUTO-CONTINUE=NO,
    move probe above piece you want to start on
    DCC =LABEL/
    MODE/DCC
    COMMENT/OPER,NO,FULL SCREEN=YES,AUTO-CONTINUE=NO,
    SWITCHING TO DCC MODE.
    
    !!PREPARE FOR AUTOMATIC MOVEMENTS!!
    $$ NO,
    +-+-+-+
    |D|C|C|
    +-+-+-+
    
    PNT6 =FEAT/POINT,CARTESIAN
    THEO/<0,0,0>,<0,0,1>
    ACTL/<0,0,2.194472>,<0,0,1>
    READPOINT/
    A1 =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
    ALIGNMENT/TRANS,XAXIS,PNT6
    ALIGNMENT/TRANS,YAXIS,PNT6
    ALIGNMENT/TRANS,ZAXIS,PNT6
    ALIGNMENT/END
    MOVE/POINT,NORMAL,<0,0,3>
    CLEARP/ZPLUS,0.2,ZPLUS,0,ON
    MOVE/CLEARPLANE
    PNT7 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
    THEO/<0,0,0>,<0,0,1>
    ACTL/<0,0,0>,<0,0,1>
    TARG/<0,0,0>,<0,0,1>
    SNAP=NO
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=NO
    A2 =ALIGNMENT/START,RECALL:A1,LIST=YES
    ALIGNMENT/LEVEL,ZPLUS,PNT7
    ALIGNMENT/TRANS,ZAXIS,PNT7
    ALIGNMENT/END
    MOVE/CLEARPLANE
    PICKUP_CIR =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,OUT,LEAST_SQR
    THEO/<0,0,0>,<0,0,1>,0.119,0
    ACTL/<0,0,0>,<0,0,1>,0.119,0
    TARG/<0,0,0>,<0,0,1>
    START ANG=0,END ANG=360
    ANGLE VEC=<1,0,0>
    DIRECTION=CCW
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=NO
    MOVE/CLEARPLANE
    PICKUP_CIR2=FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,OUT,LEAST_SQR
    THEO/<0,4.5,0>,<0,0,1>,0.119,0
    ACTL/<0,4.5,0>,<0,0,1>,0.119,0
    TARG/<0,4.5,0>,<0,0,1>
    START ANG=0,END ANG=360
    ANGLE VEC=<1,0,0>
    DIRECTION=CCW
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=NO
    MOVE/CLEARPLANE
    A3 =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
    ALIGNMENT/ROTATE_CIRCLE,YPLUS,TO,PICKUP_CIR,AND,PICKUP_CIR2, ABOUT,ZPLUS
    ALIGNMENT/TRANS,XAXIS,PICKUP_CIR
    ALIGNMENT/TRANS,YAXIS,PICKUP_CIR
    ALIGNMENT/LEVEL,ZPLUS,PNT6
    ALIGNMENT/TRANS,ZAXIS,PNT6
    ALIGNMENT/END
    V3 =LOOP/START,ID=YES,NUMBER=V4,START=1,SKIP=,
    OFFSET:XAXIS=0.5,YAXIS=0,ZAXIS=0,ANGLE=0
    V2 =LOOP/START,ID=YES,NUMBER=V5,START=1,SKIP=,
    OFFSET:XAXIS=0,YAXIS=0.5,ZAXIS=0,ANGLE=0
    STATS/ON,DATAPAGE,$
    DIRECTORY=,$
    READ=10,WRITE=20,MEMPAGES=64,DIMENSION NAME,CONTROLCALC OFF,$
    STATS/END
    MOVE/POINT,NORMAL,<0.019745,-0.158072,2.994637>
    PREHIT/0.1
    RETRACT/0.1
    CLEARP/ZPLUS,0.194472,ZPLUS,-0.005527,ON
    MOVE/CLEARPLANE
    PICKUP_CIR1 =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,OUT,LEAST_SQR
    THEO/<0,0,0>,<0,0,1>,0.119,0
    ACTL/<0,0,0>,<0,0,1>,0.119,0
    TARG/<0,0,0>,<0,0,1>
    START ANG=0,END ANG=360
    ANGLE VEC=<1,0,0>
    DIRECTION=CCW
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=YES
    NUMHITS=6,DEPTH=-0.04,PITCH=0
    SAMPLE METHOD=SAMPLE_HITS
    SAMPLE HITS=0,SPACER=0
    AVOIDANCE MOVE=NO,DISTANCE=0.393701
    FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
    SHOW HITS=NO
    A4 =ALIGNMENT/START,RECALL:A3,LIST=YES
    ALIGNMENT/ROTATE_CIRCLE,YPLUS,TO,PICKUP_CIR,AND,PICKUP_CIR2, ABOUT,ZPLUS
    ALIGNMENT/TRANS,XAXIS,PICKUP_CIR1
    ALIGNMENT/TRANS,YAXIS,PICKUP_CIR1
    ALIGNMENT/END
    MOVE/CLEARPLANE
    PLN1 =FEAT/CONTACT/PLANE/DEFAULT,CARTESIAN,OUTLINE,LEAST_SQR
    THEO/<-0.5,-1,-0.082>,<0,0,1>
    ACTL/<-0.5,-1,-0.082>,<0,0,1>
    TARG/<-0.5,-1,-0.082>,<0,0,1>
    ANGLE VEC=<1,0,0>,RADIAL
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=YES
    NUMHITS=6,NUMROWS=1
    SPACER=0.09
    AVOIDANCE MOVE=NO,DISTANCE=0.393701
    SHOW HITS=NO
    A5 =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
    ALIGNMENT/LEVEL,ZPLUS,PLN1
    ALIGNMENT/TRANS,ZAXIS,PLN1
    ALIGNMENT/TRANS_OFFSET,ZAXIS,0.082
    ALIGNMENT/ROTATE_CIRCLE,YPLUS,TO,PICKUP_CIR,AND,PICKUP_CIR2, ABOUT,ZPLUS
    ALIGNMENT/TRANS,XAXIS,PICKUP_CIR1
    ALIGNMENT/TRANS,YAXIS,PICKUP_CIR1
    ALIGNMENT/END
    PREHIT/0.02
    RETRACT/0.02
    MOVE/CLEARPLANE
    
    
    
    MOVE/CLEARPLANE
    MOVE/INCREMENT,<0,0,2>
    ASSIGN/V6=V4*(V3-1)
    ASSIGN/V7=((V2-1)+V6)+V1
    TRACEFIELD/DISPLAY=NO,REPORT=YES,DISPLAY MESSAGE=report_serial# ; report_serial# : V7
    DIM 9_1= LOCATION OF CIRCLE CIR2_1 UNITS=IN ,$
    GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
    AX MEAS NOMINAL +TOL -TOL DEV OUTTOL
    R 0.010000 0.010000 0.000000 0.010000 0.000000 0.000000 ---------#
    END OF DIMENSION 9_1
    DIM 9_2= LOCATION OF CIRCLE CIR2_2 UNITS=IN ,$
    GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
    AX MEAS NOMINAL +TOL -TOL DEV OUTTOL
    R 0.010000 0.010000 0.000000 0.010000 0.000000 0.000000 ---------#
    END OF DIMENSION 9_2
    DIM 9_3= LOCATION OF CIRCLE CIR2_3 UNITS=IN ,$
    GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
    AX MEAS NOMINAL +TOL -TOL DEV OUTTOL
    R 0.010000 0.010000 0.000000 0.010000 0.000000 0.000000 ---------#
    END OF DIMENSION 9_3
    DIM 9_4= LOCATION OF CIRCLE CIR2_4 UNITS=IN ,$
    GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
    AX MEAS NOMINAL +TOL -TOL DEV OUTTOL
    R 0.010000 0.010000 0.000000 0.010000 0.000000 0.000000 ---------#
    END OF DIMENSION 9_4
    DIM 10_1= LOCATION OF CIRCLE CIR4_1 UNITS=IN ,$
    GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
    AX MEAS NOMINAL +TOL -TOL DEV OUTTOL
    R 0.010000 0.030000 0.000000 0.030000 -0.020000 0.000000 ---#------
    END OF DIMENSION 10_1
    DIM 10_2= LOCATION OF CIRCLE CIR4_2 UNITS=IN ,$
    GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
    AX MEAS NOMINAL +TOL -TOL DEV OUTTOL
    R 0.010000 0.030000 0.000000 0.030000 -0.020000 0.000000 ---#------
    END OF DIMENSION 10_2
    DIM 10_3= LOCATION OF CIRCLE CIR4_3 UNITS=IN ,$
    GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
    AX MEAS NOMINAL +TOL -TOL DEV OUTTOL
    R 0.015000 0.030000 0.000000 0.030000 -0.015000 0.000000 ----#-----
    END OF DIMENSION 10_3
    DIM 10_4= LOCATION OF CIRCLE CIR4_4 UNITS=IN ,$
    GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
    AX MEAS NOMINAL +TOL -TOL DEV OUTTOL
    R 0.015000 0.030000 0.000000 0.030000 -0.015000 0.000000 ----#-----
    END OF DIMENSION 10_4
    DIM 11= LOCATION OF CIRCLE CIR3 UNITS=IN ,$
    GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
    AX MEAS NOMINAL +TOL -TOL DEV OUTTOL
    D 0.119000 0.119000 0.005000 0.005000 0.000000 0.000000 ----#-----
    END OF DIMENSION 11
    12 =FLATNESS : PLN1
    FEATCTRLFRAME/SHOWPARAMS=YES,SHOWEXPANDED=YES
    CADGRAPH=OFF,REPORTGRAPH=OFF,TEXT=OFF,MULT=10.00,A RROWDENSITY=100,OUTPUT=BOTH,UNITS=IN
    PER UNIT=NO,
    STANDARDTYPE=ASME_Y14_5
    DIMENSION/FLATNESS,0.002
    NOTE/12
    FEATURES/PLN1,,
    DIM 13= 3D DISTANCE FROM PLANE PLN1 TO POINT PNT3,SHORTEST=OFF,NO_RADIUS UNITS=IN,$
    GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH
    AX MEAS NOMINAL +TOL -TOL DEV OUTTOL
    M 0.082000 0.082000 0.005000 0.005000 0.000000 0.000000 ----#-----
    DIM 14= LOCATION OF CIRCLE CIR5 UNITS=IN ,$
    GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
    AX MEAS NOMINAL +TOL -TOL DEV OUTTOL
    D 0.200000 0.200000 0.005000 0.005000 0.000000 0.000000 ----#-----
    END OF DIMENSION 14
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,AUTO=V1,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
    STATS/TRANSFER,DIRECTORY=\\SERVER5\USERFOLDERS\CMM\INSPE CTION_DATA\SPC DATA
    LOOP/END
    LOOP/END

  • #2
    Code:
    ASSIGN/V6=V4*(V3-1)
    ASSIGN/V7=((V2-1)+V6)+V1
    recalculates V7 fresh every time.

    Try something like this - first time through, as validated by inner loop times outer loop being equal to 1, uses the initial input, after that it adds it to itself.
    Code:
    ASSIGN/V6=V4*(V3-1)
    ASSIGN/V7=((V2-1)+V6)+if(v2*v3==1,V1,v7)
    Though I'm thinking - all you want to do is increment the serial number for every sample you run?

    ASSIGN/V7==IF(V7==0,V1,V7+1)

    First time through V7 hasn't been assigned, so it sets it to the input value. After that it just increments it by one every time.

    Comment


    • #3
      check this out

      https://www.pcdmisforum.com/forum/pc...-macro-program
      SF7107(PCD), SF454(PCD), 152614(Quindos), 9159(Quindos), 7107(Quindos), B&S Manual, M&M Gear Checker

      Comment

      Related Topics

      Collapse

      Working...
      X