Code to mark/unmark out of tolerance dimensions

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

  • Code to mark/unmark out of tolerance dimensions

    I am trying to figure out a way to automatically mark or unmark feature dimensions that are out of tolerance.
    I have a program that includes some if/then statements where it re-measures a diameter at a different depth if the first one is OOT.
    So my problem is that in the reporting portion of the program, I want the program to only reflect the in tolerance measurement and not the failed measurements.

    I can post the code if it helps.
    I am slightly familiar with using vb scripts.



  • #2
    I haven't tested this, but I would trap it at the feature and do an immediate remeasure.

    Code:
    ASSIGN/MDEPTH=.125
    REMEAS1    =LABEL/
    CIR1       =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                THEO/<-1.0273,0.95,-0.5218>,<0,0,-1>,0.776
                ACTL/<-1.0273,0.95,-0.5218>,<0,0,-1>,0.78
                TARG/<-1.0273,0.95,-0.5218>,<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=7,DEPTH=MDEPTH,PITCH=0
                  SAMPLE METHOD=SAMPLE_HITS
                  SAMPLE HITS=3,SPACER=0
                  AVOIDANCE MOVE=NO,DISTANCE=0.3937
                  FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
                SHOW HITS=NO
                IF/ABS(CIR1.D-CIR1.TD)>.005
                IF_GOTO/MDEPTH==.375,GOTO = SKIP1
                ASSIGN/MDEPTH=.375
                GOTO/REMEAS1
                END_IF/
    SKIP1      =LABEL/

    Comment


    • #3
      Thanks that is probably the better way to go about it in that particular situation.

      Maybe in my proham I am looking at it in the wrong way. The first two dimensions in the code output are set to "STATS". At the end of the program the dimension code output is set to "REPORT". My problem is that I want to hide the out of tolerance dimension at the end and display the recheck or vice versa.

      I'll show you the code to help.


      CABLEFACE1 =FEAT/PLANE,CARTESIAN,TRIANGLE
      THEO/<-10.417,112.878,-10.121>,<0.9394455,-0.2160752,-0.2659955>
      ACTL/<-10.115,112.825,-10.206>,<0.9361055,-0.231182,-0.2650686>
      MEAS/PLANE,6
      HIT/BASIC,NORMAL,<-1.71,133.11,4.197>,<0.9394455,-0.2160752,-0.2659955>,<-1.14,132.993,4.034>,USE THEO=YES
      HIT/BASIC,NORMAL,<-2.057,122.079,11.934>,<0.9394455,-0.2160752,-0.2659955>,<-1.595,121.991,11.804>,USE THEO=YES
      HIT/BASIC,NORMAL,<-10.97,106.679,-7.036>,<0.9394455,-0.2160752,-0.2659955>,<-10.751,106.645,-7.095>,USE THEO=YES
      HIT/BASIC,NORMAL,<-11.107,116.591,-15.573>,<0.9394455,-0.2160752,-0.2659955>,<-10.731,116.521,-15.681>,USE THEO=YES
      HIT/BASIC,NORMAL,<-18.462,105.472,-32.518>,<0.9394455,-0.2160752,-0.2659955>,<-18.261,105.441,-32.578>,USE THEO=YES
      HIT/BASIC,NORMAL,<-18.198,93.338,-21.728>,<0.9394455,-0.2160752,-0.2659955>,<-18.214,93.358,-21.721>,USE THEO=YES
      ENDMEAS/

      CABPROF1 =SURFACE PROFILE : CABLEFACE1
      FEATCTRLFRAME/SHOWPARAMS=YES,SHOWEXPANDED=YES
      CADGRAPH=OFF,REPORTGRAPH=OFF,TEXT=OFF,MULT=0.00,AR ROWDENSITY=100,OUTPUT=STATS,UNITS=MM
      COMPOSITE=NO,
      CUSTOMIZED DRF=NO
      STANDARDTYPE=ASME_Y14_5
      PRIMARY DIMENSION/PROFILE OF SURFACE,1,<UZ>,<UTol>,A,B,C,<MC>
      NOTE/CABPROF1
      FEATURES/CABLEFACE1,,

      IF/CABPROF1.OUTTOL>0
      GOTO/FAIL6
      END_IF/
      IF/CABPROF1.OUTTOL<1
      GOTO/PASS6
      END_IF/

      FAIL6 =LABEL/

      CABLEFACE2 =FEAT/PLANE,CARTESIAN,TRIANGLE
      THEO/<-5.1,120.672,2.327>,<0.9394455,-0.2160752,-0.2659955>
      ACTL/<-5.79,119.756,2.252>,<0.9377972,-0.2261805,-0.2633987>
      MEAS/PLANE,3
      HIT/BASIC,NORMAL,<-2.118,131.739,3.87>,<0.9394455,-0.2160752,-0.2659955>,<-2.704,130.801,3.757>,USE THEO=YES
      HIT/BASIC,NORMAL,<-2.72,117.958,12.94>,<0.9394455,-0.2160752,-0.2659955>,<-3.454,117.066,12.877>,USE THEO=YES
      HIT/BASIC,NORMAL,<-10.464,112.317,-9.829>,<0.9394455,-0.2160752,-0.2659955>,<-11.212,111.401,-9.879>,USE THEO=YES
      ENDMEAS/

      PASS6 =LABEL/

      QCI #7 =SURFACE PROFILE : CABLEFACE1
      FEATCTRLFRAME/SHOWPARAMS=YES,SHOWEXPANDED=YES
      CADGRAPH=BOTH,REPORTGRAPH=OFF,TEXT=OFF,MULT=10.00, ARROWDENSITY=100,OUTPUT=BOTH,UNITS=MM
      COMPOSITE=NO,
      CUSTOMIZED DRF=NO
      STANDARDTYPE=ASME_Y14_5
      PRIMARY DIMENSION/PROFILE OF SURFACE,1,<UZ>,<UTol>,A,B,C
      NOTE/QCI #7
      FEATURES/CABLEFACE1,,

      QCI #7 - RECHECK =SURFACE PROFILE : CABLEFACE2
      FEATCTRLFRAME/SHOWPARAMS=YES,SHOWEXPANDED=YES
      CADGRAPH=BOTH,REPORTGRAPH=OFF,TEXT=OFF,MULT=10.00, ARROWDENSITY=100,OUTPUT=BOTH,UNITS=MM
      COMPOSITE=NO,
      CUSTOMIZED DRF=NO
      STANDARDTYPE=ASME_Y14_5
      PRIMARY DIMENSION/PROFILE OF SURFACE,1,<UZ>,<UTol>,A,B,C
      NOTE/QCI #7 - RECH2 - RECH2
      FEATURES/CABLEFACE2,

      Comment


      • #4
        If you loop feature and the dimension, wouldn't it update to the latest measurement, e.g. the recheck?
        Last edited by InspectorJester; 07-16-2018, 02:06 PM. Reason: "...feature and..."

        Comment


        • #5
          I can try that.

          When I execute the program it typically shows every dimension in the code viewing the report whether or not it was skipped

          Comment


          • #6
            But does it print with those dimensions or the updated ones?

            Comment


            • #7
              When I view the report and hit the "View Last Exectued" button it hides the recheck dimension if I put it inside the loop. That seems to work for me.

              The next thing I'll have to figure out how to format my report to be in the correct order again.

              Comment


              • #8
                The best way to achieve that is to flush the report & have your dimensions at the bottom
                (That's how I do it anyway)

                Comment


                • #9
                  Originally posted by CodeWarrior View Post
                  I am trying to figure out a way to automatically mark or unmark feature dimensions that are out of tolerance.
                  I have a program that includes some if/then statements where it re-measures a diameter at a different depth if the first one is OOT.
                  So my problem is that in the reporting portion of the program, I want the program to only reflect the in tolerance measurement and not the failed measurements.

                  I can post the code if it helps.
                  I am slightly familiar with using vb scripts.


                  I'm sure you know but if it measures out of tolerance at any depth it's out of tolerance right?
                  Automettech - Automated Metrology Technology

                  Comment


                  • CodeWarrior
                    CodeWarrior commented
                    Editing a comment
                    Yes, I was using that as a basic example. Typically in my situation, I will have a datum plane with target diameters of where to pick it up and it has a profile dimension. Due to the parts having some variance with welds and other things, I will have it measure in different spots in the target zones to achieve a good result which the customer is ok with. I just want to clean the report up for the operators and engineers so it doesn't show the bad initial reading or the rechecks if they weren't exectuted

                  • InspectorJester
                    InspectorJester commented
                    Editing a comment
                    Are you able to just take manual hits for those features and do away with that entirely?
                    EDIT:
                    Maybe take a manual point on where to start and DCC from there, or something, I mean

                • #10
                  Create 2 dimensions for the same feature. LOC1 and LOC1_OOT.
                  change the output from REPORT to NONE or STATS on the first LOC1.
                  then use a if/end if with a comment ( the comment being the second dimension LOC1_OOT) with output to REPORT.

                  Now when you measure the feature, if its in tolerance, it will not be reported but it will send stats. If its OOT, it will display the second dimension on the report notifying the operator of the out of tolerance condition.

                  Only shows if the out of tolerance is greater than zero.

                  Code:
                  DIM LOC1= LOCATION OF CIRCLE CIR1  UNITS=MM ,$
                  GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=STATS  HALF ANGLE=NO
                  AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL
                  D       30.000      0.051      0.051     30.000      0.000      0.000 ----#----
                  END OF DIMENSION LOC1
                              IF/LOC1.D.OUTTOL>0
                    DIM LOC1_OOT= LOCATION OF CIRCLE CIR1  UNITS=MM ,$
                    GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
                    AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL
                    D       30.000      0.051      0.051     30.000      0.000      0.000 ----#----
                    END OF DIMENSION LOC1_OOT
                              END_IF/
                  Last edited by acgarcia; 07-18-2018, 12:12 PM.

                  Comment


                  • acgarcia
                    acgarcia commented
                    Editing a comment
                    I did this for a while until we decided that if they are not critical, don't check them as often or not at all. So all I check now are just critical dimensions. There was some comments on another thread about why remeasure the feature again. Would the second check be more accurate? If so, why not measure it like that from the beginning? Which kind of takes you back to square 1.

                • #11
                  acgarcia Yeah I'm gonna try that right now.

                  In my post in the above comment, i tried to explain a little bit of my particular problem.

                  My main thing is to have it all be in dcc and not manually controlled.

                  I can go through a finished program myself and revise the report as I need; its just i wont be able to do that as much in the future with operators running my programs.

                  Comment


                  • #12
                    I tried this and it works fine for me so far.

                    PROF1 =SURFACE PROFILE : CABLEFACE1
                    FEATCTRLFRAME/SHOWPARAMS=YES,SHOWEXPANDED=YES
                    CADGRAPH=OFF,REPORTGRAPH=OFF,TEXT=OFF,MULT=0.00,AR ROWDENSITY=100,OUTPUT=STATS,UNITS=MM
                    COMPOSITE=NO,
                    CUSTOMIZED DRF=NO
                    STANDARDTYPE=ASME_Y14_5
                    PRIMARY DIMENSION/PROFILE OF SURFACE,1,<UZ>,<UTol>,A,B,C,<MC>
                    NOTE/PROF1
                    FEATURES/CABLEFACE1,,

                    IF/PROF1.OUTTOL > 0
                    GOTO/DIMREC
                    END_IF/

                    QCI1 =LABEL/

                    QCI7 =SURFACE PROFILE : CABLEFACE1
                    FEATCTRLFRAME/SHOWPARAMS=YES,SHOWEXPANDED=YES
                    CADGRAPH=BOTH,REPORTGRAPH=OFF,TEXT=OFF,MULT=10.00, ARROWDENSITY=100,OUTPUT=BOTH,UNITS=MM
                    COMPOSITE=NO,
                    CUSTOMIZED DRF=NO
                    STANDARDTYPE=ASME_Y14_5
                    PRIMARY DIMENSION/PROFILE OF SURFACE,1,<UZ>,<UTol>,A,B,C
                    NOTE/QCI7
                    FEATURES/CABLEFACE1,,

                    DIMREC =LABEL/

                    IF/QCI7.OUTTOL < 1
                    GOTO/QCIPASS
                    END_IF/

                    QCIPASS =LABEL/

                    Comment


                    • #13
                      Originally posted by CodeWarrior View Post
                      I tried this and it works fine for me so far.
                      Code:
                      PROF1 =SURFACE PROFILE : CABLEFACE1
                      FEATCTRLFRAME/SHOWPARAMS=YES,SHOWEXPANDED=YES
                      CADGRAPH=OFF,REPORTGRAPH=OFF,TEXT=OFF,MULT=0.00,ARROWDENSITY=100,OUTPUT=STATS,UNITS=MM
                      COMPOSITE=NO,
                      CUSTOMIZED DRF=NO
                      STANDARDTYPE=ASME_Y14_5
                      PRIMARY DIMENSION/PROFILE OF SURFACE,1,<UZ>,<UTol>,A,B,C,<MC>
                      NOTE/PROF1
                      FEATURES/CABLEFACE1,,
                      
                      IF/PROF1.OUTTOL > 0
                      GOTO/DIMREC
                      END_IF/
                      
                      QCI1 =LABEL/
                      
                      QCI7 =SURFACE PROFILE : CABLEFACE1
                      FEATCTRLFRAME/SHOWPARAMS=YES,SHOWEXPANDED=YES
                      CADGRAPH=BOTH,REPORTGRAPH=OFF,TEXT=OFF,MULT=10.00,ARROWDENSITY=100,OUTPUT=BOTH,UNITS=MM
                      COMPOSITE=NO,
                      CUSTOMIZED DRF=NO
                      STANDARDTYPE=ASME_Y14_5
                      PRIMARY DIMENSION/PROFILE OF SURFACE,1,<UZ>,<UTol>,A,B,C
                      NOTE/QCI7
                      FEATURES/CABLEFACE1,,
                      
                      DIMREC =LABEL/
                      
                      IF/QCI7.OUTTOL < 1
                      GOTO/QCIPASS
                      END_IF/
                      
                      QCIPASS =LABEL/
                      Code:
                      
                      
                      this is kind of what I was talking about. I'm not familiar with profiles so i'm not sure what this MULT is but why measure it with 0.0 and if it fails, measure it again with MULT at 10.00? Why not start with 10.00 from the get go? Just trying to understand and learn.

                      Also, when posting code, type [cod*e] on your first line, second line paste your code and last line [/cod*e] and it will appear much neater for others to read. Leave out the * in the words code.

                      Comment


                      • #14
                        If I understood you correctly:

                        Code:
                        CIR5       =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                                    THEO/<4.8819,1.9685,0>,<0,0,1>,2.3819
                                    ACTL/<4.8819,1.9685,0>,<0,0,1>,2.3819
                                    TARG/<4.8819,1.9685,0>,<0,0,1>
                                    START ANG=0,END ANG=360
                                    ANGLE VEC=<1,0,0>
                                    DIRECTION=CW
                                    SHOW FEATURE PARAMETERS=NO
                                    SHOW CONTACT PARAMETERS=YES
                                      NUMHITS=3,DEPTH=-0.14,PITCH=0
                                      SAMPLE METHOD=SAMPLE_HITS
                                      SAMPLE HITS=0,SPACER=0
                                      AVOIDANCE MOVE=NO,DISTANCE=0.3937
                                      FIND HOLE=NOCENTER,ONERROR=NO,READ POS=NO
                                    SHOW HITS=NO
                                    ASSIGN/IOFLAG1="BOTH"
                                    IF/CIR5.D > 2.380 OR CIR5.D < 2.375
                                      ASSIGN/IOFLAG1="NONE"
                                    END_IF/
                        DIM D1= LOCATION OF CIRCLE CIR5  UNITS=IN ,$
                        GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=IOFLAG1  HALF ANGLE=NO
                        AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL
                        D       2.3875     0.0025     0.0025     2.3819    -0.0056     0.0031 <--------
                        END OF DIMENSION D1
                        PcDmis 2015.1 SP10 CAD++
                        Global 7-10-7 DC800S

                        Comment


                        • davehocum
                          davehocum commented
                          Editing a comment
                          Question? How can you change the Output to Assign value?
                          I figured it out "Space bar"
                          Last edited by davehocum; 07-19-2018, 07:52 AM.

                        • Kp61dude!
                          Kp61dude! commented
                          Editing a comment
                          It's weird to 'write' in there. I tab into it and type carefully, any mistake and you'd have to start all over. It doesn't accept spaces or backspaces and stuff. Play around with it. Make sure you have an ASSIGNMENT ready with "BOTH", "REPORT", "NONE", etc. and don't just type anything in there.
                          Last edited by Kp61dude!; 07-19-2018, 09:22 AM.

                      • #15
                        Kp61dude! Yeah thats exactly what I was trying to do, thanks for the help on this. Really liking the forum

                        Comment


                        • Kp61dude!
                          Kp61dude! commented
                          Editing a comment
                          Glad I could help and welcome!

                      Related Topics

                      Collapse

                      Working...
                      X