Need help with If statement...

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

  • Need help with If statement...

    hello,

    I am having trouble getting if/then statements to work for me.
    In excel it would look like this:

    =IF((A1>0.001),"PASS","FAIL")

    I am trying to get something like this in pcdmis:

    IF((CIR1.X.MEAS>1.00),"MEASUREMENT ERROR DETECTED","MASTER VALIDATION PASSED")

    Any guidance on this is appreciated
    thanks!!

  • #2
    Use If and else if.

    Here is an example, I don't use else if in PCDMIS because I think it is kind of dumb that you have to give it an argument, else should be just that what to do if the argument condition in the if line is not met. Basically else in PCDMIS is the same as an if statement dumb, very dumb. I heard if I use cad these code inconsitencies will go away but I digress........

    Code:
    DIM SIZE_CIR1= LOCATION OF CIRCLE CIR1  UNITS=IN ,$
    GRAPH=OFF  TEXT=OFF  MULT=1.00  OUTPUT=BOTH
    AX    MEAS   NOMINAL    +TOL     -TOL      DEV    OUTTOL 
    D    0.9848   0.9847   0.0005   0.0005   0.0001   0.0000 -----#---
    END OF DIMENSION SIZE_CIR1
                IF/SIZE_CIR1.D.OUTTOL <> 0
                COMMENT/OPER,"NICE JOB BUBBA, HOW'S YOUR JANITORIAL SKILLS?"
                END_IF/
                ELSE_IF/SIZE_CIR1.D.OUTTOL == 0
                COMMENT/OPER,"AMAZING, SO YOU CAN MAKE A GOOD PART"
                END_ELSEIF/
    Last edited by craiger_ny; 03-07-2007, 05:16 PM.
    <internet bumper sticker goes here>

    Comment


    • #3
      Close but not there yet........

      Craig,

      I need a report comment rather than the operator comment..This is where i have the problem If i use the else\if both comments show up in report. Maybe i could mark a comment based on conditional statement???

      Comment


      • #4
        An operator comment will not come up if your argument fails it will only come up when it evaluates to true. Else in PCDMIS is really just an if end if evaluation. What do you get when you evealuate it with two if end ifs. One condition would check for > 1.00 another would check for <= 1.00. It should work.
        <internet bumper sticker goes here>

        Comment


        • #5
          It does work with operator comments..

          I just cant get it to work with report comments

          Comment


          • #6
            No? I'll have to try it. Seems to me it does. If it does not you can workk around it by assigning what message you want into a variable based on a conditional statement and then put that variable in your comment. That I know for sure will work.
            <internet bumper sticker goes here>

            Comment


            • #7
              I believe i will have to work around it with a set of variables.
              Thanks for your help!
              Last edited by spazus_maximus; 03-08-2007, 09:41 AM.

              Comment


              • #8
                Thanks Craig!

                Craig,
                You were right! The rept/comments only show up on the full report not the last execution report. Thanks for your help!!

                DIM MASTER_321= TRUE POSITION OF CYLINDER DAT_P USE AXIS=AVERAGE REF LENGTH=0.0000 UNITS=MM ,$
                GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH DEV PERPEN CENTERLINE=OFF DISPLAY=DIAMETER
                AX NOMINAL +TOL -TOL BONUS MEAS DEV OUTTOL
                X 0.0000 0.0241 0.0241
                Z 0.0000 -0.0077 -0.0077
                TP RFS 0.1000 0.0000 0.0506 0.0000 ----#----
                END OF DIMENSION MASTER_321
                ASSIGN/321_PASS = MASTER_321.TP.DEV>.035 AND MASTER_321.TP.DEV<.065
                IF/MASTER_321.TP.DEV>.065
                COMMENT/REPT,"MEASUREMENT ERROR DETECTED ON MASTER RM 321"
                END_IF/
                IF/MASTER_321.TP.DEV<.035
                COMMENT/REPT,"MEASUREMENT ERROR DETECTED ON MASTER RM 321"
                END_IF/
                ELSE_IF/321_PASS
                COMMENT/REPT,"MEASUREMENT SYSTEM VERIFIED ON MASTER RM 321"
                END_ELSEIF/

                Comment

                Related Topics

                Collapse

                Working...
                X