Code Sample of If / End If

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

  • Code Sample of If / End If

    Here is what I've got. I have been playing around with this code so I can insert messages to the operator. Things like Do you want to see the set up instruction? Stuff like this.
    I have been having pretty good luck with it untill now. I have been inserting it into the new programs I write. No problems.
    I have opened a program that already had some Operator comments in it and I wanted to add this code so I didn't have to check OK every time if I am not doing a manual alignment.
    What is happening is the program is skipping over all the comands and going straight to the DCC alignment. I am not getting any messages.
    Could someone maybe tell me where I am going wrong. I could post a section of the program if that would help.
    Thanks ahead of time.
    B. Jacobs
    B&S Global 12.15.10
    2014.1

  • #2
    Sounds like you dont have your labels named right or they are not in the right place. If that doesn't help you, send some of the program.
    sigpic

    Comment


    • #3
      Rebel, I just sent it to you
      B. Jacobs
      B&S Global 12.15.10
      2014.1

      Comment


      • #4
        I do that in almost all my program ask if I need to manual align.. post some code so we can take a look
        sigpic
        if you had soap on a rope it would be tied to yer ankle

        Comment


        • #5
          post it, for help!
          RFS Means Really Fussy Stuff

          When all you have is a hammer - everything looks like a nail....
          sigpic

          Comment


          • #6
            OK here is what I have:

            STARTUP =ALIGNMENT/START,RECALL:, LIST= YES
            ALIGNMENT/END
            MODE/MANUAL
            LOADPROBE/BRYAN2MM
            TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=0
            FORMAT/TEXT, ,HEADINGS, , ;MEAS,NOM,TOL,DEV,OUTTOL, ,
            IF/C1.INPUT=="YES"
            C1 =COMMENT/YESNO,Would you like to see the set up instructions?
            COMMENT/OPER,Take 3 hits on top of part and hit continue when command comes up.
            PLN1 =FEAT/PLANE,RECT
            THEO/15.0081,8.6863,-26.4119,-0.0059371,-0.0016554,0.999981
            ACTL/6.2131,6.3169,-25.4172,-0.0010256,0.0002992,0.9999994
            MEAS/PLANE,3
            HIT/BASIC,14.9779,8.8658,-26.4118,-0.0059371,-0.0016554,0.999981,6.1767,6.5918,-25.4173,USE THEO = YES
            HIT/BASIC,15.0636,8.7044,-26.4115,-0.0059371,-0.0016554,0.999981,6.2313,6.3105,-25.4171,USE THEO = YES
            HIT/BASIC,14.9828,8.4886,-26.4124,-0.0059371,-0.0016554,0.999981,6.2312,6.0484,-25.4171,USE THEO = YES
            ENDMEAS/
            COMMENT/OPER,Take two hits across front of part when command comes up.
            LIN1 =FEAT/LINE,RECT,UNBND
            THEO/14.9829,8.0997,-26.4955,0.9999472,-0.0102776,0
            ACTL/6.1068,5.5885,-25.4999,0.9999825,-0.005921,0
            MEAS/LINE,2,WORKPLANE
            HIT/BASIC,14.9829,8.0997,-26.4955,-0.0102776,-0.9999472,0,6.1068,5.5885,-25.4999,USE THEO = YES
            HIT/BASIC,15.0664,8.0989,-26.4954,-0.0102776,-0.9999472,0,6.2526,5.5876,-25.4998,USE THEO = YES
            ENDMEAS/
            COMMENT/OPER,Tke 2 hits on right side of part at Dim. 2 (.1952) when command comes up.
            LIN2 =FEAT/LINE,RECT,UNBND
            THEO/15.1181,8.2663,-26.4952,0.0072577,0.9999737,0
            ACTL/6.2869,5.6377,-25.4996,0.0042218,0.9999911,0
            MEAS/LINE,2,WORKPLANE
            HIT/BASIC,15.1181,8.2663,-26.4952,0.9999737,-0.0072577,0,6.2869,5.6377,-25.4996,USE THEO = YES
            HIT/BASIC,15.1219,8.7903,-26.4952,0.9999737,-0.0072577,0,6.2898,6.322,-25.4997,USE THEO = YES
            ENDMEAS/
            END_IF/
            PNT1 =FEAT/POINT,RECT
            THEO/15.1168,8.0984,-26.4954,0.9999472,-0.0102776,0
            ACTL/6.2867,5.5874,-25.4997,0.9999825,-0.005921,0
            CONSTR/POINT,INT,LIN1,LIN2
            A0 =ALIGNMENT/START,RECALL:STARTUP, LIST= YES
            ALIGNMENT/LEVEL,ZPLUS,PLN1
            ALIGNMENT/ROTATE,XPLUS,TO,LIN1,ABOUT,ZPLUS
            ALIGNMENT/TRANS,XAXIS,PNT1
            ALIGNMENT/TRANS,YAXIS,PNT1
            ALIGNMENT/TRANS,ZAXIS,PLN1
            ALIGNMENT/END
            Hope this is helpful
            B. Jacobs
            B&S Global 12.15.10
            2014.1

            Comment


            • #7
              Oh I'm stupid. After posting the program I see where it is wrong. I need to heve the yes no coment before the if/endif coment.
              DUH
              B. Jacobs
              B&S Global 12.15.10
              2014.1

              Comment


              • #8
                Shouldn't your 1st If statement be below the Input/comment line...
                At 1st glance...
                Kev
                RFS Means Really Fussy Stuff

                When all you have is a hammer - everything looks like a nail....
                sigpic

                Comment


                • #9
                  Oops, beat me to it Bryan...
                  RFS Means Really Fussy Stuff

                  When all you have is a hammer - everything looks like a nail....
                  sigpic

                  Comment


                  • #10
                    Yep it's one of those days. I'm sure I'm not the only one. But it does make you feel about yea big.
                    OK i give everyone permision to laugh.
                    B. Jacobs
                    B&S Global 12.15.10
                    2014.1

                    Comment


                    • #11
                      The first time you run your program and say yes to the manual alignment, it won't ask you again. The reason is it will always remember c1.input as yes and skip it. If you close out of the program it will lose what c1.input was and prompt you.

                      You can setup a comment input menu which will allow you to run sections of the program. It all depends on how you want it to run.

                      Something like this maybe.

                      C1 =COMMENT/INPUT,What do you want to run?
                      ,
                      ,1 = View Setup Instructions
                      ,2 = Run Manual and DCC alignemnt
                      ,3 = Run DCC alignment only
                      ,4 = Run Part program
                      IF_GOTO/C1.INPUT == 1,GOTO = SKIP
                      IF_GOTO/C1.INPUT == 2,GOTO = SKIP
                      IF_GOTO/C1.INPUT == 3,GOTO = SKIP
                      IF_GOTO/C1.INPUT == 4,GOTO = SKIP
                      COMMENT/OPER,You have entered an invalid number.
                      ,
                      ,Please re-type the operation you want to perform.
                      ,
                      GOTO/C1
                      SKIP =LABEL/
                      "Your mom goes to college."
                      Kip

                      Comment


                      • #12
                        Mr. Farr,
                        I don't understand this. I would like to be able to say yes at the beging of the program when it is being run for the first time. But after that I don't want to have to hit no each time it runs. Could you elaberate on this a little. I am new to this and am learning as I go.
                        Thanks
                        B. Jacobs
                        B&S Global 12.15.10
                        2014.1

                        Comment


                        • #13
                          Nevermind then, what you have should work.

                          I didn't know you wanted to run the DCC alignment every time. I'm aassuming the manual alignment for a fixture of some sort, and the DCC on the part?
                          "Your mom goes to college."
                          Kip

                          Comment


                          • #14
                            LOL,
                            It happens to the best of us!!!
                            sigpic

                            Comment

                            Related Topics

                            Collapse

                            • PATRICK P
                              Stymied on this one
                              by PATRICK P
                              Hi All, I'm using a cone for the frist time, and in a interative alignment to boot!
                              I did use part=cad, however after reading some posts on this...
                              07-16-2008, 10:13 AM
                            • Tinyfxds
                              Inserting Code into a post
                              by Tinyfxds
                              How do you insert code into a post? I've noticed on quite a few threads that people will add the code from their program and it inserts it into it's...
                              02-20-2015, 05:20 PM
                            • bosnjody
                              I'm A Machinist
                              by bosnjody
                              O.K. This is probably the most basic (I would think) thing to do.
                              I have CAD++ Ver 3.5 MR1. I wrote a program to inspect a part.
                              Worked...
                              03-09-2011, 04:00 PM
                            • WScmm
                              911! need help
                              by WScmm
                              Sorry for the lenght of discription but here goes. Running 3.5 mr2, TP200 PH10MQ head and have been for 3+ years now. Yesterday I programmed a part and...
                              02-14-2007, 09:52 AM
                            • keego
                              Missing Lines of Code?
                              by keego
                              Please see code below. I have been having problems getting all of my SM25 modules to complete calibrations. A Hexagon technician was in last Thursday...
                              04-05-2010, 09:25 AM
                            Working...
                            X