Loop problems and Questions

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

  • Loop problems and Questions

    I have a problem with a loop and position dimensions in loop. I have a fixture for 6 parts each 150mm apart. First I made manual alignment on the fixture (ROC_A1_6G_FIXTURE), then on the part (A1_POM1,A1_POM2,A2_POM_PART) for DCC part alignment and then A3_DRW (alignment on the drawing). At the beginning of the program I input data for CYCLE, number of PARTS on the fixture and CAVITY of the first part.

    The code is bellow and it measure only first part 6 times.

    Code:
    C10        =COMMENT/INPUT,NO,FULL SCREEN=NO,
                NUMBER OF CYCLE?
    L1         =LABEL/
    C11        =COMMENT/INPUT,NO,FULL SCREEN=NO,
                HOW MANY PARTS ON A FIXTURE? MAX 6 PARTS!
                IF/C11.INPUT>6
                  GOTO/L1
                END_IF/
    C12        =COMMENT/INPUT,NO,FULL SCREEN=NO,
                CAVITY NUBER OF FIRST PART!
    ROC PLN1_6G=FEAT/PLANE,CARTESIAN,TRIANGLE
                THEO/<419.014,526.352,-541.246>,<0.9999996,0.000843,-0.0001152>
                ACTL/<419.824,519.145,-538.106>,<1,0.0002204,-0.000072>
                MEAS/PLANE,6
                  HIT/BASIC,NORMAL,<419.619,90.484,-456.088>,<0.9999996,0.000843,-0.0001152>,<419.933,962.128,-625.916>,USE THEO=YES
                  HIT/BASIC,NORMAL,<419.637,90.484,-633.157>,<0.9999996,0.000843,-0.0001152>,<419.995,962.126,-460.508>,USE THEO=YES
                  HIT/BASIC,NORMAL,<418.497,525.339,-616.107>,<0.9999996,0.000843,-0.0001152>,<419.362,507.668,-451.074>,USE THEO=YES
                  HIT/BASIC,NORMAL,<418.551,525.339,-462.154>,<0.9999996,0.000843,-0.0001152>,<419.303,507.669,-616.678>,USE THEO=YES
                  HIT/BASIC,NORMAL,<418.924,963.232,-462.157>,<0.9999996,0.000843,-0.0001152>,<420.182,87.637,-616.684>,USE THEO=YES
                  HIT/BASIC,NORMAL,<418.858,963.236,-617.812>,<0.9999996,0.000843,-0.0001152>,<420.171,87.64,-457.774>,USE THEO=YES
                ENDMEAS/
    ROC CIR1_6G=FEAT/CIRCLE,CARTESIAN,IN,LEAST_SQR
                THEO/<418.57,145.127,-608.133>,<1,0,0>,42.614
                ACTL/<418.799,144.74,-608.121>,<1,0,0>,42.522
                MEAS/CIRCLE,4,XPLUS
                  HIT/BASIC,NORMAL,<418.563,145.445,-629.449>,<0,-0.0149207,0.9998887>,<418.818,145.45,-629.379>,USE THEO=YES
                  MOVE/CIRCULAR
                  HIT/BASIC,NORMAL,<418.588,145.45,-586.818>,<0,-0.0151353,-0.9998855>,<418.816,145.454,-586.861>,USE THEO=YES
                  MOVE/CIRCULAR
                  HIT/BASIC,NORMAL,<418.561,166.406,-607.262>,<0,-0.9991621,-0.0409276>,<418.779,165.78,-605.137>,USE THEO=YES
                  MOVE/CIRCULAR
                  HIT/BASIC,NORMAL,<418.566,123.849,-607.256>,<0,0.9991504,-0.0412126>,<418.781,123.698,-605.147>,USE THEO=YES
                ENDMEAS/
    ROC CIR2_6G=FEAT/CIRCLE,CARTESIAN,IN,LEAST_SQR
                THEO/<418.166,894.89,-608.175>,<1,0,0>,42.654
                ACTL/<419.222,894.497,-608.171>,<1,0,0>,42.647
                MEAS/CIRCLE,4,XPLUS
                  HIT/BASIC,NORMAL,<418.175,916.198,-607.363>,<0,-0.999274,-0.0380982>,<419.223,893.769,-629.487>,USE THEO=YES
                  MOVE/CIRCULAR
                  HIT/BASIC,NORMAL,<418.189,873.582,-607.36>,<0,0.9992693,-0.0382204>,<419.231,893.776,-586.854>,USE THEO=YES
                  MOVE/CIRCULAR
                  HIT/BASIC,NORMAL,<418.146,894.628,-629.504>,<0,0.0122751,0.9999247>,<419.212,915.707,-606.028>,USE THEO=YES
                  MOVE/CIRCULAR
                  HIT/BASIC,NORMAL,<418.152,894.642,-586.847>,<0,0.0116215,-0.9999325>,<419.222,873.288,-606.021>,USE THEO=YES
                ENDMEAS/
    ROC LIN1_6G=FEAT/LINE,CARTESIAN,UNBOUNDED,NO
                THEO/<418.368,145.127,-608.133>,<0,1,-0.0000561>
                ACTL/<419.01,144.74,-608.121>,<0,1,-0.0000667>
                CONSTR/LINE,BF,2D,ROC CIR1_6G,ROC CIR2_6G,,
                OUTLIER_REMOVAL/OFF,3
                FILTER/OFF,WAVELENGTH=0
    ROC PNT1_6G=FEAT/POINT,CARTESIAN,NO
                THEO/<418.368,520.009,-608.154>,<0,0,1>
                ACTL/<419.01,519.618,-608.146>,<0,0,1>
                CONSTR/POINT,MID,ROC CIR1_6G,ROC CIR2_6G
    ROC_A1_6G_FIXTURE=ALIGNMENT/START,RECALL:STARTUP,LIST=YES
                  ALIGNMENT/LEVEL,XPLUS,ROC PLN1_6G
                  ALIGNMENT/TRANS,XAXIS,ROC PLN1_6G
                  ALIGNMENT/ROTATE,YPLUS,TO,ROC LIN1_6G,ABOUT,XPLUS
                  ALIGNMENT/ROTATE_OFFSET,0.391,ABOUT,XPLUS
                  ALIGNMENT/TRANS_OFFSET,XAXIS,-1.2
                  ALIGNMENT/TRANS,YAXIS,ROC PNT1_6G
                  ALIGNMENT/TRANS,ZAXIS,ROC PNT1_6G
                  ALIGNMENT/TRANS_OFFSET,YAXIS,-374.361
                  ALIGNMENT/TRANS_OFFSET,ZAXIS,92.584
                ALIGNMENT/END
                MODE/DCC
                ASSIGN/SHIFTY=150
                ASSIGN/YOFF=0
                CLEARP/XPLUS,40,XPLUS,40,ON
                MOVE/POINT,NORMAL,<60,0,200>
                ASSIGN/CAVITY=C12.INPUT-1
    V1         =LOOP/START,ID=YES,NUMBER=C11.INPUT,START=1,SKIP=,
                  OFFSET:XAXIS=0,YAXIS=YOFF,ZAXIS=0,ANGLE=0
                  ASSIGN/CAVITY=CAVITY+1
                  COMMENT/REPT,
                  *****************************************
                  "CYCLE NU.: "+C10.INPUT+""
                  COMMENT/REPT,
                  "CAVITY NU.: "+CAVITY+"
                  *****************************************"
                  MOVE/CLEARPLANE
    CIR1_POM     =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                  THEO/<4.4,-4.09,0>,<1,0,0>,17.155
                  ACTL/<4.4,-3.94,-0.362>,<1,0,0>,17.207
                  TARG/<4.4,-4.09,0>,<1,0,0>
                  START ANG=0,END ANG=360
                  ANGLE VEC=<0,0,-1>
                  DIRECTION=CCW
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=YES
                    NUMHITS=3,DEPTH=4,PITCH=0
                    SAMPLE METHOD=SAMPLE_HITS
                    SAMPLE HITS=0,SPACER=3
                    AVOIDANCE MOVE=NO,DISTANCE=20
                    FIND HOLE=CENTER,ONERROR=NO,READ POS=NO
                  SHOW HITS=NO
    A1_POM1      =ALIGNMENT/START,RECALL:ROC_A1_6G_FIXTURE,LIST=YES
                    ALIGNMENT/TRANS,YAXIS,CIR1_POM
                    ALIGNMENT/TRANS,ZAXIS,CIR1_POM
                    ALIGNMENT/TRANS_OFFSET,YAXIS,4.09
                  ALIGNMENT/END
    PNT1_POM     =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                  THEO/<-14.75,-4.09,0>,<1,0,0>
                  ACTL/<-15.852,-4.087,-0.002>,<1,0,0>
                  TARG/<-14.75,-4.09,0>,<1,0,0>
                  SNAP=NO
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=YES
                    AVOIDANCE MOVE=NO,DISTANCE=0
                  SHOW HITS=NO
    A1_POM2      =ALIGNMENT/START,RECALL:A1_POM1,LIST=YES
                    ALIGNMENT/TRANS,XAXIS,PNT1_POM
                    ALIGNMENT/TRANS_OFFSET,XAXIS,14.75
                  ALIGNMENT/END
                  MOVE/CLEARPLANE
                  MOVE/POINT,NORMAL,<60,0,200>
                  MOVE/CLEARPLANE

  • #2
    Code:
    pnta1_1kos   =feat/contact/vector point/default,cartesian
                  theo/<6.2,324.531,-0.046>,<1,0,0>
                  actl/<6.2,324.53,-0.045>,<1,0,0>
                  targ/<6.2,324.531,-0.046>,<1,0,0>
                  snap=no
                  show feature parameters=no
                  show contact parameters=yes
                    avoidance move=no,distance=0
                  show hits=no
                  move/clearplane
    pnta2_1kos   =feat/contact/vector point/default,cartesian
                  theo/<6.2,281.503,24.347>,<1,0,0>
                  actl/<5.195,282.036,22.019>,<0.9999812,0.001924,-0.0058262>
                  targ/<6.2,281.503,24.347>,<1,0,0>
                  snap=no
                  show feature parameters=no
                  show contact parameters=yes
                    avoidance move=no,distance=0
                  show hits=no
                  move/clearplane
    pnta3_1kos   =feat/contact/vector point/default,cartesian
                  theo/<6.2,281.861,-24.938>,<1,0,0>
                  actl/<4.908,282.139,-27.27>,<0.9999812,0.001924,-0.0058262>
                  targ/<6.2,281.861,-24.938>,<1,0,0>
                  snap=no
                  show feature parameters=no
                  show contact parameters=yes
                    avoidance move=no,distance=0
                  show hits=no
                  move/clearplane
    cirb1_1kos   =feat/contact/circle/default,cartesian,in,least_sqr
                  theo/<4.4,295.91,0>,<1,0,0>,17.155
                  actl/<3.171,296.317,-2.41>,<0.9999858,0.000851,-0.0052647>,17.155
                  targ/<4.4,295.91,0>,<1,0,0>
                  start ang=0,end ang=360
                  angle vec=<0,0,-1>
                  direction=ccw
                  show feature parameters=no
                  show contact parameters=yes
                    numhits=7,depth=4,pitch=0
                    sample method=sample_hits
                    sample hits=0,spacer=3
                    avoidance move=no,distance=20
                    find hole=center,onerror=no,read pos=no
                  show hits=no
                  move/clearplane
    pnt1_1kos    =feat/contact/vector point/default,cartesian
                  theo/<6.1,303.653,35>,<0.0174524,0.9998477,-0.0000127>
                  actl/<6.106,304.021,35.005>,<0.0174524,0.9998477,-0.0000127>
                  targ/<6.1,303.653,35>,<0.0174524,0.9998477,-0.0000127>
                  snap=no
                  show feature parameters=no
                  show contact parameters=yes
                    avoidance move=no,distance=0
                  show hits=no
                  move/clearplane
    pnt2_1kos    =feat/contact/vector point/default,cartesian
                  theo/<6.1,296.344,35>,<0.0174524,-0.9998477,0.0000127>
                  actl/<6.083,297.177,35.009>,<0.0174524,-0.9998477,0.0000127>
                  targ/<6.1,296.344,35>,<0.0174524,-0.9998477,0.0000127>
                  snap=no
                  show feature parameters=no
                  show contact parameters=yes
                    avoidance move=no,distance=0
                  show hits=no
                  move/point,normal,<40,292.5,35>
    pntc_1kos    =feat/point,cartesian,no
                  theo/<6.1,299.999,35>,<0,0,1>
                  actl/<6.095,300.599,35.007>,<0,0,1>
                  constr/point,mid,pnt1_1kos,pnt2_1kos
    a2_pom_part  =alignment/start,recall:a1_pom2,list=yes
                    alignment/iterate
                      pnt target rad=1,start label=,fixture tol=0.1,error label=
                      meas all feat=always,max iterations=2,level axis=xaxis,rotate axis=yaxis,origin axis=zaxis
                    level=pnta1_1kos,pnta2_1kos,pnta3_1kos,,
                    rotate=cirb1_1kos,pntc_1kos,,
                    origin=cirb1_1kos,,
                  alignment/end
                  move/point,normal,<40,300,200>
                  prehit/3
                  retract/3
                  move/point,normal,<40,300,200>
                  tip/t1a90b90, shankijk=-1, 0.002, -0.006, angle=90.1
                  move/point,normal,<-40,300,200>
                  move/point,normal,<-20,289,35> 
    pnta1        =feat/contact/vector point/default,cartesian
                  theo/<0,288,37.25>,<-1,0,0>
                  actl/<-0.274,287.885,38.339>,<-0.9999918,-0.0004488,-0.0040137>
                  targ/<0,288,37.25>,<-1,0,0>
                  snap=no
                  show feature parameters=no
                  show contact parameters=yes
                    avoidance move=both,distance=10
                  show hits=no
    pnta3        =feat/contact/vector point/default,cartesian
                  theo/<0,326,-10>,<-1,0,0>
                  actl/<-0.101,325.851,-8.937>,<-0.9999918,-0.0004488,-0.0040137>
                  targ/<0,326,-10>,<-1,0,0>
                  snap=no
                  show feature parameters=no
                  show contact parameters=yes
                    avoidance move=both,distance=10
                  show hits=no
    pnta2        =feat/contact/vector point/default,cartesian
                  theo/<0,272.1,-21.5>,<-1,0,0>
                  actl/<-0.031,271.943,-20.397>,<-0.9999918,-0.0004488,-0.0040137>
                  targ/<0,272.1,-21.5>,<-1,0,0>
                  snap=no
                  show feature parameters=no
                  show contact parameters=yes
                    avoidance move=both,distance=10
                  show hits=no
                  move/point,normal,<-40,273,-21.5>
                  move/point,normal,<-40,273,200>
                  tip/t1a90b-90, shankijk=1, -0.002, 0.006, angle=-90.1
                  move/point,normal,<40,300,200>
                  move/clearplane
    cir_b        =feat/contact/circle/adaptive_circle_scan,cartesian,in,max_insc
                  theo/<-13.45,295.91,0>,<1,0,0>,16.6
                  actl/<-13.577,295.762,1.035>,<0.9999983,0.0018319,0.0000036>,16.576
                  targ/<-13.45,295.91,0>,<1,0,0>
                  start ang=0,end ang=360
                  angle vec=<0,0,-1>
                  direction=ccw
                  show feature parameters=no
                  show contact parameters=yes
                    numhits=13,depth=0,pitch=0
                    sample method=sample_hits
                    sample hits=0,spacer=0
                    avoidance move=no,distance=0
                    find hole=disabled,onerror=no,read pos=no
                  show hits=no
                  move/clearplane
    pnt1         =feat/contact/vector point/default,cartesian
                  theo/<6.1,303.653,33.5>,<0.0174524,0.9998477,-0.0000127>
                  actl/<5.835,303.396,34.606>,<0.0170193,0.9998549,-0.0006605>
                  targ/<6.1,303.653,33.5>,<0.0174524,0.9998477,-0.0000127>
                  snap=no
                  show feature parameters=no
                  show contact parameters=yes
                    avoidance move=no,distance=10
                  show hits=no
    pnt2         =feat/contact/vector point/default,cartesian
                  theo/<6.1,303.653,37>,<0.0174524,0.9998477,-0.0000127>
                  actl/<5.822,303.395,38.107>,<0.0170193,0.9998549,-0.0006605>
                  targ/<6.1,303.653,37>,<0.0174524,0.9998477,-0.0000127>
                  snap=no
                  show feature parameters=no
                  show contact parameters=yes
                    avoidance move=no,distance=10
                  show hits=no
                  move/clearplane
    pnt3         =feat/contact/vector point/default,cartesian
                  theo/<6.1,296.344,33.5>,<0.0174524,-0.9998477,0.0000127>
                  actl/<5.836,296.385,34.611>,<0.0178852,-0.9998397,0.0007992>
                  targ/<6.1,296.344,33.5>,<0.0174524,-0.9998477,0.0000127>
                  snap=no
                  show feature parameters=no
                  show contact parameters=yes
                    avoidance move=no,distance=10
                  show hits=no
    pnt4         =feat/contact/vector point/default,cartesian
                  theo/<6.1,296.344,37>,<0.0174524,-0.9998477,0.0000127>
                  actl/<5.823,296.363,38.111>,<0.0178852,-0.9998397,0.0007992>
                  targ/<6.1,296.344,37>,<0.0174524,-0.9998477,0.0000127>
                  snap=no
                  show feature parameters=no
                  show contact parameters=yes
                    avoidance move=no,distance=10
                  show hits=no
                  move/point,normal,<40,293,37>
                  move/point,normal,<40,300,200>
    lin1         =feat/line,cartesian,unbounded,no
                  theo/<6.1,303.653,33.5>,<0,0.0000127,1>
                  actl/<5.835,303.396,34.606>,<-0.0039744,-0.000287,0.9999921>
                  constr/line,bf,2d,pnt1,pnt2,,
                  outlier_removal/off,3
                  filter/off,wavelength=0
    lin2         =feat/line,cartesian,unbounded,no
                  theo/<6.1,296.344,33.5>,<0,0.0000127,1>
                  actl/<5.837,296.385,34.611>,<-0.0039718,-0.0062254,0.9999727>
                  constr/line,bf,2d,pnt3,pnt4,,
                  outlier_removal/off,3
                  filter/off,wavelength=0
    lin3         =feat/line,cartesian,unbounded,no
                  theo/<6.1,299.999,33.5>,<0,0.0000127,1>
                  actl/<5.836,299.89,34.608>,<-0.0039731,-0.0032562,0.9999868>
                  constr/line,mid,lin1,lin2
    pnt_c        =feat/point,cartesian,no
                  theo/<6.1,299.999,35.25>,<0,0.0000127,1>
                  actl/<5.829,299.885,36.359>,<-0.0039731,-0.0032562,0.9999868>
                  constr/point,cast,lin3

    Comment


    • #3
      Code:
      A3_DRW       =ALIGNMENT/START,RECALL:A2_POM_PART,LIST=YES
                      ALIGNMENT/ITERATE
                        PNT TARGET RAD=1,START LABEL=,FIXTURE TOL=0.005,ERROR LABEL=
                        MEAS ALL FEAT=ALWAYS,MAX ITERATIONS=2,LEVEL AXIS=XAXIS,ROTATE AXIS=YAXIS,ORIGIN AXIS=ZAXIS
                      LEVEL=PNTA1,PNTA3,PNTA2,,
                      ROTATE=CIR_B,PNT_C,,
                      ORIGIN=CIR_B,,
                    ALIGNMENT/END
      PLNA         =FEAT/PLANE,CARTESIAN,TRIANGLE,NO,LEAST_SQR
                    THEO/<0,295.367,1.917>,<-1,0,0>
                    ACTL/<0.198,295.364,2.794>,<-1,0,0>
                    CONSTR/PLANE,BF,PNTA1,PNTA2,PNTA3,,
                    OUTLIER_REMOVAL/OFF,3
                    FILTER/OFF,WAVELENGTH=0
      F1           =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                    NOM/XYZ,<6.1,300,0>,$
                    MEAS/XYZ,<6.298,299.997,0.882>,$
                    NOM/IJK,<0,0,1>,$
                    MEAS/IJK,<1,0,0>
      LIN4         =FEAT/LINE,CARTESIAN,UNBOUNDED,NO
                    THEO/<6.1,300,0>,<0,-0.0000413,1>
                    ACTL/<6.298,299.997,0.882>,<0,-0.0000413,1>
                    CONSTR/LINE,BF,2D,F1,PNT_C,,
                    OUTLIER_REMOVAL/OFF,3
                    FILTER/OFF,WAVELENGTH=0
                    MOVE/CLEARPLANE
      PLN1         =FEAT/CONTACT/PLANE/DEFAULT,CARTESIAN,OUTLINE,LEAST_SQR
                    THEO/<-14.75,295.91,0>,<1,0,0>
                    ACTL/<-14.458,295.907,0.879>,<0.9999996,0.0008533,-0.0003858>
                    TARG/<-14.75,295.91,0>,<1,0,0>
                    ANGLE VEC=<0,0,-1>,RADIAL
                    SHOW FEATURE PARAMETERS=NO
                    SHOW CONTACT PARAMETERS=YES
                      NUMHITS=7,NUMROWS=4
                      SPACER=1.5
                      AVOIDANCE MOVE=NO,DISTANCE=0
                    SHOW HITS=NO
                    MOVE/POINT,NORMAL,<40,300,0>
                    MOVE/POINT,NORMAL,<40,300,220>
                    LOADPROBE/SM25-1 FI_1_L30
                    TIP/T1A90B-90, SHANKIJK=1, -0.003, 0.002, ANGLE=-90.059
                    MOVE/POINT,NORMAL,<40,290,240>
                    MOVE/CLEARPLANE
                    MOVE/CLEARPLANE
      CIR1         =FEAT/CONTACT/CIRCLE/ADAPTIVE_CIRCLE_SCAN,CARTESIAN,IN,MAX_INSC
                    THEO/<1.5,306.278,34.997>,<1,0,0>,4.3
                    ACTL/<1.698,306.243,35.912>,<1,0,0>,4.332
                    TARG/<1.5,306.278,34.997>,<1,0,0>
                    START ANG=0,END ANG=360
                    ANGLE VEC=<0,0,-1>
                    DIRECTION=CCW
                    SHOW FEATURE PARAMETERS=NO
                    SHOW CONTACT PARAMETERS=YES
                      NUMHITS=7,DEPTH=0,PITCH=0
                      SAMPLE METHOD=SAMPLE_HITS
                      SAMPLE HITS=0,SPACER=0
                      AVOIDANCE MOVE=NO,DISTANCE=0
                      FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
                    SHOW HITS=NO
      
      
      *   a lot off code, not relevant
      *
      *  and the end
      
      D065_1 DIST1= 3D DISTANCE FROM POINT PNT499 TO POINT PNT500,SHORTEST=OFF,NO_RADIUS  UNITS=MM,$
        GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH
        AX       MEAS    NOMINAL        DEV       +TOL       -TOL     OUTTOL
        M        5.182  MERA65     -0.018      0.100      0.100      0.000 ---#-----
        DIM D065_2 DIST1= 3D DISTANCE FROM POINT PNT501 TO POINT PNT502,SHORTEST=OFF,NO_RADIUS  UNITS=MM,$
        GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH
        AX       MEAS    NOMINAL        DEV       +TOL       -TOL     OUTTOL
        M        5.185  MERA65     -0.015      0.100      0.100      0.000 ---#-----
                    ASSIGN/YOFF=YOFF+SHIFTY
                  LOOP/END
                  RECALL/ALIGNMENT,INTERNAL,ROC_A1_6G_FIXTURE
                  MOVE/POINT,NORMAL,<60,850,400>

      If I write loop like this. All the parts are measured but nominals (y-axes) for positions dimensions are wrong. For the first part nominal y=4.09, for the second part is 154.09, for the third part is 304.09 and so on. I do not want this, because we have to report y-axes of positions dimension too and i do now want to recalculate all the values. I want all nominals for the 2.3.4.5.6. parts to be the same as first part, although they are multiple 150mm apart.

      Code:
          
      V1         =LOOP/START,ID=YES,NUMBER=C11.INPUT,START=1,SKIP=,
                    OFFSET:XAXIS=0,YAXIS=150,ZAXIS=0,ANGLE=0
      *
      *
       D065_1 DIST1= 3D DISTANCE FROM POINT PNT499 TO POINT PNT500,SHORTEST=OFF,NO_RADIUS  UNITS=MM,$
        GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH
        AX       MEAS    NOMINAL        DEV       +TOL       -TOL     OUTTOL
        M        5.182  MERA65     -0.018      0.100      0.100      0.000 ---#-----
        DIM D065_2 DIST1= 3D DISTANCE FROM POINT PNT501 TO POINT PNT502,SHORTEST=OFF,NO_RADIUS  UNITS=MM,$
        GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH
        AX       MEAS    NOMINAL        DEV       +TOL       -TOL     OUTTOL
        M        5.185  MERA65     -0.015      0.100      0.100      0.000 ---#-----
                               LOOP/END
      RECALL/ALIGNMENT,INTERNAL,ROC_A1_6G_FIXTURE
                  MOVE/POINT,NORMAL,<60,850,400>
      Last edited by mitkos; 08-07-2019, 12:05 PM.

      Comment


      • #4
        Here's what I do for loops (when using the loop/start command)
        -Make the loop number = to 1 when programming.
        -ALWAYS execute the routine offline with loop count = 1 before implementing any changes.
        -Recall your first part's initial alignment at start of loop and at end of loop.
        -make sure you re-align ALL 6 degrees of freedom to the part within the loop.

        Then, when all your code and data output is rock-solid for the first part:
        change the loop number to your variable quantity. DONT EXECUTE. save, set PRG as read-only.
        Then execute.

        Comment


        • louisd
          louisd commented
          Editing a comment
          Yes and yes. It will also produce an error message saying the file is not capable of being changed at the beginning. Just click through them. Control of your routine code is much more important than avoiding a pop-up.

        • mdcon
          mdcon commented
          Editing a comment
          Thanks louisd !! I wish the Demon didn't save on exit/close. I suspect this is how a lot of my programs get corrupted.

        • mckenzie
          mckenzie commented
          Editing a comment
          mdcon you can skip the save on exit by using quit instead of close, it will still give you a popup asking are you sure but you can click the box to not show it again

      • #5
        Originally posted by louisd View Post
        set PRG as read-only.
        Can't stress this enough!
        PcDmis 2015.1 SP10 CAD++
        Global 7-10-7 DC800S

        Comment


        • #6
          Program has been already written for one piece. I changed it with adding loop in it. Increment moves sounds a good idea. Yes, maybe I will change this. OK I will make it read only.

          Haw about position dimension in a loop? I tested XactMeasure and Legacy. XactMeasure nominal gets shifted (y-axis), for second and all other pieces but measured values are correct. This means that result TP is huge. Legacy result are OK, but nominal and measured values should not be shifted, should be linked to measured piece (have to report nominals and measured values too, not only TP).

          Example below (Shift y=16mm):
          Code:
          DIM D1 = POSITION OF CIR1[1]  FIT TO DATUMS=ON  DEV PERPEN CENTERLINE=ON  UNITS=MM
          AX       MEAS    NOMINAL       +TOL       -TOL      BONUS          DEV     OUTTOL      DEVANG
          X     -32.006    -32.000                                        -0.006                       
          Y       0.002      0.000                                         0.002                      
          DF      8.015      8.000      0.050      0.050                   0.015      0.000             ---#--
          D1                                                        PLANE PLN A[1] AT RFS          
          D2                                                        LINE LIN B[1] AT RFS          
          D3                                                        POINT PNT C[1] AT RFS          
          TP      0.013        RFS      0.050                 0.000        0.013      0.000     160.912 -#----
          
          DIM D2[1]= POSITION OF CIRCLE CIR1[1]  UNITS=MM
          AX       MEAS    NOMINAL       +TOL       -TOL      BONUS        DEV     OUTTOL     DEVANG
          X     -32.006    -32.000                                      -0.006                     
          Y       0.002      0.000                                       0.002                     
          TP      0.013        RFS      0.050                 0.000      0.013      0.000    160.912 -#----
          
          DIM D1 = POSITION OF CIR1[2]  FIT TO DATUMS=ON  DEV PERPEN CENTERLINE=ON  UNITS=MM
          AX       MEAS    NOMINAL       +TOL       -TOL      BONUS          DEV     OUTTOL      DEVANG
          X     -32.004    -32.000                                        -0.004                      
          Y      -0.001     16.000                                       -16.001                      
          DF      8.014      8.000      0.050      0.050                   0.014      0.000             ---#--
          D1                                                        PLANE PLN A[2] AT RFS          
          D2                                                        LINE LIN B[2] AT RFS          
          D3                                                        POINT PNT C[2] AT RFS          
          TP     32.001        RFS      0.050                 0.000       32.001     31.951     -90.015 ----->
          
          DIM D2[2]= POSITION OF CIRCLE CIR1[2]  UNITS=MM
          AX       MEAS    NOMINAL       +TOL       -TOL      BONUS        DEV     OUTTOL     DEVANG
          X     -32.004    -32.000                                      -0.004                     
          Y      15.999     16.000                                      -0.001                     
          TP      0.008        RFS      0.050                 0.000      0.008      0.000   -172.055 -#----

          What I want to get in my RTF is below:

          Code:
          DIM D1 = POSITION OF CIR1[1]  FIT TO DATUMS=ON  DEV PERPEN CENTERLINE=ON  UNITS=MM
          AX       MEAS    NOMINAL       +TOL       -TOL      BONUS          DEV     OUTTOL      DEVANG
          X     -32.006    -32.000                                        -0.006                       
          Y       0.002      0.000                                         0.002                      
          DF      8.015      8.000      0.050      0.050                   0.015      0.000             ---#--
          D1                                                        PLANE PLN A[1] AT RFS          
          D2                                                        LINE LIN B[1] AT RFS          
          D3                                                        POINT PNT C[1] AT RFS          
          TP      0.013        RFS      0.050                 0.000        0.013      0.000     160.912 -#----
          
          DIM D2[1]= POSITION OF CIRCLE CIR1[1]  UNITS=MM
          AX       MEAS    NOMINAL       +TOL       -TOL      BONUS        DEV     OUTTOL     DEVANG
          X     -32.006    -32.000                                      -0.006                     
          Y       0.002      0.000                                       0.002                     
          TP      0.013        RFS      0.050                 0.000      0.013      0.000    160.912 -#----
          
          DIM D1 = POSITION OF CIR1[2]  FIT TO DATUMS=ON  DEV PERPEN CENTERLINE=ON  UNITS=MM
          AX       MEAS    NOMINAL       +TOL       -TOL      BONUS          DEV     OUTTOL      DEVANG
          X     -32.004    -32.000                                        -0.004                      
          Y      -0.001      0.000                                           -0.001                      
          DF      8.014     8.000      0.050      0.050                   0.014      0.000             ---#--
          D1                                                        PLANE PLN A[2] AT RFS          
          D2                                                        LINE LIN B[2] AT RFS          
          D3                                                        POINT PNT C[2] AT RFS          
          TP     0.008        RFS      0.050                 0.000       0.008     0.000     -0.015 ----->
          
          DIM D2[2]= POSITION OF CIRCLE CIR1[2]  UNITS=MM
          AX       MEAS    NOMINAL       +TOL       -TOL      BONUS        DEV     OUTTOL     DEVANG
          X     -32.004    -32.000                                      -0.004                     
          Y      -0.001     0.000                                      -0.001                     
          TP      0.008        RFS      0.050                 0.000      0.008      0.000   -172.055 -#----

          Comment


          • #7
            When you execute the loop, it should output the data correctly.
            Once the execution has completed, the edit window contains locations of last loop offset values, relative to the loop's initial alignment, but the reported values should still be correct/relative to the specific part.

            have you attempted this?

            Comment


            • #8
              The code I posted before is not copied from edit window but from rtf report. I made a short test program, execute the loop and the output data (rtf report) is not correct. What Am I missing here? Is there any parameters to change?

              After program execution for 2 pieces I have this in my edit window (exactly the opposite you say I should have, if I understand you)
              Code:
                DIM D1 =POSITION : CIR1
                            FEATCTRLFRAME/SHOWNOMS=NO,SHOWPARAMS=YES,SHOWEXPANDED=YES,
                            CADGRAPH=OFF,REPORTGRAPH=OFF,TEXT=OFFMULT=10.00,ARROWDENSITY=100,OUTPUT=BOTH,UNITS=MM,
                            COMPOSITE=NO,FIT TO DATUMS=YES,DEV PERPEN CENTERLINE=OFF,OUTPUT ALIGNMENT=Datum Reference Frame
                            CUSTOMIZED DRF=NO
                            STANDARDTYPE=ISO_1101
                              SIZE TOLERANCES/1DIAMETER,8,0.05,0.05
                              PRIMARY DIMENSION/POSITION,DIAMETER,0.05,<MC>,A,B,C
                              SECONDARY DIMENSION/,<tol>,<MC>,<dat>,<dat>,<dat>
                              NOTE/DIM DIM D1
                            FEATURES/CIR1,,
                DIM D2= POSITION OF CIRCLE CIR1  UNITS=MM ,$
                GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  FIT TO DATUMS=ON  DEV PERPEN CENTERLINE=OFF  DISPLAY=DIAMETER
                AX       MEAS    NOMINAL       +TOL       -TOL      BONUS        DEV     OUTTOL     DEVANG
                X     -32.005    -32.000                                      -0.005                     
                Y      -0.001      0.000                                      -0.001                     
                DF      8.015      8.000      0.050      0.010                 0.015      0.000            --#---
                TP      0.010        RFS      0.050                 0.000      0.010      0.000   -173.254 -#----
                END OF DIMENSION D2

              Comment


              • #9
                I found "Update theoretical values in while loops" in EDIT/PREFERENCES\SETUP Options window. Maybe is this the options to check it ON, now it is OFF.

                Help says: When you use a while loop to measure features multiple times in your measurement routine, during the execution, the software creates multiple copies of those features. The Update theoretical values in while loops check box updates the theoretical values for the copied features, so that even if the CAD to part coordinate system changes during execution, the features' CAD values are modified so that they are in the original part coordinate frame used before execution.

                Comment


                • louisd
                  louisd commented
                  Editing a comment
                  give it a shot. it won't break anything.
                  in my opinion, you are not using "WHILE" command, you are using "LOOP" command.
                  WHILE is a syntax loop command that's common in other programming languages, there's also (DO) UNTIL, and (DO) IF commands that can be used for loops in other languages. I'm not sure if UNTIL works in pcdmis though.

                • KIRBSTER269
                  KIRBSTER269 commented
                  Editing a comment
                  Are you talking about your X value or your Y value changing in Xact? Like the first piece lets say X is Zero and then lets say your 2nd Part is 4 inches away in X and the value is now 4? Is this what your asking?

              • #10
                Originally posted by mitkos View Post
                I found "Update theoretical values in while loops" in EDIT/PREFERENCES\SETUP Options window. Maybe is this the options to check it ON, now it is OFF.

                Help says: When you use a while loop to measure features multiple times in your measurement routine, during the execution, the software creates multiple copies of those features. The Update theoretical values in while loops check box updates the theoretical values for the copied features, so that even if the CAD to part coordinate system changes during execution, the features' CAD values are modified so that they are in the original part coordinate frame used before execution.
                I remember, many years ago, there was a setting that 'fixed' or made them work, loops that is. That setting you spake of sounds to be the one! Like the Jedis mentioned already, try it - it won't break anything.

                "Reset global settings when branching" might be another one to play around with in conjunction.
                Last edited by Kp61dude!; 08-08-2019, 05:41 PM.
                PcDmis 2015.1 SP10 CAD++
                Global 7-10-7 DC800S

                Comment


                • mckenzie
                  mckenzie commented
                  Editing a comment
                  I think the branching setting affects unmarked probe tip changes and the like

                  https://www.pcdmisforum.com/forum/pc...ed-tip-changes

                  also might try making sure "Treat Theos as if stored in part coordinates" is unchecked
                  Last edited by mckenzie; 08-08-2019, 05:57 PM.

                • Kp61dude!
                  Kp61dude! commented
                  Editing a comment
                  Ah that might be the one I was trying to remember instead ^^^ and branching affects a couple things.. take a gander on your PcDmis help files.

              • #11
                The problem is Y value. First piece is 0 (OK), second piece is 16 (the shift between pieces) should be 0 too. A lot of suggestions, i will try it out.

                Comment


                • #12
                  Okay when Looping parts and you have them spaced lets say 4 inches away from each other, really don't matter, and you're using Xact, whatever you're calling back to you have to do this. Let's say a particular circle is Datum B. I'm not going to look at your whole program you displayed, This particular circle I called DATUM_B. Make sure you SHOWNOMS so you can see your X,Y, and Z NOM in your position callout. I don't have my Z shown, well because I don't want to, anyways, What this does is it recalls my circle that I named DATUM_B, The "T" is THEO and "X", well if I have to explain X we have other problems. All in all, this will lock it down. so you can run your loop and everything goes back to 0. Good luck

                  Code:
                  DATUM_B      =FEAT/CONTACT/CIRCLE/ADAPTIVE_CIRCLE_SCAN,CARTESIAN,IN,LEAST_SQR
                              THEO/<0.25,0.7,0>,<0,0,1>,0.12
                              ACTL/<0.2512,0.7004,0>,<0,0,1>,0.1207
                              TARG/<0.25,0.7,0>,<0,0,1>
                              START ANG=0,END ANG=1000
                              ANGLE VEC=<1,0,0>
                              DIRECTION=CCW
                              SHOW FEATURE PARAMETERS=NO
                              SHOW CONTACT PARAMETERS=NO
                  Code:
                  FCFLOC4 =POSITION : CIR16
                              FEATCTRLFRAME/SHOWNOMS=YES,SHOWPARAMS=NO,SHOWEXPANDED=NO
                                SIZE TOLERANCES/1DIAMETER,0.0469,0.003,0
                                PRIMARY DIMENSION/POSITION,DIAMETER,0.014, ,A,B,C
                                NOTE/FCFLOC4
                              FEATURES/CIR16,,
                              CIR16
                               X:NOM=DATUM_B.TX
                               Y:NOM=DATUM_B.TY
                  Since you said the problem is "Y" than you would do that to the "Y:NOM", but technically, you do want to reset your Axis on all. This can be tricky, if things are not aligned correctly.
                  Last edited by KIRBSTER269; 08-09-2019, 10:05 AM.
                  (In Memory of my Loving wife, "Ronda" who I lost March 7, 2016. I love you baby.)
                  They say "Nobody's Perfect." I must be Nobody.

                  Comment


                  • #13
                    Thanks for posting Mitkos. Very interested in this post! I've got my own looping nightmare with nearly 100 programs I may have to scrap if I can't figure it out. Tech support couldn't figure it out either 6 years ago and after a while closed my ticket out. Anyway... I won't highjack this post. But, it looks like you guys might be able to help me figure out my problem. When I get more time I'll create my own post. Until then I'm going to sprinkle some questions in throughout this one.
                    Mike

                    Comment

                    Related Topics

                    Collapse

                    Working...
                    X