Im trying to step through a subroutine?

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • Im trying to step through a subroutine?

    Code:
    STARTUP    =ALIGNMENT/START,RECALL:,LIST=YES
                ALIGNMENT/END
                MODE/DCC
                FORMAT/TEXT,OPTIONS, ,HEADINGS,SYMBOLS, ;NOM,TOL,MEAS,DEV,OUTTOL, , 
                LOADPROBE/20X4X20
                TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=0
                DISPLAYPRECISION/5
                RECALL/ALIGNMENT,EXTERNAL,a4,FREESTATEFIXTURE:a4
    $$ NO,Create some code to which trys to improve measuring the comp limiter circles
                ASSIGN/MYITERATION = 0
    CIR1MEASURE=LABEL/
                ASSIGN/MYITERATION = MYITERATION+1
                SELECT/MYITERATION
                CASE/1
                ASSIGN/MYHITS = 3
                END_CASE/
                CASE/2
                ASSIGN/MYHITS = 9
                END_CASE/
                END_SELECT/
                ASSIGN/MYDIAOUTTOL = 0
    CIR1       =AUTO/CIRCLE,SHOWALLPARAMS = YES,SHOWHITS = NO
                THEO/-176,0,0,0,0,1,7.75
                ACTL/-176.21349,-0.87955,-0.11274,-0.0159367,0.0308081,0.9993983,7.79853
                TARG/-176,0,0,0,0,1
                THEO_THICKNESS = 0,RECT,IN,STRAIGHT,LEAST_SQR,ONERROR = NO,$
                AUTO MOVE = BOTH,DISTANCE = 10,RMEAS = None,None,None,$
                READ POS = NO,FIND HOLE = DISABLED,REMEASURE = NO,$
                NUMHITS = MYHITS,INIT = 3,PERM = 3,SPACER = 1,PITCH = 0,$
                START ANG = 0,END ANG = 360,DEPTH = 2,$
                VOID DETECT = NO,$
                ANGLE VEC = 1,0,0
    CS1        =CALLSUB/CHECKDIAMETER,:{CIR1},0.05,0.05,,
                IF/MYDIAOUTTOL <> 0
                IF/MYITERATION==1
    C1         =COMMENT/YESNO,NO,"Cir1 is out of spec: "+ MYDIAOUTTOL
                                ,Would you like to increase the number of hits and try again?
                                ,YES to Try Again
                                ,No to Continue AS IS
                                ,Cancel to Quit the Program
                IF/C1.INPUT=="YES"
                GOTO/CIR1MEASURE
                END_IF/
                END_IF/
                END_IF/
                PROGRAM/END
    $$ NO,This Subroutine checks the diameter of a feature and sets a variable called
         ,MYDIAOUTTOL = to the OutofTolerance Condition of the diameter
                SUBROUTINE/CHECKDIAMETER,
                    MYCIRID = {CIR1} : FEATURE ID TO TEST,
                    PLUSTOL = 0.05 : PLUS TOLERANCE FOR THE FEATURE,
                    MINUSTOL = 0.05 : MINUS TOLERANCE FOR THE FEATURE,
                     = 
                ASSIGN/MYUPPERLIMIT = FUNCTION((MYCIRID, PLUSTOL), MYCIRID.TD+PLUSTOL)
                ASSIGN/MYLOWERLIMIT = FUNCTION((MYCIRID, MINUSTOL), MYCIRID.TD-MINUSTOL)
                IF/MYCIRID.D>MYUPPERLIMIT
                ASSIGN/MYDIAOUTTOL = MYCIRID.D-MYUPPERLIMIT
                END_IF/
                IF/MYCIRID.D<MYLOWERLIMIT
                ASSIGN/MYDIAOUTTOL = MYCIRID.D-MYLOWERLIMIT
                END_IF/
                ENDSUB/
    I believe there is some sort of error in my code within the Subroutine itself. If the circle is out of spec, the variable MyDiaOutTol never gets set. I might beable to diagnose the problem myself but I cant seem to get PCDMIS to step through the subroutine once it gets to my CALLSUB it executes the sub without any prompts so that I can step through it.

    The Subroutine code is within the current part program.

    V4.1

    Any ideas on how to get PCDMIS to step through this subroutine line by line?

    Thanks
    Mr. Comment
    SCIROCCO-NT 13-20-10
    B3C-LC Controller (Leitz Protocol), SP600M, TP200
    PCDMIS CAD++ v4.3 MR1(Build: 12/11/08)
    sigpic

  • #2
    I might not have any bussiness here because I do not use that version and I don't write PCDMIS subs. If you can't get it working you can dimension the diameter then test it with an If END/If where you test to see if DIMENSION ID.D.OUTTOL <> 0

    Like so:

    Code:
    F2_900_DIA =FEAT/CIRCLE,RECT,IN,LEAST_SQR
                THEO/0,0,1.8,0,0,-1,2.9035
                ACTL/-0.0014,0.0008,1.8013,0,0,1,2.9042
                MEAS/CIRCLE,8,WORKPLANE
                HIT/BASIC,0,1.4517,1.8,0,-1,0,-0.0004,1.4527,1.8011
                HIT/BASIC,1.0265,1.0265,1.8,-0.7071068,-0.7071068,0,1.0273,1.0261,1.8012
                HIT/BASIC,1.4517,0,1.8,-1,0,0,1.4506,0.0006,1.8014
                HIT/BASIC,1.0265,-1.0265,1.8,-0.7071068,0.7071068,0,1.0263,-1.0247,1.8015
                HIT/BASIC,0,-1.4517,1.8,0,1,0,-0.0009,-1.4513,1.8015
                HIT/BASIC,-1.0265,-1.0265,1.8,0.7071068,0.7071068,0,-1.0276,-1.0266,1.8014
                HIT/BASIC,-1.4517,0,1.8,1,0,0,-1.4536,-0.0009,1.8012
                HIT/BASIC,-1.0265,1.0265,1.8,0.7071068,-0.7071068,0,-1.0284,1.0271,1.8011
                ENDMEAS/
    DIM SIZE_F2_900_DIA= LOCATION OF CIRCLE F2_900_DIA  UNITS=IN ,$
    GRAPH=OFF  TEXT=OFF  MULT=1.00  OUTPUT=BOTH
    AX    MEAS   NOMINAL    +TOL     -TOL      DEV    OUTTOL 
    D    2.9042   2.9035   0.0050   0.0050   0.0007   0.0000 -----#---
    END OF DIMENSION GENERIC_DIMENSION
                IF/SIZE_F2_900_DIA.D.OUTTOL <> 0
                Do what you need done for a true statement here
                END_IF/
    That looks like the same thing you want to do. Sorry it does not really answer your question as you ask it and if I am totally off the mark then disregard.

    Craig

    Are colons the way to add documentation comments now I see you have some stuff that is after a colon : that looks like comments. I like that. Can you comment out code with that?
    <internet bumper sticker goes here>

    Comment


    • #3
      Code:
       MYCIRID = {CIR1} [B]: FEATURE ID TO TEST[/B],
                      PLUSTOL = 0.05 [B]: PLUS TOLERANCE FOR THE FEATURE[/B],
                      MINUSTOL = 0.05 [B]: MINUS TOLERANCE FOR THE FEATURE[/B],
      These colons are added by using the CallSub dialog box "Description" field.

      I wish I could add comments like these in other places too.

      The new Doc comment command in v4.1 is "$$"

      I tried using the dimension variable .outtol command method earlier and the variable didnt update even if the circle was out of tolerance. Figured it was another PCDMIS bug though. Maybe I just fat fingered it.
      Mr. Comment
      SCIROCCO-NT 13-20-10
      B3C-LC Controller (Leitz Protocol), SP600M, TP200
      PCDMIS CAD++ v4.3 MR1(Build: 12/11/08)
      sigpic

      Comment


      • #4
        You cannot step through a subroutine. The variable in the subroutine might be considered local to the subroutine (meaning it does not use the one in the main program). I think there is a editor setting to make variables global but I do not know what that is since I am not at a pcdmis computer at this time.

        Comment

        Related Topics

        Collapse

        Working...
        X
        😀
        🥰
        🤢
        😎
        😡
        👍
        👎