hexagon logo

Error Handling option coding


Hi guys, its been a while ! Need some help....I have the basics down for error handling and have code for one option, part of level 3 pc-dmis training....but want to go one step more....


So, if I wanted it to do something else, rather than increment around 22.5 degrees....then what ?

Lets say I wanted it to flag the operator, pause the program and let him manually measure it avoid a bad spot, then carry on the program again....

Sorry, coding is my weakest link here and I figured someone may have code doing something the same or similar....open to any and all coding examples.....

TIA !
Parents
  • Jim,
    Eh, let's not go out on the limb over thin ice of trusting an operator to manually miss possible form defects...
    Try this:

    
    LABEL/Begin_trying
    
    
    DCC CIR_1 measured with 8 hits, make it an Autocircle with an avoidance move After to get the tip out of the hole.
    
    Dimension CIR_1 for roundness, let's name this dimension RND1
    
    IF/ RND1.OUTTOL > 0
    
    [COLOR=#008000].    The If Test to see if the out-of-tol number delivered by the dimension is greater than zero will return True of False, 1 or 0.
     .    Now if the test turned out to be True, then any and all code between the IF and the END_IF gets executed.
    .                                      but if the test returned False then all the code between the IF and END_IF gets skipped.)
    .    So here are the actions that happen if the roundness fails:[/COLOR]
    
    .   Operator Comment: "Clean the hole with denatured alcohol and lint-free material, then click OK
    
    .   GOTO/Begin_trying
    
    END_IF
    
    


    Now the sharp eyed will immediately grin and wag a finger with a stern warning about the danger of Infinite Loops!
    Then we add some more fun stuff to the code to fix that:

    [COLOR=#0000FF]Assign/Counter_Variable=0[/COLOR]
    
    LABEL/Begin_trying
    
    [COLOR=#0000FF]Assign/Counter_Variable=Counter_Variable + 1
    
    
    IF Counter_Variable > 3
    
    .    Operator Comment, "Inform production of roundness defect"
    
    .   GOTO Skip_Position
    
    END_IF[/COLOR]
    
    
    DCC CIR_1 measured with 8 hits.
    
    Dimension CIR_1 for roundness RND1
    
    IF/ RND1.OUTTOL > 0
    
    .   Operator Comment: "Clean the hole with denatured alcohol and lint-free material, then click OK
    
    .   GOTO/Begin_trying
    
    END_IF
    
    [COLOR=#0000FF]Dimension Position & size of CIR_1
    
    LABEL/Skip_Position[/COLOR]
    
    


Reply
  • Jim,
    Eh, let's not go out on the limb over thin ice of trusting an operator to manually miss possible form defects...
    Try this:

    
    LABEL/Begin_trying
    
    
    DCC CIR_1 measured with 8 hits, make it an Autocircle with an avoidance move After to get the tip out of the hole.
    
    Dimension CIR_1 for roundness, let's name this dimension RND1
    
    IF/ RND1.OUTTOL > 0
    
    [COLOR=#008000].    The If Test to see if the out-of-tol number delivered by the dimension is greater than zero will return True of False, 1 or 0.
     .    Now if the test turned out to be True, then any and all code between the IF and the END_IF gets executed.
    .                                      but if the test returned False then all the code between the IF and END_IF gets skipped.)
    .    So here are the actions that happen if the roundness fails:[/COLOR]
    
    .   Operator Comment: "Clean the hole with denatured alcohol and lint-free material, then click OK
    
    .   GOTO/Begin_trying
    
    END_IF
    
    


    Now the sharp eyed will immediately grin and wag a finger with a stern warning about the danger of Infinite Loops!
    Then we add some more fun stuff to the code to fix that:

    [COLOR=#0000FF]Assign/Counter_Variable=0[/COLOR]
    
    LABEL/Begin_trying
    
    [COLOR=#0000FF]Assign/Counter_Variable=Counter_Variable + 1
    
    
    IF Counter_Variable > 3
    
    .    Operator Comment, "Inform production of roundness defect"
    
    .   GOTO Skip_Position
    
    END_IF[/COLOR]
    
    
    DCC CIR_1 measured with 8 hits.
    
    Dimension CIR_1 for roundness RND1
    
    IF/ RND1.OUTTOL > 0
    
    .   Operator Comment: "Clean the hole with denatured alcohol and lint-free material, then click OK
    
    .   GOTO/Begin_trying
    
    END_IF
    
    [COLOR=#0000FF]Dimension Position & size of CIR_1
    
    LABEL/Skip_Position[/COLOR]
    
    


Children
No Data