Prehit/Retract in a loop

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

  • Prehit/Retract in a loop

    Hi.

    I have a program that is looping. On the first loop I need the prehit/retract to be of at least 10mm. On subsequent loops I need the prehit/retract to go down to 2mm.
    Can anybody hhelp? My efforts don't seem to be working?

    Thnks.
    Bristol Citysigpic
    Home of the Reds

  • #2
    I've never used a variable to set prehit and retract but it would be worth trying.
    <internet bumper sticker goes here>

    Comment


    • #3
      If you are running a program that you switch parts between loops use an if/end control to establish the prehit/retract.
      Kevin

      Comment


      • #4
        STARTUP =ALIGNMENT/START,RECALL:, LIST= YES
        ALIGNMENT/END
        MODE/MANUAL
        PREHIT/ 5
        RETRACT/ 5
        LOADPROBE/TP20X4X40
        TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=90
        FORMAT/TEXT,OPTIONS,HEADINGS, , ;NOM,TOL,MEAS,DEV,OUTTOL,
        PREHIT/ 10
        RETRACT/ 10
        V1 =LOOP/START, ID = YES, NUMBER = 0, START = 1, SKIP = ,
        OFFSET: XAXIS = 0, YAXIS = 0, ZAXIS = 0, ANGLE = 0
        CIR1 =AUTO/CIRCLE, SHOWHITS=NO, SHOWALLPARAMS=YES
        THEO/0,0,0,0,0,1,6
        ACTL/0,0,0,0,0,1,6
        TARG/0,0,0,0,0,1
        THEO_THICKNESS = 0, RECT, IN, STRAIGHT, LEAST_SQR ,$
        AUTO MOVE = NO, DISTANCE = 0, RMEAS = None, READ POS = NO, FIND HOLE = NO, REMEASURE = NO ,$
        NUMHITS = 4, INIT = 0, PERM = 0, SPACER = 0, PITCH = 0 ,$
        START ANG = 0, END ANG = 360, DEPTH = 0 ,$
        ANGLE VEC = 1,0,0
        CIR2 =AUTO/CIRCLE, SHOWHITS=NO, SHOWALLPARAMS=YES
        THEO/0,0,0,0,0,1,6
        ACTL/0,0,0,0,0,1,6
        TARG/0,0,0,0,0,1
        THEO_THICKNESS = 0, RECT, IN, STRAIGHT, LEAST_SQR ,$
        AUTO MOVE = NO, DISTANCE = 0, RMEAS = None, READ POS = NO, FIND HOLE = NO, REMEASURE = NO ,$
        NUMHITS = 4, INIT = 0, PERM = 0, SPACER = 0, PITCH = 0 ,$
        START ANG = 0, END ANG = 360, DEPTH = 0 ,$
        ANGLE VEC = 1,0,0
        CIR3 =AUTO/CIRCLE, SHOWHITS=NO, SHOWALLPARAMS=YES
        THEO/0,0,0,0,0,1,6
        ACTL/0,0,0,0,0,1,6
        TARG/0,0,0,0,0,1
        THEO_THICKNESS = 0, RECT, IN, STRAIGHT, LEAST_SQR ,$
        AUTO MOVE = NO, DISTANCE = 0, RMEAS = None, READ POS = NO, FIND HOLE = NO, REMEASURE = NO ,$
        NUMHITS = 4, INIT = 0, PERM = 0, SPACER = 0, PITCH = 0 ,$
        START ANG = 0, END ANG = 360, DEPTH = 0 ,$
        ANGLE VEC = 1,0,0
        C1 =COMMENT/YESNO,Do you want to use the 2mm prehit/retract
        IF/C1.INPUT=="YES"
        PREHIT/ 2
        RETRACT/ 2
        END_IF/
        Kevin

        Comment


        • #5
          This is the coding I am using:-

          assign/count = 0

          loop = label/
          if/count==0
          prehit/20
          retract/20
          end_if/
          else/
          prehit/2
          retract/2
          end_else

          comment/oper,no, count
          assign/count = count+1
          goto/loop


          This doesn't work
          is it the prehit/retract command, do I have to assign them to a variable?


          Many thanks
          Bristol Citysigpic
          Home of the Reds

          Comment


          • #6
            No kmcmm.

            I have one part that loops about 5 times, I need a big prehit for the first loop, to find the job, then once the alignment is closer I can speed it up with a smaller prehit.

            Thanks.
            Bristol Citysigpic
            Home of the Reds

            Comment


            • #7
              I just tried this and it worked so apparently you can use a variable:

              Code:
                          ASSIGN/PREHIT_VAR = 0.1
              FEATURE_LOOP=LOOP/START, ID = YES, NUMBER = 3, START = 1, SKIP = ,
                             OFFSET: XAXIS = 0, YAXIS = 0, ZAXIS = 0, ANGLE = 0
                          PREHIT/ PREHIT_VAR
                          RETRACT/ PREHIT_VAR
              PNT1       =FEAT/POINT,RECT
                          THEO/-0.1638,1.0253,-14.505,0,0,1
                          ACTL/-0.1638,1.0254,-14.505,0,0,1
                          MEAS/POINT,1
                          HIT/BASIC,-0.1638,1.0253,-14.505,0,0,1,-0.1638,1.0254,-14.505
                          ENDMEAS/
                          ASSIGN/PREHIT_VAR = PREHIT_VAR + 0.1
                          LOOP/END
              <internet bumper sticker goes here>

              Comment


              • #8
                I think the picture might explain a little better.
                Thanks for that Craiger, but what you have done only increments the prehit, I need a 1 off reduction in the prehit, from 8 to 2 that will stay at two for the remaining loops.

                Thanks.
                Attached Files
                Bristol Citysigpic
                Home of the Reds

                Comment


                • #9
                  Then instead of incrementing it set it to what you want it to be. I only post that to show it recognizes a variable.

                  Code:
                              ASSIGN/PREHIT_VAR = 8
                  FEATURE_LOOP=LOOP/START, ID = YES, NUMBER = 3, START = 1, SKIP = ,
                                 OFFSET: XAXIS = 0, YAXIS = 0, ZAXIS = 0, ANGLE = 0
                              PREHIT/ PREHIT_VAR
                              RETRACT/ PREHIT_VAR
                  PNT1       =FEAT/POINT,RECT
                              THEO/-0.1638,1.0253,-14.505,0,0,1
                              ACTL/-0.1638,1.0254,-14.505,0,0,1
                              MEAS/POINT,1
                              HIT/BASIC,-0.1638,1.0253,-14.505,0,0,1,-0.1638,1.0254,-14.505
                              ENDMEAS/
                              ASSIGN/PREHIT_VAR = 2
                              LOOP/END
                  <internet bumper sticker goes here>

                  Comment


                  • #10
                    Thanks Craiger, #
                    I can see how to do it now, thanks.
                    My problem was that I am in a couple of loops.
                    Bristol Citysigpic
                    Home of the Reds

                    Comment


                    • #11
                      Can you actually start a variable at 0 (zero)?

                      Comment

                      Related Topics

                      Collapse

                      Working...
                      X