New to looping

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

  • New to looping

    I have tried looping for the 1st time today. I do a manual align. then just before I start dcc I assign C3 as an input then my dcc align then ask the operator to input how many pieces to run the affore mentioned C3 value then

    V1 LOOP/START, ID = YES, NUMBER = C3.INPUT, START =1, SKIP = ,
    OFFSET: XAXIS = 0, YAXIS = 25.364, ZAXIS =0, ANGLE = 0

    Then I measure my features which runs fine on the 1st piece but when it is suppose to go to the next one it stops and will not goto the next piece. I checked out the F1 on looping but zip any Ideas. I want to do 4 pieces in the y axis direction.

    Thanks for any help

    p.s. global image 3.7 mr2
    Since I gave up hope I feel much better !!!

  • #2
    Perhaps you can assign C1.INPUT to a variable and use the variable in the number property. I've done it with variables and it works but it seems like your way should too.

    Craig
    <internet bumper sticker goes here>

    Comment


    • #3
      Just making sure the LOOP command is marked for execute. I've fogotten to do that in the past.

      Comment


      • #4
        C3 input is a number entered on the amount of pieces I want checked up to 4. I am using previously written programs as a guide and as far as I know it is all the same I cannot see a difference. I have marked the program, of course if I get time tomorrow I will try again just to make sure these things were done and I did not miss anything.
        Since I gave up hope I feel much better !!!

        Comment


        • #5
          Here is a bit of code I wrote that I paste into my programs when I need to loop. It doesn't specify how many parts you want to measure, it just asks if you want to measure another until you say no. Put your measurement code between the "begin measurement" and "end measurement" comments.


          Let me know how this works for you as I'm pretty new at this too...

          ~Kevin



          Code:
                      COMMENT/DOC,******************************
                                 ,*
                                 ,WHILE LOOP
                                 ,*
                                 ,Measures first part, then askes user if they want
                                 ,to measure another part.  If yes, loops back to the
                                 ,beginning of the measurement code.  If no, exits
                                 ,cleanly.
                                 ,*
                      ASSIGN/C1 = "YES"
                      ASSIGN/COUNT = 0
                      WHILE/C1 == "YES"
                      COMMENT/DOC,***  Begin Measurement Code  ***
                      COMMENT/DOC,***  End Measurement Code  ***
          C2         =COMMENT/YESNO,Measure Another Part?
                      ASSIGN/C1 = C2.INPUT
                      END_WHILE/
                      COMMENT/DOC,*** End WHILE LOOP Snippet  ***
          Kevin N. Thompson - Thompson Digital Image
          Quality Manager - Rj Link International

          Comment


          • #6
            Silly question time, got an end loop command in there?

            TK
            sigpicHave a homebrew

            Comment


            • #7
              Originally posted by Ken379128
              C3 input is a number entered on the amount of pieces I want checked up to 4. I am using previously written programs as a guide and as far as I know it is all the same I cannot see a difference. I have marked the program, of course if I get time tomorrow I will try again just to make sure these things were done and I did not miss anything.
              Understanding that I believe your code should work. You could try retyping the C3.INPUT in the number property and see if PCDMIS picks it up. If not assign it to a variable like so
              Code:
              C3         =COMMENT/INPUT,NO,"ENTER THE NUMBER OF PARTS TO CHECK"
                         ASSIGN/LOOP_COUNT = C3.INPUT
              V1 LOOP/START, ID = YES, NUMBER = LOOP_COUNT, START =1, SKIP = ,
              OFFSET: XAXIS = 0, YAXIS = 25.364, ZAXIS =0, ANGLE = 0
              <internet bumper sticker goes here>

              Comment


              • #8
                Here is another example from a program I use regularly to check a random number of parts. This is at the end of my program. The program will keep looping as long as you want. I put the notice to change parts in because operators have clicked "yes" w/o changing parts and screwed up. I also put in a second part to choose between printing and not printing a report. The reason being checks during setup to tell setup operators where the part is but do not need documentation.

                Maybe this will help.

                C1 =COMMENT/YESNO,ARE YOU CHECKING ANOTHER PART?
                ,
                ,IF YES LOAD PART BEFORE CLICKING "YES"
                IF/C1.INPUT=="YES"
                GOTO/START
                END_IF/
                IF/C1.INPUT=="NO"
                GOTO/END
                END_IF/
                END =LABEL/
                C2 =COMMENT/YESNO,PRINT REPORT?
                IF/C2.INPUT=="YES"
                GOTO/PRINT
                END_IF/
                IF/C2.INPUT=="NO"
                GOTO/NO_PRINT
                END_IF/
                PRINT =LABEL/
                PRINT/REPORT,TO_FILE=OFF,AUTO=1,$
                TO_PRINTER=ON,DRAFTMODE=OFF,$
                PREVIOUS_RUNS=DELETE_INSTANCES
                NO_PRINT =LABEL/
                Perry
                B&S Mistral
                3.207 Beta on XP

                Older'n dirt

                Comment


                • #9
                  Ken,

                  The code you are using should work, and in my opinion is the best and most simple of the looping options to use where offsets are concerned. I did notice however that your sig says that you are using 3.7MR2. Perhaps you want to try this loop in an older version or even go up to 3.7 MR3, as I heard alot of discussion with the variable style loop function having issues in MR2 when I was in my Advanced class.

                  Just a thought. Hope you get er done!
                  DCCFreak

                  Comment


                  • #10
                    Did you put an "Loop/End" at the end of your program?
                    Windows 7
                    Pc-Dmis 2015
                    Global Performance 7-10-7


                    Comment


                    • #11
                      Originally posted by BSchwark
                      Did you put an "Loop/End" at the end of your program?
                      I didn't get an answer when I asked that question, I hope you do, so simple but it could be the problem

                      TK
                      sigpicHave a homebrew

                      Comment


                      • #12
                        Why is the LOOP/END a sepparate insert command anyway? Intellisense adds an END/IF and END/WHILE and others to multi line code. Why is LOOP/END a separate action required by the programmer? It makes sense to me to just have it inserted at the same time as the loop block.

                        Craig
                        <internet bumper sticker goes here>

                        Comment


                        • #13
                          Originally posted by craiger_ny
                          Why is the LOOP/END a sepparate insert command anyway? Intellisense adds an END/IF and END/WHILE and others to multi line code. Why is LOOP/END a separate action required by the programmer? It makes sense to me to just have it inserted at the same time as the loop block.

                          Craig
                          Yup, you're right, but if you want it to work you gotta do it the Demons way. Try it, it'll work.

                          TK
                          sigpicHave a homebrew

                          Comment


                          • #14
                            Originally posted by craiger_ny
                            Why is the LOOP/END a sepparate insert command anyway? Intellisense adds an END/IF and END/WHILE and others to multi line code. Why is LOOP/END a separate action required by the programmer? It makes sense to me to just have it inserted at the same time as the loop block.

                            Craig
                            That the way it was done in Avail and MM4. Old habits are hard to break?

                            BS
                            Windows 7
                            Pc-Dmis 2015
                            Global Performance 7-10-7


                            Comment


                            • #15
                              It used to be in VB you'd had to indent nested sub routines (and other commands) if you wanted them to stand out. Now you don't. Minor gripe, but it could be changed.

                              Craig
                              <internet bumper sticker goes here>

                              Comment

                              Related Topics

                              Collapse

                              Working...
                              X