hexagon logo

Onerror

I am trying to use the ONERROR (edge not detected) command allow the CMM to locate a part fixtured on a mandrel. It is a part we have to measure with the zoom lens. I would like for it to first look at specific coordinates, then subtract .5mm each time it misses. I'm getting no where. I've done something similar before in Level 3 training, but that was several years ago. I'm on PCDMIS 2012 MR1 and an Optive Performance. Any ideas?

Thanks!
Parents
  • Excellent question! Please hold while I draft a response

    EDIT:
    I have an Optiv Performance 1z443 with the Zoom lens you describe (fun!)
    Basically I'd recommend this:

                            ASSIGN/NUM_RETRIES=3
                            ASSIGN/VCOUNTER=0
                            ASSIGN/V2=<Start value for feature>
    LBL_RETRY   =LABEL/
                            ASSIGN/IS_FAILED=0
                            ONERROR/EDGE_NOT_DETECTED,SET IS_FAILED
    

    Place this right before your feature.
    What this does is set a variable, IS_FAILED, to 1, if the Edge is not detected.
    Below the feature, you would have this
    ONERROR/EDGE_NOT_DETECTED,OFF
    IF/IS_FAILED
    ASSIGN/VCOUNTER=VCOUNTER+1
    IF/VCOUNTER=NUM_RETRIES
    COMMENT/OPER...
    Focus failed 3 times. Exiting...
    PROGRAM/END
    END_IF
    ASSIGN/V2=V2-5
    GOTO/LBL_RETRY
    END_IF
    ASSIGN/VCOUNTER=0
    ASSIGN/IS_FAILED=0
    


    And you would use the variable V2 in your feature, which gets subtracted by 5 each time the feature fails to get focus.

    EDIT 2:
    If the feature fails to get focus after 3 retries (defined by the NUM_RETRIES variable), it will simply end the program. If the feature gets focus the first time, last time, or any time in between, it will simply move on to the next feature.

    I had to do something similar where I had a part that the rotational alignment for our rotary was defined by that would be on either the top or the bottom of the part. It would focus, and if it failed it would rotate the part 180° and try again. When I used Matching edge, it basically checked if a hole was there or not.

    It should work in the way you're looking for, however.
Reply
  • Excellent question! Please hold while I draft a response

    EDIT:
    I have an Optiv Performance 1z443 with the Zoom lens you describe (fun!)
    Basically I'd recommend this:

                            ASSIGN/NUM_RETRIES=3
                            ASSIGN/VCOUNTER=0
                            ASSIGN/V2=<Start value for feature>
    LBL_RETRY   =LABEL/
                            ASSIGN/IS_FAILED=0
                            ONERROR/EDGE_NOT_DETECTED,SET IS_FAILED
    

    Place this right before your feature.
    What this does is set a variable, IS_FAILED, to 1, if the Edge is not detected.
    Below the feature, you would have this
    ONERROR/EDGE_NOT_DETECTED,OFF
    IF/IS_FAILED
    ASSIGN/VCOUNTER=VCOUNTER+1
    IF/VCOUNTER=NUM_RETRIES
    COMMENT/OPER...
    Focus failed 3 times. Exiting...
    PROGRAM/END
    END_IF
    ASSIGN/V2=V2-5
    GOTO/LBL_RETRY
    END_IF
    ASSIGN/VCOUNTER=0
    ASSIGN/IS_FAILED=0
    


    And you would use the variable V2 in your feature, which gets subtracted by 5 each time the feature fails to get focus.

    EDIT 2:
    If the feature fails to get focus after 3 retries (defined by the NUM_RETRIES variable), it will simply end the program. If the feature gets focus the first time, last time, or any time in between, it will simply move on to the next feature.

    I had to do something similar where I had a part that the rotational alignment for our rotary was defined by that would be on either the top or the bottom of the part. It would focus, and if it failed it would rotate the part 180° and try again. When I used Matching edge, it basically checked if a hole was there or not.

    It should work in the way you're looking for, however.
Children