IF/GOTO - Deciding how many parts to measure

  • Filter
  • Time
  • Show
Clear All
new posts

  • IF/GOTO - Deciding how many parts to measure

    Looking to inspect several parts at once but also have an option to inspect only a single part or any number in between, but not sure what options I have to approach the issue. I have a fixture that will support 10 parts, 1-10 with labeled locations to indicate the spot number for each part.

    In some cases the operator may not need to check all 10 parts. I was looking at ideas that included the possibility of adding a comment with choices, or a user input that asks "How many parts will you be measuring?" at the start of the program and based on this the machine would measure the number of parts the operator desired up to the maximum allowed by the fixture. The fixture is designed to indicate the 10 locations and therefore the operator could load part in locations 1-3 if they were measuring only 3, or just in spot 1 if they were measuring 1 part.

    I am not sure if anyone has information on how or if this would be possible to implement but I think it would be an interesting feature to add to my program.

    Thanks in Advance

  • #2
    You could probably do it with ONERROR (ON ERROR), so that if a part isn't on your fixture in that spot, it skips it, then there isn't any user input.
    Originally posted by AndersI
    I've got one from September 2006 (bug ticket) which has finally been fixed in 2013.


    • #3
      I didn't think of that, that probably would work. The only question I could think of if I went this route would be if the operator is only running one part on a 10 part fixture, would it proceed to check the 9 other positions and find no part there and then finish the program, or would it finish the program right after it does not find the next part.


      • RandomJerk
        RandomJerk commented
        Editing a comment
        It doesn't have to.

        Matt's idea is fine, it really wouldn't take too terribly long to go through all the stations of the fixture. Or you can just have it end the program on first "miss", or empty station. The same evaluation that's used to decide the part isn't there and move on can be amended to see the part isn't there and end by using the vriable assignment technique to the ONERROR command, then put an ENDPROG label in at the end of the program and...

        ONERROR assign PART_THERE=1

    • #4
      it would continue to the end, 1 attempt for each position. BUT, all you need is a bogus (not part of the REAL check routine) vector point on the part, it tries to measure, gets an error, ONERROR goes to the next station, repeats until it gets to the 'park' move point at the end. Would be fairly quick, even on my old, slow machine. If the yutz left the fixture empty, it would try to measure a max of 10 vector points before finishing.
      Originally posted by AndersI
      I've got one from September 2006 (bug ticket) which has finally been fixed in 2013.


      • #5
        So, I have parts that sometimes I have to measure up to 24 pcs. I have a plate similar to a Rayco plate. I use input comments at the beginning of the program asking how many parts per row and how many rows then assign the inputs to variables that are used in a nested loop. If your fixture houses all 10 pcs in one row, you would only need a loop instead of a nested loop. All this provided I understand your question.
        Last edited by Hi-Tech Redneck; 09-13-2019, 12:47 PM.
        Sheffield Endeavor3 9.20.8, Tesastar-SM, Leitz LSP-X1s & LSP-X1M, PCDMIS 2011 MR1


        • #6
          At the beginning of the program, do this:

          C1         =COMMENT/INPUT,NO,FULL SCREEN=NO,
                      HOW MANY PARTS DO YOU WANT TO RUN?
                      (ENTER A NUMBER 1 THRU 10)
          ~Manual alignments and other stuff...
          ~DCC MODE
                     ***** PROGRAM CODE WITH  DCC ALIGNMENTS & DIMENSIONS*****
          This is basically the way I started doing it. I then learned how to use forms. Now I have a drop down for them to select how many parts they want to run instead of them typing a number in. Do a search on the forums for loops. There are plenty of examples.


          • SM_19
            SM_19 commented
            Editing a comment
            I like this method of doing it. I didn't realize a loop was that easy on PC-DMIS. I'm not sure how this would work for me though as my fixture has 10 parts lined up in 10 different locations along the X axis (same Y & Z). I see the offset in the loop code, would the x-axis value be the center to center value between the equal spaced 10 parts?
            Last edited by SM_19; Today, 12:24 PM.

          • mckenzie
            mckenzie commented
            Editing a comment
            your offset value will shift the position of the alignment origin by the value amount. example: if your parts are equally spaced 50mm apart in x, inputting an offset of 50mm in x will move the alignment 50mm in x after the each part has finished running.

            first part origin x0 y0 z0
            second part origin x50 y0 z0
            third part origin x100 y0 z0 ...

          • SM_19
            SM_19 commented
            Editing a comment
            Got it to work. Thanks very much for your help. Eventually I will look into dropdowns to eliminate any chance of the operator entering the incorrect number. Thanks

        • #7
          At the beginning of the program
          Then I use a form for input information such as quantity (QTY_1) serial number etc

          Then at the start of the loop
          START_MEAS =LABEL/
          Then the body of the routine
          And at the end of the routine
          Last edited by BKulpa; Today, 08:01 AM.


          Related Topics