Program help...

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

  • Program help...

    Ok Ladies & Gents, I need to add a simple variable to my program but have no idea how to achieve this. I need to compare an angle to Datum A on an Assembly. The angle must be within +/- 0.5°. I would like to be able to keep adjusting and measuring the angle (Its a hinge) until it is within 16.67° +/- 0.5°. I would be forever grateful if somebody could tell me how to achieve this (In laymans terms ;o).

    Cheers,




    F.
    Recently jumped from 3.5 Mr 2 CAD
    to 2012 CAD++

  • #2
    Use a COMMENT/YESNO and IFGOTO along with a label.

    I'll post an example when I get to my cmm.
    When in doubt, post code. A second set of eyes might see something you missed.
    sigpic

    Comment


    • #3
      Have you tried a loop with a IF type statement? CraigerNY (booger-boy) can probably tell you in 3 lines how to do this, he is one of the CODERS in Pcdmis.
      sigpic
      Originally posted by AndersI
      I've got one from September 2006 (bug ticket) which has finally been fixed in 2013.

      Comment


      • #4
        How do you mean you would like to adjust? Do you wish to simply remeasure the part utilizing the same point locations or would you like to stop and use a different part, or add more hit points and remeasure?

        Based on your answer, the solution can vary. I have a couple of variables written that I use quite often, perhaps I can help although Craiger is more well versed than I.
        DCCFreak

        Comment


        • #5
          Here is an example of what I do to skip a manual alignment. I use it while I'm writing a program and I know the part hasn't been moved. You'd need the label to be above the section you want to remeasure after adjusting the hinge. A different line of thought, have a machinist make you a block at the angle you need and "set" each part to that.

          C1 =COMMENT/YESNO,Run manual alignment?
          IF_GOTO/C1.INPUT=="NO",GOTO = L1
          F1M =FEAT/PLANE,RECT
          THEO/9.4691,-16.011,-19.032,0.0002671,-0.0000705,1
          ACTL/9.4948,-16.0018,-19.0319,0.0001565,-0.000089,1
          MEAS/PLANE,3
          ENDMEAS/
          F2M =FEAT/CIRCLE,RECT,IN,LEAST_SQR
          THEO/4.362,-16.9143,-18.9766,0,0,1,0.2264
          ACTL/4.4095,-16.7094,-18.9715,0,0,1,0.2269
          MEAS/CIRCLE,4,WORKPLANE
          ENDMEAS/
          F3M =FEAT/CIRCLE,RECT,IN,LEAST_SQR
          THEO/14.5179,-16.8357,-18.987,0,0,1,0.2266
          ACTL/14.5584,-17.0816,-18.9742,0,0,1,0.2285
          MEAS/CIRCLE,4,WORKPLANE
          ENDMEAS/
          F4M =FEAT/LINE,RECT,UNBND
          THEO/4.362,-16.9143,-18.9766,0.99997,0.0077414,0
          ACTL/4.4095,-16.7094,-18.9715,0.9993283,-0.0366455,0
          CONSTR/LINE,BF,2D,F2M,F3M,,
          F5M =FEAT/CIRCLE,RECT,IN,LEAST_SQR
          THEO/9.4428,-16.8766,-18.1729,0,0,1,6.9994
          ACTL/9.4838,-16.8972,-18.1813,0,0,1,6.9996
          MEAS/CIRCLE,8,WORKPLANE
          ENDMEAS/
          A1 =ALIGNMENT/START,RECALL:STARTUP, LIST= YES
          ALIGNMENT/LEVEL,ZPLUS,F1M
          ALIGNMENT/ROTATE,XPLUS,TO,F4M,ABOUT,ZPLUS
          ALIGNMENT/TRANS,XAXIS,F5M
          ALIGNMENT/TRANS,YAXIS,F5M
          ALIGNMENT/TRANS,ZAXIS,F1M
          ALIGNMENT/END
          L1 =LABEL/
          When in doubt, post code. A second set of eyes might see something you missed.
          sigpic

          Comment


          • #6
            What John said about having a block made, or perhaps just buying a set of precision angle blocks and building say 17 or 16.5 degrees with them, that would get you to withing you +/- .5 degree goal. HTH
            sigpic"Hated by Many, Loved by Few" _ A.B. - Stone brewery

            Comment


            • #7
              Sorry, the part is clamped and pivots in the Y axis. I need to measure a plane and if it doesnt measure 16.67 +/- 0.5° then I will need to pivot the part further.
              Recently jumped from 3.5 Mr 2 CAD
              to 2012 CAD++

              Comment


              • #8
                I agree with John on both accounts as far as what you are trying to do. In my mind, it seems that it would be easiest to go the angled block route, but if you feel you need to use some kind of variable the code John supplied should get you pretty close to where you need (with minor mods of course).
                DCCFreak

                Comment


                • #9
                  My idea is:

                  1. Get the block made.
                  2. Set part as close as possible to the actual angle using the block.
                  3. Measure part.
                  4. "Tweak" part closer to nominal. (if neccesary)
                  5. Remeasure using my example above.
                  6. Once in tolerance, answer accordingly and run rest of program.
                  Last edited by John Kingston; 10-10-2006, 09:10 AM.
                  When in doubt, post code. A second set of eyes might see something you missed.
                  sigpic

                  Comment


                  • #10
                    Originally posted by Farmer
                    Sorry, the part is clamped and pivots in the Y axis. I need to measure a plane and if it doesnt measure 16.67 +/- 0.5° then I will need to pivot the part further.
                    Here is what I’d do (exactly what John suggested):

                    Code:
                    DO_OVER    =LABEL/
                    .
                    .(measure the feature in question here)
                    .(assign a variable to the angle value being evaluated, I called it THE_ANGLE)
                    .
                                ASSIGN/THE_ANGLE = DIM_ANGLE.A.MEAS
                                IF/THE_ANGLE < 16.17 OR THE_ANGLE > 17.17
                                GOTO/DO_OVER
                                END_IF/
                    .
                    .(continue with your program)
                    .
                    Put the label before the feature that needs to be remeasured. You will need to be mindful of any movepoints to get you from where you are to where you need to be to remeasure it. Perhaps clearplane is best, that is up to you.

                    Craig

                    Originally posted by Matthew D. Hoedeman
                    Have you tried a loop with a IF type statement? CraigerNY (booger-boy) can probably tell you in 3 lines how to do this, he is one of the CODERS in Pcdmis.
                    I tried but it ended up being 5 lines. I suppose it could be cut down to 4 like so:

                    Code:
                    DO_OVER    =LABEL/
                    .
                    .(measure the feature in question here)
                    .(assign a variable to the angle value being evaluated, I called it THE_ANGLE)
                    .
                                IF/ DIM_ANGLE.A.MEAS < 16.17 OR DIM_ANGLE.A.MEAS > 17.17
                                GOTO/DO_OVER
                                END_IF/
                    .
                    .(continue with your program)
                    .
                    But 3 lines, I can’t do.

                    Craig
                    <internet bumper sticker goes here>

                    Comment


                    • #11
                      Originally posted by craiger_ny
                      Here is what I’d do (exactly what John suggested):

                      Code:
                      DO_OVER    =LABEL/
                      .
                      .(measure the feature in question here)
                      .(assign a variable to the angle value being evaluated, I called it THE_ANGLE)
                      .
                                  ASSIGN/THE_ANGLE = DIM_ANGLE.A.MEAS
                                  IF/THE_ANGLE < 16.17 OR THE_ANGLE > 17.17
                                  GOTO/DO_OVER
                                  END_IF/
                      .
                      .(continue with your program)
                      .
                      Put the label before the feature that needs to be remeasured. You will need to be mindful of any movepoints to get you from where you are to where you need to be to remeasure it. Perhaps clearplane is best, that is up to you.

                      Craig



                      I tried but it ended up being 5 lines. I suppose it could be cut down to 4 like so:

                      Code:
                      DO_OVER    =LABEL/
                      .
                      .(measure the feature in question here)
                      .(assign a variable to the angle value being evaluated, I called it THE_ANGLE)
                      .
                                  IF/ DIM_ANGLE.A.MEAS < 16.17 OR DIM_ANGLE.A.MEAS > 17.17
                                  GOTO/DO_OVER
                                  END_IF/
                      .
                      .(continue with your program)
                      .
                      But 3 lines, I can’t do.

                      Craig

                      DUDE! I am SOOOOOO disappointed! I figured SURE as anything you could do it in 3 lines!

                      Ugh, I guess I'll have to re-order everything in my universe now.
                      sigpic
                      Originally posted by AndersI
                      I've got one from September 2006 (bug ticket) which has finally been fixed in 2013.

                      Comment


                      • #12
                        16.67°.JPGJohn et al, thanks for the advice - the block is being made. My problem is I havent used labels & if/goto before (at least not with DMIS). How would the code look for "If datum D (compared to datum A) is greater or less than 16.67 +/- 0.5° then tweak and remeasure".
                        I have attached a drg so you can see what Im talking about (willis ;o).
                        Sorry for being a pain. Im eager to learn though.
                        Recently jumped from 3.5 Mr 2 CAD
                        to 2012 CAD++

                        Comment


                        • #13
                          Please correct me if I am wrong, but it sounds like what you are in need of is a adjustable angle block. So that when you do get a measurment that is within tolerance then and only then will the program continue on.

                          Comment


                          • #14
                            Use the code I showed you but before the GOTO line put a comment telling the operator to reposition the part. You could even get fancy and tell the operator what the angle is and which way to adjust it by setting a couple more variables. We are going way over Matt's 3 lines of code challenge though.

                            Craig
                            <internet bumper sticker goes here>

                            Comment


                            • #15
                              Errrr...

                              Craiger - how do I assign a variable to a dim?

                              BTW - Thanks for your time.
                              Recently jumped from 3.5 Mr 2 CAD
                              to 2012 CAD++

                              Comment

                              Related Topics

                              Collapse

                              Working...
                              X