Alignment that was made in a loop

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

  • Alignment that was made in a loop

    ISSUE SOLVED



    Please see comment #6. Thanks to all who weighed in, I really appreciate it.

    bfire85
    louisd
    __________________________________________________ __________________________________________________ ________________________________

    I have a program that measures ONE part. Now, I would like to loop that program to measure multiple parts.

    My method works for the part in position #1...I keep getting burned when I get to part position 2 and forwards. All works well until I recall an alignment. PC DMIS recalls A9 (for example) from the ORIGINAL part position, not A9[2] like it should be doing (to keep up with the loop). I try and type the bracket extension on there to make it A9[2] and PC DMIS just deletes it.

    The "A9" thing is just an example. I have numerous points in this program where this will be a problem.

    Is there a way I should be doing this or can you not make programs with looped alignments (which would just be downright f*cking insane IMO...)? Below is a small part of my program.

    Please advise.

    Thanks!

    Looping code
    Code:
    GROUP_COUNTPROMPT_AND_SERIALNUMBER=GROUP/SHOWALLPARAMS=YES
    COUNT_PROMPT   =COMMENT/INPUT,NO,FULL SCREEN=NO,
                  How many parts are you inspecting?
                  ASSIGN/TOTAL_PARTS=COUNT_PROMPT.INPUT
                  ASSIGN/SER=0
                  WHILE/SER<TOTAL_PARTS
                    ASSIGN/SER=SER+1
    SER_PROMPT     =COMMENT/INPUT,NO,FULL SCREEN=NO,
                    Please enter the Serial Number of the
                    "part at FIXTURE POSITION# "+SER+"."
        $$ NO,
                    ~
                    ~
                    ~
                    ADD STUFF RIGHT HERE TO LOCK DOWN THE NUMBER THEY'RE ALLOWED TO TYPE IN
                    FOR THE "SER_PROMPT" (ABOVE). LOOP BACK TO "SER_PROMPT" IF THEY MESS UP.
                    ~
                    ~
                    ~
                    ASSIGN/SER_NUM[SER]=SER_PROMPT.INPUT
                  END_WHILE/
                ENDGROUP/ID=GROUP_COUNTPROMPT_AND_SERIALNUMBER
                RECALL/ALIGNMENT,EXTERNAL,FIXT_ALN_FAKE
                ASSIGN/PALLET_POS[1]=MPOINT(0,0,0)
                ASSIGN/PALLET_POS[2]=MPOINT(6,0,0)
                ASSIGN/PALLET_POS[3]=MPOINT(12,0,0)
                ASSIGN/PALLET_POS[4]=MPOINT(0,6,0)
                ASSIGN/PALLET_POS[5]=MPOINT(6,6,0)
                ASSIGN/PALLET_POS[6]=MPOINT(12,6,0)
                ASSIGN/PALLET_POS[7]=MPOINT(0,12,0)
                ASSIGN/PALLET_POS[8]=MPOINT(6,12,0)
                ASSIGN/PALLET_POS[9]=MPOINT(12,12,0)
    LOOP_X_AXIS=LOOP/START,ID=YES,NUMBER=TOTAL_PARTS,START=1,SKIP=,
                  OFFSET:XAXIS=6,YAXIS=0,ZAXIS=0,ANGLE=0
                  ASSIGN/CURR_POS=0
                  ASSIGN/CURR_POS=CURR_POS+1
                  COMMENT/REPT,
                  "Serial Number: "+SER_NUM[CURR_POS]
                  ASSIGN/PO=PALLET_POS[CURR_POS]
    PO_PNT       =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                  NOM/XYZ,<0*1,0*1,0*1>,$
                  MEAS/XYZ,<PO.X,PO.Y,PO.Z>,$
                  NOM/IJK,<0*1,0*1,1*1>,$
                  MEAS/IJK,<0*1,0*1,1*1>
    A1_INIT_ALN  =ALIGNMENT/START,RECALL:FIXT_ALN_FAKE,LIST=YES
                    ALIGNMENT/TRANS,XAXIS,PO_PNT
                    ALIGNMENT/TRANS,YAXIS,PO_PNT
                    ALIGNMENT/TRANS,ZAXIS,PO_PNT
                  ALIGNMENT/END
    It will try to go to rad_44_1 at pallet position 1 because it recalls A9...NOT A9[2]
    Code:
    PNT8         =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                  THEO/<0,1.0325,-0.68>,<0,-1,0>
                  ACTL/<0,1.0325,-0.68>,<0,-1,0>
                  TARG/<0,1.0325,-0.68>,<0,-1,0>
                  SNAP=NO
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=NO
    LIN8         =FEAT/LINE,CARTESIAN,UNBOUNDED,NO
                  THEO/<0,1.0325,-0.65>,<0,0,-1>
                  ACTL/<0,1.0325,-0.65>,<0,0,-1>
                  CONSTR/LINE,BF,2D,PNT7,PNT8,,
                  OUTLIER_REMOVAL/OFF,3
                  FILTER/OFF,WAVELENGTH=0
                  WORKPLANE/ZPLUS
                  RECALL/ALIGNMENT,INTERNAL,A9
    RAD_44_1     =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                  THEO/<0,0,-0.815>,<0,0,1>,2.27
                  ACTL/<0,0,-0.815>,<0,0,1>,2.27
                  TARG/<0,0,-0.815>,<0,0,1>
                  START ANG=60.0003,END ANG=120.0003
                  ANGLE VEC=<1,0,0>
                  DIRECTION=CCW
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=NO
    Last edited by DAN_M; 01-08-2020, 09:50 AM.

  • #2
    What is your A9 alignment?

    Comment


    • DAN_M
      DAN_M commented
      Editing a comment
      A9 is just a simple alignment.

      The issue is that when I am within the second loop, and then I recall A9 (or any alignment for that matter..A9 was selected as an example) it goes to pallet position 1’s A9 instead of being six inches over like it’s supposed to be

  • #3
    I think what you are trying to do won't work in the PC-DMIS built loop. Maybe try Josh's method in the link below. I have done this in the past and it works well.

    https://www.pcdmisforum.com/forum/pc...pping-stations

    Comment


    • #4
      you gotta move the initial definition of
      Code:
       ASSIGN/CURR_POS=0
      outside (above) the loop, silly.

      I'm not sure if the loop will grab each PALLET_POS[array instance] according to your plan. give it a shot, let us know.
      Last edited by louisd; 01-07-2020, 06:25 PM.

      Comment


      • #5
        I think it has to do with the:

        Code:
        ASSIGN/PO=PALLET_POS[CURR_POS]
        With running assignments added to assignments, you need the "+ code, but that may not work with the brackets.

        Can't you run a CASE or a IF/ELSE_IF flow control instead?

        Comment


        • #6
          Hey, I've got it figured out. Many thanks to all who commented. I followed the link provided by bfire85 (a million thanks to the Legend, Josh Carpenter) and came up with this:

          Serial Number loop:
          Code:
          GROUP_COUNTPROMPT_AND_SERIALNUMBER=GROUP/SHOWALLPARAMS=YES
          COUNT_PROMPT   =COMMENT/INPUT,NO,FULL SCREEN=NO,
                        How many parts are you inspecting?
                        ASSIGN/TOTAL_PARTS=COUNT_PROMPT.INPUT
                        ASSIGN/SER=0
                        WHILE/SER<TOTAL_PARTS
                          ASSIGN/SER=SER+1
          SER_PROMPT     =COMMENT/INPUT,NO,FULL SCREEN=NO,
                          Please enter the Serial Number of the
                          "part at FIXTURE POSITION# "+SER+"."
          RUN_PROMPT     =COMMENT/INPUT,NO,FULL SCREEN=NO,
                          Please enter the Run Number of the
                          "part at FIXTURE POSITION# "+SER+"."
                          ASSIGN/SER_NUM[SER]=SER_PROMPT.INPUT
                          ASSIGN/RUN_NUM[SER]=RUN_PROMPT.INPUT
                        END_WHILE/
                      ENDGROUP/ID=GROUP_COUNTPROMPT_AND_SERIALNUMBER
          Beginning of program:
          Code:
                      RECALL/ALIGNMENT,EXTERNAL,FIXT_ALN_FAKE
                      ASSIGN/CURR_POS=0
                      DO/
                        ASSIGN/CURR_POS=CURR_POS+1
                        COMMENT/REPT,
                        "Serial Number: "+SER_NUM[CURR_POS]
                        COMMENT/REPT,
                        "Run Number: "+RUN_NUM[CURR_POS]
                        ASSIGN/PROG_NAME=GETPROGRAMINFO ("PARTNAME")
                        ASSIGN/REPORT_NAME="C:\\USERS\\z03236\\DESKTOP\\___PALLET_PROGRAM_SAMPLE\\"+PROG_NAME+"__"+SER_NUM[CURR_POS]+"-.PDF"
                        IF/CURR_POS==1
                          ASSIGN/FIXT_X=0
                          ASSIGN/FIXT_Y=0
                          ASSIGN/FIXT_Z=0
                        END_IF/
                        IF/CURR_POS==2
                          ASSIGN/FIXT_X=6
                          ASSIGN/FIXT_Y=0
                          ASSIGN/FIXT_Z=0
                        END_IF/
                        IF/CURR_POS==3
                          ASSIGN/FIXT_X=12
                          ASSIGN/FIXT_Y=0
                          ASSIGN/FIXT_Z=0
                        END_IF/
                        IF/CURR_POS==4
                          ASSIGN/FIXT_X=0
                          ASSIGN/FIXT_Y=6
                          ASSIGN/FIXT_Z=0
                        END_IF/
                        IF/CURR_POS==5
                          ASSIGN/FIXT_X=6
                          ASSIGN/FIXT_Y=6
                          ASSIGN/FIXT_Z=0
                        END_IF/
                        IF/CURR_POS==6
                          ASSIGN/FIXT_X=12
                          ASSIGN/FIXT_Y=6
                          ASSIGN/FIXT_Z=0
                        END_IF/
          PO_PNT       =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                        NOM/XYZ,<0+0,0+0,0+0>,$
                        MEAS/XYZ,<FIXT_X,FIXT_Y,FIXT_Z>,$
                        NOM/IJK,<0+0,0+0,0+0>,$
                        MEAS/IJK,<0+0,0+0,0+0>
          A1_INIT_ALN  =ALIGNMENT/START,RECALL:FIXT_ALN_FAKE,LIST=YES
                          ALIGNMENT/TRANS,XAXIS,PO_PNT
                          ALIGNMENT/TRANS,YAXIS,PO_PNT
                          ALIGNMENT/TRANS,ZAXIS,PO_PNT
                        ALIGNMENT/END
                        MODE/DCC
                        WORKPLANE/ZPLUS
                        MOVESPEED/ 300*0.9
                        TOUCHSPEED/ 10
                        PREHIT/1
                        RETRACT/1
                        CHECK/1,1
          CIRXY1       =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                        THEO/<0+0,0+0,0+0>,<0,0,1>,2.3642
                        ACTL/<0,0,0>,<0,0,1>,2.3642
                        TARG/<0,0,0>,<0,0,1>
                        START ANG=0,END ANG=360
                        ANGLE VEC=<1,0,0>
                        DIRECTION=CCW
                        SHOW FEATURE PARAMETERS=NO
                        SHOW CONTACT PARAMETERS=NO
          A2           =ALIGNMENT/START,RECALL:A1_INIT_ALN,LIST=YES
                          ALIGNMENT/TRANS,XAXIS,CIRXY1
                          ALIGNMENT/TRANS,YAXIS,CIRXY1
                        ALIGNMENT/END
                        MOVESPEED/ 300*0.9
                        TOUCHSPEED/ 5
                        PREHIT/0.125
                        RETRACT/0.125
                        CHECK/0.125,1
          CIRXY2       =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                        THEO/<0+0,0+0,0+0>,<0,0,1>,2.3642
                        ACTL/<0,0,0>,<0,0,1>,2.3642
                        TARG/<0,0,0>,<0,0,1>
                        START ANG=-120,END ANG=240
                        ANGLE VEC=<1,0,0>
                        DIRECTION=CCW
                        SHOW FEATURE PARAMETERS=NO
                        SHOW CONTACT PARAMETERS=NO
          A3           =ALIGNMENT/START,RECALL:A2,LIST=YES
                          ALIGNMENT/TRANS,XAXIS,CIRXY2
                          ALIGNMENT/TRANS,YAXIS,CIRXY2
                        ALIGNMENT/END
                        MOVESPEED/ 300*0.9
                        TOUCHSPEED/ 5
                        PREHIT/0.25
                        RETRACT/0.05
                        CHECK/0.25,1
                        MOVE/INCREMENT,<0+0,0+0,1+0>
          PNTZ1        =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                        THEO/<-1.2325+0,0.262+0,0.0899+0>,<0,0,1>
                        ACTL/<-1.2325,0.262,0.0899>,<0,0,1>
                        TARG/<-1.2325,0.262,0.0899>,<0,0,1>
                        SNAP=NO
                        SHOW FEATURE PARAMETERS=NO
                        SHOW CONTACT PARAMETERS=NO
          Settings that MUST BE CORRET OR THIS WON'T WORK:
          1) In F5, "TREAT THEO VALUES AS IF STORED IN PART COORDINATES" must NOT be checked
          2) In F5, "UPDATE THEORETICAL VALUES WHILE IN LOOPS" must NOT be checked
          3) In Report Settings, "ALWAYS" must be selected in the dropdown menu
          4) EVERY SINGLE VALUE IN A "THEO" FIELD, EVERY SINGLE TYPE OF MOVE, MUST HAVE A +0 AFTER IT TO LOCK IT DOWN
          Last edited by DAN_M; 01-08-2020, 09:50 AM.

          Comment


          • #7
            for #4, if you are making any modifications to the loop, you must set the loop value to 1, otherwise yes your nominals get changed to reflect last loop iteration coordinates. Typically what I do before touching loops is executing routine with loop value at 1 offline, saving as, then make changes. once changes are confirmed to be as-desired, i set loop value back to variable # and save. Set file as read-only afterwards.

            Comment

            Related Topics

            Collapse

            Working...
            X