Programming multiple parts

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

  • Programming multiple parts

    Hello everyone. I have to measure the x distance, y distance and diagonols on 30 food containers. I'm able to fit 4 to 6 of these containers onto the table. I have not started writing the program yet because I have no idea how to. I can align the 1st part. Then after that I don't know what to do. I have a manual alignment and a dcc alignment for the 1st part. The parts are placed in a 2 x 2 matrix. They will always be placed in the same location. Please let me know if you need more info to better answer this question. Also bear in mind that I just started using this program and I'm bad at programming.
    Last edited by beginner; 04-02-2008, 10:00 AM.

  • #2
    If You Have Your Alinement On The First Part And All The Other Parts Are Always In The Same Place All You Need Do Is Measure Each Part For The Information That You Want. A Different Alinement Can Be Done On Each Part Before Each X Y Print Out If That Is What You Need. In This Way You Have One Manual Alinement To Check Every Part Within The Program. MAKE SURE YOU RECALL THE MACHINE ALINEMENT BEFORE EVERY PART ALINEMENT.
    Last edited by pniven; 04-02-2008, 10:32 AM.
    sigpichttp://npmichaels.com/ (My sons book)
    THANKS (CAD IS ALWAYS MASTER)
    4.3 & 4.2MR2/GLOBAL/PH10MQ/WINDOWS XP

    Comment


    • #3
      why not just write a program for one part at a time? they are all the same parts correct?
      XYZ_IJK
      pc-dmis 2012 mr1, 2013mr1
      calypso 5.4 sp1

      Comment


      • #4
        They are all the same parts but I wanted to find a faster way of measuring them. All the parts are going through different tests and have to be meaured after each test.

        Comment


        • #5
          Like this?

          TABLE =FEAT/PLANE,RECT,TRIANGLE
          THEO/151.8918,160.9368,-574.2117,0.0000054,0.0000031,1
          ACTL/151.8918,160.9368,-574.2117,0.0000054,0.0000031,1
          MEAS/PLANE,6
          ENDMEAS/
          COMMENT/OPER,NO,Take 3 hits on the inside back left circle of the top left part.
          BL_MAN =FEAT/CIRCLE,RECT,IN,LEAST_SQR
          THEO/65.4785,254.3893,-486.8982,0,0,1,78.5268
          ACTL/65.4785,254.3893,-486.8982,0,0,1,78.5268
          MEAS/CIRCLE,3,WORKPLANE
          ENDMEAS/
          COMMENT/OPER,NO,Take 3 hits on the inside front left circle on the same part.
          FL_MAN =FEAT/CIRCLE,RECT,IN,LEAST_SQR
          THEO/68.9743,191.5191,-489.3491,0,0,1,77.5784
          ACTL/68.9743,191.5191,-489.3491,0,0,1,77.5784
          MEAS/CIRCLE,3,WORKPLANE
          ENDMEAS/
          COMMENT/OPER,NO,Take 3 hits on the inside front right circle of the same part.
          FR_MAN =FEAT/CIRCLE,RECT,IN,LEAST_SQR
          THEO/132.8915,196.3227,-489.3371,0,0,1,80.4176
          ACTL/132.8915,196.3227,-489.3371,0,0,1,80.4176
          MEAS/CIRCLE,3,WORKPLANE

          ENDMEAS/
          COMMENT/OPER,NO,Take 3 hits on the inside back right circle of the same part.
          BR_MAN =FEAT/CIRCLE,RECT,IN,LEAST_SQR
          THEO/127.0816,256.0812,-489.4266,0,0,1,85.0928
          ACTL/127.0816,256.0812,-489.4266,0,0,1,85.0928
          MEAS/CIRCLE,3,WORKPLANE
          ENDMEAS/
          X_MAN =FEAT/LINE,RECT,UNBND
          THEO/65.4785,254.3893,-486.8982,0.9996231,0.0274544,0
          ACTL/65.4785,254.3893,-486.8982,0.9996231,0.0274544,0
          CONSTR/LINE,BF,2D,BL_MAN,BR_MAN,,
          OUTLIER_REMOVAL/OFF,3
          FILTER/OFF,WAVELENGTH=0
          DIAG1_MAN =FEAT/LINE,RECT,UNBND
          THEO/65.4785,254.3893,-486.8982,0.7576771,-0.6526297,0
          ACTL/65.4785,254.3893,-486.8982,0.7576771,-0.6526297,0
          CONSTR/LINE,BF,2D,BL_MAN,FR_MAN,,
          OUTLIER_REMOVAL/OFF,3
          FILTER/OFF,WAVELENGTH=0
          DIAG2_MAN =FEAT/LINE,RECT,UNBND
          THEO/68.9743,191.5191,-489.3491,0.6689735,0.7432863,0
          ACTL/68.9743,191.5191,-489.3491,0.6689735,0.7432863,0
          CONSTR/LINE,BF,2D,FL_MAN,BR_MAN,,
          OUTLIER_REMOVAL/OFF,3
          FILTER/OFF,WAVELENGTH=0
          MID_MAN =FEAT/POINT,RECT
          THEO/99.322,225.238,-488.1236,0.6689735,0.7432863,0
          ACTL/99.322,225.238,-488.1236,0.6689735,0.7432863,0
          CONSTR/POINT,INT,DIAG2_MAN,DIAG1_MAN
          MAN_ALIGN =ALIGNMENT/START,RECALL:STARTUP, LIST= YES
          ALIGNMENT/LEVEL,ZPLUS,TABLE
          ALIGNMENT/ROTATE,XPLUS,TO,X_MAN,ABOUT,ZPLUS
          ALIGNMENT/TRANS,XAXIS,MID_MAN
          ALIGNMENT/TRANS,YAXIS,MID_MAN
          ALIGNMENT/TRANS,ZAXIS,TABLE
          ALIGNMENT/END
          COMMENT/OPER,NO,DCC to begin!
          MODE/DCC
          BL_DCC =AUTO/CIRCLE,SHOWALLPARAMS = NO,SHOWHITS = NO
          THEO/-31.34,29.13,84.896,0,0,1,81.8954
          ACTL/-31.34,29.13,84.896,0,0,1,81.8954
          TARG/-31.34,29.13,84.896,0,0,1
          FL_DCC =AUTO/CIRCLE,SHOWALLPARAMS = NO,SHOWHITS = NO
          THEO/-29.824,-32.689,84.896,0,0,1,81.8954
          ACTL/-29.824,-32.689,84.896,0,0,1,81.8954
          TARG/-29.824,-32.689,84.896,0,0,1
          FR_DCC =AUTO/CIRCLE,SHOWALLPARAMS = NO,SHOWHITS = NO
          THEO/33.923,-31.275,84.896,0,0,1,81.8954
          ACTL/33.923,-31.275,84.896,0,0,1,81.8954
          TARG/33.923,-31.275,84.896,0,0,1
          BR_DCC =AUTO/CIRCLE,SHOWALLPARAMS = NO,SHOWHITS = NO
          THEO/29.317,31.433,84.896,0,0,1,81.8954
          ACTL/29.317,31.433,84.896,0,0,1,81.8954
          TARG/29.317,31.433,84.896,0,0,1
          X_DCC =FEAT/LINE,RECT,UNBND
          THEO/-31.34,29.13,84.896,0.99928,0.0379403,0
          ACTL/-31.34,29.13,84.896,0.99928,0.0379403,0
          CONSTR/LINE,BF,2D,BL_DCC,BR_DCC,,
          OUTLIER_REMOVAL/OFF,3
          FILTER/OFF,WAVELENGTH=0
          DIAG1_DCC =FEAT/LINE,RECT,UNBND
          THEO/-31.34,29.13,84.896,0.7338935,-0.6792645,0
          ACTL/-31.34,29.13,84.896,0.7338935,-0.6792645,0
          CONSTR/LINE,BF,2D,BL_DCC,FR_DCC,,
          OUTLIER_REMOVAL/OFF,3
          FILTER/OFF,WAVELENGTH=0
          DIAG2_DCC =FEAT/LINE,RECT,UNBND
          THEO/-29.824,-32.689,84.896,0.6779796,0.7350807,0
          ACTL/-29.824,-32.689,84.896,0.6779796,0.7350807,0
          CONSTR/LINE,BF,2D,FL_DCC,BR_DCC,,
          OUTLIER_REMOVAL/OFF,3
          FILTER/OFF,WAVELENGTH=0
          MID_DCC =FEAT/POINT,RECT
          THEO/0.2368,-0.0964,84.896,0.6779796,0.7350807,0
          ACTL/0.2368,-0.0964,84.896,0.6779796,0.7350807,0
          CONSTR/POINT,INT,DIAG2_DCC,DIAG1_DCC
          ALIGN_DCC =ALIGNMENT/START,RECALL:MAN_ALIGN, LIST= YES
          ALIGNMENT/LEVEL,ZPLUS,TABLE
          ALIGNMENT/ROTATE,XPLUS,TO,X_DCC,ABOUT,ZPLUS
          ALIGNMENT/TRANS,XAXIS,MID_DCC
          ALIGNMENT/TRANS,YAXIS,MID_DCC
          ALIGNMENT/TRANS,ZAXIS,TABLE
          ALIGNMENT/END
          SCAN_DCC =FEAT/SCAN,LINEARCLOSE,SHOWHITS=NO,SHOWALLPARAMS=NO
          MEAS/SCAN
          BASICSCAN/LINE,SHOWHITS=NO,SHOWALLPARAMS=NO
          ENDSCAN
          ENDMEAS/
          COMMENT/DOC,NO,=========================================st art dimensions for x and y distance===================================
          ASSIGN/MAX_TOP_Y = MAXINDEX(SCAN_DCC.HIT[1..SCAN_DCC.NUMHITS].Y
          ASSIGN/MAX_Y = SCAN_DCC.HIT[MAX_TOP_Y].Y
          ASSIGN/MIN_TOP_Y = MININDEX(SCAN_DCC.HIT[1..SCAN_DCC.NUMHITS].Y
          ASSIGN/MIN_Y = SCAN_DCC.HIT[MIN_TOP_Y].Y
          ASSIGN/MAX_TOP_X = MAXINDEX(SCAN_DCC.HIT[1..SCAN_DCC.NUMHITS].X
          ASSIGN/MAX_X = SCAN_DCC.HIT[MAX_TOP_X].X
          ASSIGN/MIN_TOP_X = MININDEX(SCAN_DCC.HIT[1..SCAN_DCC.NUMHITS].X
          ASSIGN/MIN_X = SCAN_DCC.HIT[MIN_TOP_X].X
          COMMENT/DOC,NO,=========================================ca lculate x and y distance========================================== =====
          ASSIGN/X_DIST = MAX_X - MIN_X
          ASSIGN/Y_DIST = MAX_Y - MIN_Y
          COMMENT/DOC,NO,=======================================get diagonol dimensions======================================== =========
          Y_DCC =FEAT/LINE,RECT,UNBND
          THEO/-30.4453,30.4033,84.896,0.7075937,-0.7066195,0
          ACTL/-30.4453,30.4033,84.896,0.7075937,-0.7066195,0
          CONSTR/LINE,BF,2D,BL_DCC,FR_DCC,,
          OUTLIER_REMOVAL/OFF,3
          FILTER/OFF,WAVELENGTH=0
          ALIGN2_DCC =ALIGNMENT/START,RECALL:ALIGN_DCC, LIST= YES
          ALIGNMENT/LEVEL,ZPLUS,TABLE
          ALIGNMENT/ROTATE,YMINUS,TO,Y_DCC,ABOUT,ZPLUS
          ALIGNMENT/TRANS,XAXIS,MID_DCC
          ALIGNMENT/TRANS,YAXIS,MID_DCC
          ALIGNMENT/TRANS,ZAXIS,TABLE
          ALIGNMENT/END
          COMMENT/DOC,NO,====================================top diagonol dimensions======================================== =============
          ASSIGN/MAX_TOP_Y2 = MAXINDEX(SCAN_DCC.HIT[1..SCAN_DCC.NUMHITS].Y
          ASSIGN/MAX_Y2 = SCAN_DCC.HIT[MAX_TOP_Y2].Y
          ASSIGN/MIN_TOP_Y2 = MININDEX(SCAN_DCC.HIT[1..SCAN_DCC.NUMHITS].Y
          ASSIGN/MIN_Y2 = SCAN_DCC.HIT[MIN_TOP_Y2].Y
          ASSIGN/MAX_TOP_X2 = MAXINDEX(SCAN_DCC.HIT[1..SCAN_DCC.NUMHITS].X
          ASSIGN/MAX_X2 = SCAN_DCC.HIT[MAX_TOP_X2].X
          ASSIGN/MIN_TOP_X2 = MININDEX(SCAN_DCC.HIT[1..SCAN_DCC.NUMHITS].X
          ASSIGN/MIN_X2 = SCAN_DCC.HIT[MIN_TOP_X2].X
          COMMENT/DOC,NO,==============================calculate diagonol dimensions======================================== ===========
          ASSIGN/DIAG1 = MAX_X2 - MIN_X2
          ASSIGN/DIAG2 = MAX_Y2 - MIN_Y2
          COMMENT/DOC,NO,================================start alignment for 2nd part============================================== =====
          RECALL/ALIGNMENT,INTERNAL,ALIGN_DCC
          =AUTO/CIRCLE,SHOWALLPARAMS = NO,SHOWHITS = NO
          THEO/147.5677,26.5022,84.896,0,0,1,86.2275
          ACTL/147.5677,26.5022,84.896,0,0,1,86.2275
          TARG/147.5677,26.5022,84.896,0,0,1

          Comment


          • #6
            As I see it, you want to set up 4 parts and run all 4 in sequence. Thus enabling you to do other things instead of changing parts.
            There are a number of ways to do this. Looping with offsets is one, but there are some issues with that. You can also use VB to write code that will do this.
            PNiven's idea would work too. To me that would be tedious in the number of alignments you would need.
            I looked at your code (briefly) and don't see what direction you are heading.
            First step I would take is write the program for one part. After that you can start toying with loops and offsets.
            When in doubt, post code. A second set of eyes might see something you missed.
            sigpic

            Comment


            • #7
              Here is where I start programming the 1st part:

              COMMENT/OPER,NO,Arrange parts in a 2 x 2 formation
              COMMENT/OPER,NO,Take 6 hits on the table near the parts
              TABLE =FEAT/PLANE,RECT,TRIANGLE
              ENDMEAS/
              COMMENT/OPER,NO,Take 3 hits on the inside back left circle of the top left part.
              BL_MAN =FEAT/CIRCLE,RECT,IN,LEAST_SQR
              ENDMEAS/
              COMMENT/OPER,NO,Take 3 hits on the inside front left circle on the same part.
              FL_MAN =FEAT/CIRCLE,RECT,IN,LEAST_SQR
              ENDMEAS/
              COMMENT/OPER,NO,Take 3 hits on the inside front right circle of the same part.
              FR_MAN =FEAT/CIRCLE,RECT,IN,LEAST_SQR
              ENDMEAS/
              COMMENT/OPER,NO,Take 3 hits on the inside back right circle of the same part.
              BR_MAN =FEAT/CIRCLE,RECT,IN,LEAST_SQR
              ENDMEAS/
              X_MAN =FEAT/LINE,RECT,UNBND
              CONSTR/LINE,BF,2D,BL_MAN,BR_MAN,,
              DIAG1_MAN =FEAT/LINE,RECT,UNBND
              CONSTR/LINE,BF,2D,BL_MAN,FR_MAN,,
              DIAG2_MAN =FEAT/LINE,RECT,UNBND
              CONSTR/LINE,BF,2D,FL_MAN,BR_MAN,,
              MID_MAN =FEAT/POINT,RECT
              CONSTR/POINT,INT,DIAG2_MAN,DIAG1_MAN
              (Here is my manual alignment for the 1st part)
              MAN_ALIGN =ALIGNMENT/START,RECALL:STARTUP, LIST= YES
              ALIGNMENT/LEVEL,ZPLUS,TABLE
              ALIGNMENT/ROTATE,XPLUS,TO,X_MAN,ABOUT,ZPLUS
              ALIGNMENT/TRANS,XAXIS,MID_MAN
              ALIGNMENT/TRANS,YAXIS,MID_MAN
              ALIGNMENT/TRANS,ZAXIS,TABLE
              ALIGNMENT/END
              COMMENT/OPER,NO,DCC to begin!
              (DCC measurements for the 1st part)
              MODE/DCC
              BL_DCC =AUTO/CIRCLE,SHOWALLPARAMS = NO,SHOWHITS = NO
              FL_DCC =AUTO/CIRCLE,SHOWALLPARAMS = NO,SHOWHITS = NO
              FR_DCC =AUTO/CIRCLE,SHOWALLPARAMS = NO,SHOWHITS = NO
              BR_DCC =AUTO/CIRCLE,SHOWALLPARAMS = NO,SHOWHITS = NO
              X_DCC =FEAT/LINE,RECT,UNBND
              CONSTR/LINE,BF,2D,BL_DCC,BR_DCC,,
              DIAG1_DCC =FEAT/LINE,RECT,UNBND
              CONSTR/LINE,BF,2D,BL_DCC,FR_DCC,,
              DIAG2_DCC =FEAT/LINE,RECT,UNBND
              CONSTR/LINE,BF,2D,FL_DCC,BR_DCC,,
              MID_DCC =FEAT/POINT,RECT
              CONSTR/POINT,INT,DIAG2_DCC,DIAG1_DCC
              (DCC alinment for 1st part)
              ALIGN_DCC =ALIGNMENT/START,RECALL:MAN_ALIGN, LIST= YES
              ALIGNMENT/LEVEL,ZPLUS,TABLE
              ALIGNMENT/ROTATE,XPLUS,TO,X_DCC,ABOUT,ZPLUS
              ALIGNMENT/TRANS,XAXIS,MID_DCC
              ALIGNMENT/TRANS,YAXIS,MID_DCC
              ALIGNMENT/TRANS,ZAXIS,TABLE
              ALIGNMENT/END
              SCAN_DCC =FEAT/SCAN,LINEARCLOSE,SHOWHITS=NO,SHOWALLPARAMS=NO
              MEAS/SCAN
              BASICSCAN/LINE,SHOWHITS=NO,SHOWALLPARAMS=NO
              ENDSCAN
              ENDMEAS/
              (calculations for x and y distance)
              ASSIGN/MAX_TOP_Y = MAXINDEX(SCAN_DCC.HIT[1..SCAN_DCC.NUMHITS].Y
              ASSIGN/MAX_Y = SCAN_DCC.HIT[MAX_TOP_Y].Y
              ASSIGN/MIN_TOP_Y = MININDEX(SCAN_DCC.HIT[1..SCAN_DCC.NUMHITS].Y
              ASSIGN/MIN_Y = SCAN_DCC.HIT[MIN_TOP_Y].Y
              ASSIGN/MAX_TOP_X = MAXINDEX(SCAN_DCC.HIT[1..SCAN_DCC.NUMHITS].X
              ASSIGN/MAX_X = SCAN_DCC.HIT[MAX_TOP_X].X
              ASSIGN/MIN_TOP_X = MININDEX(SCAN_DCC.HIT[1..SCAN_DCC.NUMHITS].X
              ASSIGN/MIN_X = SCAN_DCC.HIT[MIN_TOP_X].X
              ASSIGN/X_DIST = MAX_X - MIN_X
              ASSIGN/Y_DIST = MAX_Y - MIN_Y
              (Calculations for diagonol dimensions)
              Y_DCC =FEAT/LINE,RECT,UNBND
              THEO/-30.4453,30.4033,84.896,0.7075937,-0.7066195,0
              ACTL/-30.4453,30.4033,84.896,0.7075937,-0.7066195,0
              CONSTR/LINE,BF,2D,BL_DCC,FR_DCC,,
              OUTLIER_REMOVAL/OFF,3
              FILTER/OFF,WAVELENGTH=0
              ALIGN2_DCC =ALIGNMENT/START,RECALL:ALIGN_DCC, LIST= YES
              ALIGNMENT/LEVEL,ZPLUS,TABLE
              ALIGNMENT/ROTATE,YMINUS,TO,Y_DCC,ABOUT,ZPLUS
              ALIGNMENT/TRANS,XAXIS,MID_DCC
              ALIGNMENT/TRANS,YAXIS,MID_DCC
              ALIGNMENT/TRANS,ZAXIS,TABLE
              ALIGNMENT/END
              ASSIGN/MAX_TOP_Y2 = MAXINDEX(SCAN_DCC.HIT[1..SCAN_DCC.NUMHITS].Y
              ASSIGN/MAX_Y2 = SCAN_DCC.HIT[MAX_TOP_Y2].Y
              ASSIGN/MIN_TOP_Y2 = MININDEX(SCAN_DCC.HIT[1..SCAN_DCC.NUMHITS].Y
              ASSIGN/MIN_Y2 = SCAN_DCC.HIT[MIN_TOP_Y2].Y
              ASSIGN/MAX_TOP_X2 = MAXINDEX(SCAN_DCC.HIT[1..SCAN_DCC.NUMHITS].X
              ASSIGN/MAX_X2 = SCAN_DCC.HIT[MAX_TOP_X2].X
              ASSIGN/MIN_TOP_X2 = MININDEX(SCAN_DCC.HIT[1..SCAN_DCC.NUMHITS].X
              ASSIGN/MIN_X2 = SCAN_DCC.HIT[MIN_TOP_X2].X
              ASSIGN/DIAG1 = MAX_X2 - MIN_X2
              ASSIGN/DIAG2 = MAX_Y2 - MIN_Y2
              (Here I recalled the DCC alignment so I can start programming the 2nd part) RECALL/ALIGNMENT,INTERNAL,ALIGN_DCC
              BL_2 =AUTO/CIRCLE,SHOWALLPARAMS = NO,SHOWHITS = NO
              THEO/147.5677,26.5022,84.896,0,0,1,86.2275
              ACTL/147.5677,26.5022,84.896,0,0,1,86.2275
              TARG/147.5677,26.5022,84.896,0,0,1
              etc... Continued to program the rest of the parts the same way)

              Comment


              • #8
                wouldn't it be easier to program the first one entirely and then copy and paste with pattern if you know the distance between the pieces?
                Packerbacker1

                Comment


                • #9


                  Wasn't this same question covered in this thread?
                  sigpic

                  Comment


                  • #10
                    Originally posted by ir a programmer View Post


                    Wasn't this same question covered in this thread?
                    I hadn't seen that......
                    When in doubt, post code. A second set of eyes might see something you missed.
                    sigpic

                    Comment

                    Related Topics

                    Collapse

                    Working...
                    X