Looping with serial numbers going on insp reports

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

  • Looping with serial numbers going on insp reports

    Hi all,

    Using 2019 R1..

    Currently I only measure one part at a time. Going forward, we're getting a fixture plate & they want the plate loaded up with as many parts as possible. My company wants me to come up with a code that I can insert in the beginning of my programs. The hope is that this code that will macro the program over and back (based off of operator input questions)... while printing out insp reports with the correct serial number on it... all while ensuring PC DMIS is sending all of those insp reports to a network location to be saved as a PDF. Sorry for that mouth full.

    Can someone help me out? I'm totally feeling around in the dark here. I know others have done this before and I'm hoping to see some examples that have been successful. Thank you very much.


    -Dan



  • #2
    Do you have any of this accomplished yet? Assigning a path to a variable using the S/N input from an operator, then printing to a file using that variable is one aspect. Looping is another aspect.

    Are you doing any of this yet?
    PC-DMIS 2016.0 SP8

    Jeff

    Comment


    • #3
      What you are asking for is like asking a doctor for a dozen prescriptions at once.
      We'd need to assess/guide you through each one. Speaking frankly, this is taught, very effectively, in HexagonU classes much better than we can toss it all together in posts.
      But if you want to dive into this head first, here's an entire looped routine with pretty much all you are looking for. decode it, understand it, and its free. Don't hit your head on the bottom of the pool. lol.

      Code:
               MOVESPEED/ 100
                  LOADPROBE/1MM STAR
                  TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=0
                  FORMAT/TEXT,OPTIONS, ,HEADINGS,SYMBOLS, ;NOM,TOL,MEAS,DEV,OUTTOL, ,
                  DISPLAYPRECISION/4
                  TOUCHSPEED/ 2
                  PREHIT/0.15
                  RETRACT/0.15
                  FLY/ON,0.1
      $$ NO,
                  Management of Change:
                  --------------------------------------------------------------------------------
                  12JUN19 LD routine started from scratch
                  17JUN19 LD added axis line as level plane.  rotate to top only (not midline).  Increased distance of id lines from center by 0.005" (0.050" to 0.055")
                  ASSIGN/T_PATH="T:\MEASURLINK_TRANSFER\CMM CM-004\part_DIM102_IMPORT.CSV"
                  ASSIGN/C_PATH="C:\PRODUCTION\MERIDIAN\COLLET\part_DIM102.CSV"
                  ASSIGN/C_TEMP="C:\PRODUCTION\C_TRANSFER\part_DIM102.CSV"
                  ASSIGN/PART="part_"
                  ASSIGN/ROUTINE="part_CMM DIM102"
                  ASSIGN/TRACE_FOLDER="Traceability-part_CMM"
                  ASSIGN/CHAR_1="102.1 Position "
                  ASSIGN/CHAR_2="102.2 Position "
                  ASSIGN/CHAR_3="102.3 Position "
                  ASSIGN/CHAR_4="102.4 Position "
      TFILE_CHECK=FILE/EXISTS,T_PATH
                  IF/TFILE_CHECK==1
                  FILE/DELETE,T_PATH
                  END_IF/
      CFILE_CHECK=FILE/EXISTS,C_TEMP
                  IF/CFILE_CHECK==1
                  FILE/DELETE,C_TEMP
                  END_IF/
      QTYQUESTION=LABEL/
      QTY        =COMMENT/INPUT,NO,FULL SCREEN=YES,
                  How many parts
                  are in this shot?
                  IF/!(QTY.INPUT>=1 AND QTY.INPUT<9)
                  COMMENT/OPER,NO,FULL SCREEN=YES,AUTO-CONTINUE=NO,
                  Invalid input! Please input
                  a value between 1 and 8.
                  GOTO/QTYQUESTION
                  END_IF/
      LOT_NUM    =COMMENT/INPUT,NO,FULL SCREEN=YES,
                  'Lot#?'
      CAV_1      =COMMENT/INPUT,NO,FULL SCREEN=YES,
                  'What cavity is in
                  station 1?'
                  IF_GOTO/QTY.INPUT==1,GOTO = CONTINUE
      **CODE TRUNCATED, REPEAT UNTIL CAV_8***
      CAV_8      =COMMENT/INPUT,NO,FULL SCREEN=YES,
                  'What cavity is in
                  station 8?'
      CONTINUE   =LABEL/
      USER       =COMMENT/INPUT,NO,FULL SCREEN=YES,
                  'Operator?'
      SCHEDULE   =COMMENT/INPUT,NO,FULL SCREEN=YES,
                  'Scheduled inspection time?'
                  ASSIGN/RUN_ID=LOT_NUM.INPUT
                  ASSIGN/OPERATOR=USER.INPUT
                  ASSIGN/TIME=SCHEDULE.INPUT
      C_FILE     =FILE/OPEN,C_PATH,APPEND
                  FILE/WRITELINE,C_FILE,"/PART NUMBER/" + "," + PART
                  FILE/WRITELINE,C_FILE,"/ROUTINE NAME/" + "," + ROUTINE
                  FILE/WRITELINE,C_FILE,"/LOT#/" + "," + RUN_ID
                  FILE/WRITELINE,C_FILE,"/OPERATOR/" + "," + TRACE_FOLDER + "," + "Operator" + "," + OPERATOR
                  FILE/WRITELINE,C_FILE,"/SCHEDULED TIME/" + "," + TRACE_FOLDER + "," + "Scheduled Time" + "," + TIME
                  FILE/CLOSE,C_FILE,KEEP
      C1         =COMMENT/INPUT,NO,FULL SCREEN=YES,
                  'Does the fixture need to be aligned?
                  1)Yes
                  2)No'
                  IF_GOTO/C1.INPUT==1,GOTO = MAN_ALN
                  IF_GOTO/C1.INPUT==2,GOTO = MDE_DCC
      MAN_ALN    =LABEL/
                  MODE/MANUAL
                  COMMENT/OPER,NO,FULL SCREEN=YES,AUTO-CONTINUE=NO,
                  REMOVE PART SAMPLES. Measure a 3 point plane on bottom base
      MANBASE    =FEAT/PLANE,CARTESIAN,TRIANGLE
                  THEO/<2.2218,0,0.5307>,<0,1,0>
                  ACTL/<18.2983,23.439,-31.4172>,<-0.0016098,-0.0000342,0.9999987>
                  MEAS/PLANE,3
                  HIT/BASIC,NORMAL,<-4.4207,0,1.3214>,<0,1,0>,<17.3675,30.2633,-31.4184>,USE THEO=YES
                  HIT/BASIC,NORMAL,<5.5147,0,1.326>,<0,1,0>,<17.3675,20.0228,-31.4188>,USE THEO=YES
                  HIT/BASIC,NORMAL,<5.5715,0,-1.0554>,<0,1,0>,<20.16,20.0309,-31.4143>,USE THEO=YES
                  ENDMEAS/
      A12        =ALIGNMENT/START,RECALL:USE_PART_SETUP,LIST=YES
                  ALIGNMENT/LEVEL,ZPLUS,MANBASE
                  ALIGNMENT/TRANS,ZAXIS,MANBASE
                  ALIGNMENT/END
                  COMMENT/OPER,NO,FULL SCREEN=YES,AUTO-CONTINUE=NO,
                  Measure a two point line on the right side of the fixture, closest to farthest
      MANROTATE  =FEAT/LINE,CARTESIAN,UNBOUNDED
                  THEO/<-5.4577,-1.5,-0.2656>,<1,0.0000004,0>
                  ACTL/<20.1854,20.0298,-0.0339>,<0.000038,1,0>
                  MEAS/LINE,2,ZPLUS
                  HIT/BASIC,NORMAL,<-5.4577,-1.5,-0.2356>,<0.0000004,-1,0>,<20.1854,20.0298,-0.0337>,USE THEO=YES
                  HIT/BASIC,NORMAL,<5.519,-1.5,-0.2957>,<0.0000004,-1,0>,<20.1858,30.9248,-0.034>,USE THEO=YES
                  ENDMEAS/
      A13        =ALIGNMENT/START,RECALL:USE_ACTIVE_ALIGNMENT(A12),LIST=YES
                  ALIGNMENT/ROTATE,YPLUS,TO,MANROTATE,ABOUT,ZPLUS
                  ALIGNMENT/TRANS,XAXIS,MANROTATE
                  ALIGNMENT/END
                  COMMENT/OPER,NO,FULL SCREEN=YES,AUTO-CONTINUE=NO,
                  Take a single point on front edge of fixture, close to right corner
      MANZERO    =FEAT/POINT,CARTESIAN
                  THEO/<-0.179,-5.875,-0.1965>,<0,-1,0>
                  ACTL/<-0.1364,19.6249,-0.1229>,<0,-1,0>
                  MEAS/POINT,1,WORKPLANE
                  HIT/BASIC,NORMAL,<-0.179,-5.875,-0.1965>,<0,-1,0>,<-0.1364,19.6249,-0.1229>,USE THEO=YES
                  ENDMEAS/
      MANALIGN   =ALIGNMENT/START,RECALL:USE_ACTIVE_ALIGNMENT(A13),LIST=YES
                  ALIGNMENT/TRANS,YAXIS,MANZERO
                  ALIGNMENT/END
                  COMMENT/OPER,NO,FULL SCREEN=YES,AUTO-CONTINUE=YES,TIME DELAY=5,
                  CMM will now run its own alignment!
      DCC_ALIGN  =LABEL/
                  MODE/DCC
                  CLEARP/ZPLUS,5.5,ZPLUS,5.5,OFF
                  MOVE/CLEARPLANE
      DCCBASE    =FEAT/PLANE,CARTESIAN,OUTLINE
                  THEO/<-1.5208,5.8796,0>,<0,0,1>
                  ACTL/<-1.5208,5.8796,-0.0008>,<0.0005394,0.0002466,0.9999998>
                  MEAS/PLANE,4
                  HIT/BASIC,NORMAL,<-0.1671,2.9126,0>,<0,0,1>,<-0.1671,2.9125,-0.0003>,USE THEO=YES
                  HIT/BASIC,NORMAL,<-0.1678,8.8785,0>,<0,0,1>,<-0.1678,8.8785,-0.0027>,USE THEO=YES
                  MOVE/CLEARPLANE
                  HIT/BASIC,NORMAL,<-2.8954,8.8129,0>,<0,0,1>,<-2.8953,8.8129,-0.0003>,USE THEO=YES
                  HIT/BASIC,NORMAL,<-2.853,2.9143,0>,<0,0,1>,<-2.853,2.9143,0.0002>,USE THEO=YES
                  ENDMEAS/
      A1         =ALIGNMENT/START,RECALL:USE_ACTIVE_ALIGNMENT(MANALIGN),LIST=YES
                  ALIGNMENT/TRANS,ZAXIS,DCCBASE
                  ALIGNMENT/LEVEL,ZPLUS,DCCBASE
                  ALIGNMENT/END
                  MOVE/CLEARPLANE
      DCCROTATEPNT1=FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                  THEO/<0,0.15,-0.1>,<1,0.0000001,0>
                  ACTL/<0.0002,0.1501,-0.1>,<1,0.0000001,0>
                  TARG/<0,0.15,-0.1>,<1,0.0000001,0>
                  SNAP=NO
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=NO
                  MOVE/CLEARPLANE
      DCCROTATEPNT2=FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                  THEO/<0,11.6,-0.1>,<1,0.0000001,0>
                  ACTL/<0.0002,11.6,-0.1>,<1,0.0000001,0>
                  TARG/<0,11.6,-0.1>,<1,0.0000001,0>
                  SNAP=NO
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=NO
      DCCROTATE1 =FEAT/LINE,CARTESIAN,UNBOUNDED,NO
                  THEO/<0,0.15,-0.1>,<-0.0000001,1,0>
                  ACTL/<0.0002,0.1501,-0.1>,<-0.0000002,1,0>
                  CONSTR/LINE,BF,2D,DCCROTATEPNT1,DCCROTATEPNT2,,
                  OUTLIER_REMOVAL/OFF,3
                  FILTER/OFF,WAVELENGTH=0
      A2         =ALIGNMENT/START,RECALL:USE_ACTIVE_ALIGNMENT(A1),LIST=YES
                  ALIGNMENT/TRANS,XAXIS,DCCROTATE1
                  ALIGNMENT/ROTATE,YPLUS,TO,DCCROTATE1,ABOUT,ZPLUS
                  ALIGNMENT/END
                  MOVE/CLEARPLANE
      DCCZERO    =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                  THEO/<-0.25,0,-0.1>,<0,-1,0>
                  ACTL/<-0.25,-0.0001,-0.1>,<0,-1,0>
                  TARG/<-0.25,0,-0.1>,<0,-1,0>
                  SNAP=YES
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=NO
      DCC_FIXT_ALIGN=ALIGNMENT/START,RECALL:USE_ACTIVE_ALIGNMENT(A2),LIST=YES
                  ALIGNMENT/TRANS,YAXIS,DCCZERO
                  ALIGNMENT/END
                  MOVE/CLEARPLANE
                  MOVE/POINT,NORMAL,<-4.0000,14.0000,12.0000>
                  COMMENT/OPER,NO,FULL SCREEN=YES,AUTO-CONTINUE=NO,
                  Please Load parts!
                  MOVE/INCREMENT,<-9,0,0>
      MDE_DCC    =LABEL/
                  MODE/DCC
      INI_A16_1  =ALIGNMENT/START,RECALL:USE_ACTIVE_ALIGNMENT(DCC_FIXT_ALIGN),LIST=YES
                  ALIGNMENT/END
                  MOVE/CLEARPLANE
                  TIP/T1A90B90, SHANKIJK=-1, -0.0003, -0.0004, ANGLE=90.0047
                  WORKPLANE/XPLUS
      V1         =LOOP/START,ID=YES,NUMBER=QTY.INPUT,START=1,SKIP=,
                    OFFSET:XAXIS=0,YAXIS=1.5,ZAXIS=0,ANGLE=0
                  IF/V1==1
                  ASSIGN/POS=CAV_1.INPUT
                  END_IF/
                  IF/V1==2
                  ASSIGN/POS=CAV_2.INPUT
                  END_IF/
                  IF/V1==3
                  ASSIGN/POS=CAV_3.INPUT
                  END_IF/
                  IF/V1==4
                  ASSIGN/POS=CAV_4.INPUT
                  END_IF/
                  IF/V1==5
                  ASSIGN/POS=CAV_5.INPUT
                  END_IF/
                  IF/V1==6
                  ASSIGN/POS=CAV_6.INPUT
                  END_IF/
                  IF/V1==7
                  ASSIGN/POS=CAV_7.INPUT
                  END_IF/
                  IF/V1==8
                  ASSIGN/POS=CAV_8.INPUT
                  END_IF/
                  WORKPLANE/ZPLUS

      Comment


      • #4
        Code:
        $$ NO,
                    **************************************************Program will locate initial alignment for each part**************************************************
        INI_A16_2  =ALIGNMENT/START,RECALL:USE_ACTIVE_ALIGNMENT(INI_A16_1),LIST=YES
                    ALIGNMENT/END
                    MOVE/CLEARPLANE
                    PREHIT/0.1
                    RETRACT/0.1
                    WORKPLANE/XPLUS
        INIT_FINDYZ=FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,OUT,LEAST_SQR
                    THEO/<-3,0.6232,3.9502>,<-1,0,0>,0.1584,0
                    ACTL/<-3,0.6232,3.9502>,<-1,0,0>,0.1584,0
                    TARG/<-3,0.6232,3.9502>,<-1,0,0>
                    START ANG=45,END ANG=315
                    ANGLE VEC=<0,-1,0>
                    DIRECTION=CCW
                    SHOW FEATURE PARAMETERS=NO
                    SHOW CONTACT PARAMETERS=NO
        A3         =ALIGNMENT/START,RECALL:USE_ACTIVE_ALIGNMENT(INI_A16_2),LIST=YES
                    ALIGNMENT/TRANS,YAXIS,INIT_FINDYZ
                    ALIGNMENT/TRANS,ZAXIS,INIT_FINDYZ
                    ALIGNMENT/END
                    MOVE/INCREMENT,<-0.1,0,0>
        INIT_FINDX =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                    THEO/<-3.02,0,0.061>,<-1,0,0>
                    ACTL/<-3.02,0,0.061>,<-1,0,0>
                    TARG/<-3.02,0,0.061>,<-1,0,0>
                    SNAP=NO
                    SHOW FEATURE PARAMETERS=NO
                    SHOW CONTACT PARAMETERS=NO
        A4         =ALIGNMENT/START,RECALL:USE_ACTIVE_ALIGNMENT(A3),LIST=YES
                    ALIGNMENT/TRANS,XAXIS,INIT_FINDX
                    ALIGNMENT/END
                    PREHIT/0.05
                    RETRACT/0.05
        ID1        =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                    THEO/<0.03,0,0>,<-1,0,0>,0.0985
                    ACTL/<0.03,0,0>,<-1,0,0>,0.0985
                    TARG/<0.03,0,0>,<-1,0,0>
                    START ANG=360,END ANG=360
                    ANGLE VEC=<0,-1,0>
                    DIRECTION=CCW
                    SHOW FEATURE PARAMETERS=NO
                    SHOW CONTACT PARAMETERS=NO
        A5         =ALIGNMENT/START,RECALL:USE_ACTIVE_ALIGNMENT(A4),LIST=YES
                    ALIGNMENT/TRANS,YAXIS,ID1
                    ALIGNMENT/TRANS,ZAXIS,ID1
                    ALIGNMENT/END
                    MOVE/INCREMENT,<-0.12,0,0>
        FRONT_PLANE=FEAT/CONTACT/PLANE/DEFAULT,CARTESIAN,OUTLINE
                    THEO/<0,0,0>,<-1,0,0>
                    ACTL/<0,0,0>,<-1,0,0>
                    TARG/<0,0,0>,<-1,0,0>
                    ANGLE VEC=<0,-1,0>,RADIAL
                    SHOW FEATURE PARAMETERS=NO
                    SHOW CONTACT PARAMETERS=NO
        INIT_ALIGN =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
                    ALIGNMENT/LEVEL,XMINUS,FRONT_PLANE
                    ALIGNMENT/ROTATE,ZPLUS,TO,DCCBASE,ABOUT,XMINUS
                    ALIGNMENT/TRANS,YAXIS,ID1
                    ALIGNMENT/TRANS,ZAXIS,ID1
                    ALIGNMENT/TRANS,XAXIS,FRONT_PLANE
                    ALIGNMENT/END
                    MOVE/INCREMENT,<0,0,0.2>
        INIT_ROTLINE2=FEAT/CONTACT/LINE/DEFAULT,CARTESIAN,UNBOUNDED
                    THEO/<0.148,-0.06,0.0795>,<0,1,0>,<0,0,1>,<1,0,0>,0.12
                    ACTL/<0.148,-0.06,0.0795>,<0,1,0>,<0,0,1>,<1,0,0>,0.12
                    TARG/<0.148,-0.06,0.0795>,<0,1,0>,<0,0,1>,<1,0,0>
                    SHOW FEATURE PARAMETERS=NO
                    SHOW CONTACT PARAMETERS=NO
        A6         =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
                    ALIGNMENT/LEVEL,XMINUS,FRONT_PLANE
                    ALIGNMENT/ROTATE,YPLUS,TO,INIT_ROTLINE2,ABOUT,XMINUS
                    ALIGNMENT/TRANS,YAXIS,ID1
                    ALIGNMENT/TRANS,ZAXIS,ID1
                    ALIGNMENT/TRANS,XAXIS,FRONT_PLANE
                    ALIGNMENT/END
                    MOVE/INCREMENT,<-0.3,0,0>
                    MOVE/INCREMENT,<0,0,-0.13>
        ******CODE TRUNCATED TO FIT IN POST******
        OD_LINE3   =FEAT/CONTACT/LINE/DEFAULT,CARTESIAN,UNBOUNDED
                    THEO/<0.148,0.0792,-0.0069>,<0,-0.0436,-0.999>,<0,0.9990482,-0.0436193>,<1,0,0>,0.05
                    ACTL/<0.148,0.0792,-0.0069>,<0,-0.0436,-0.999>,<0,0.9990482,-0.0436193>,<1,0,0>,0.05
                    TARG/<0.148,0.0792,-0.0069>,<0,-0.0436,-0.999>,<0,0.9990482,-0.0436193>,<1,0,0>
                    SHOW FEATURE PARAMETERS=NO
                    SHOW CONTACT PARAMETERS=NO
        OD_POINT_1 =FEAT/POINT,CARTESIAN,NO
                    THEO/<0.148,-0.0798,0>,<0,-0.0871557,0.9961947>
                    ACTL/<0.148,-0.0798,0>,<0,-0.0871557,0.9961947>
                    CONSTR/POINT,INT,OD_LINE1,OD_LINE2
        OD_POINT_2 =FEAT/POINT,CARTESIAN,NO
                    THEO/<0.148,0.0796,0.0023>,<0,0.0871557,-0.9961947>
                    ACTL/<0.148,0.0796,0.0023>,<0,0.0871557,-0.9961947>
                    CONSTR/POINT,INT,OD_LINE4,OD_LINE3
                    MOVE/INCREMENT,<0,0,1.2>
                    TIP/T2A90B90, SHANKIJK=-0.0004, 0.0001, 1, ANGLE=90.0197
                    MOVE/INCREMENT,<1,-0.15,0>
        A7         =ALIGNMENT/START,RECALL:PART_ALIGN_6DOF,LIST=YES
                    ALIGNMENT/END
                    PREHIT/0.035
                    RETRACT/0.035
        ID_LINE1   =FEAT/CONTACT/LINE/DEFAULT,CARTESIAN,UNBOUNDED
                    THEO/<0.148,0.0466,0.053>,<0,-0.0436,-0.999>,<0,-0.9990482,0.0436194>,<-1,0,0>,0.025
                    ACTL/<0.148,0.0466,0.053>,<0,-0.0436,-0.999>,<0,-0.9990482,0.0436194>,<-1,0,0>,0.025
                    TARG/<0.148,0.0466,0.053>,<0,-0.0436,-0.999>,<0,-0.9990482,0.0436194>,<-1,0,0>
                    SHOW FEATURE PARAMETERS=NO
                    SHOW CONTACT PARAMETERS=NO
        ID_PNT1    =FEAT/POINT,CARTESIAN,NO
                    THEO/<0.148,0.0452,0.0197>,<0,-0.0436194,-0.9990482>
                    ACTL/<0.148,0.0452,0.0196>,<0,-0.0436194,-0.9990482>
                    CONSTR/POINT,PIERCE,ID_LINE1,ID2
        ID_LINE2   =FEAT/CONTACT/LINE/DEFAULT,CARTESIAN,UNBOUNDED
                    THEO/<0.148,0.0466,-0.053>,<0,-0.0436,0.999>,<0,-0.9990482,-0.0436194>,<-1,0,0>,0.025
                    ACTL/<0.148,0.0466,-0.053>,<0,-0.0436,0.999>,<0,-0.9990482,-0.0436194>,<-1,0,0>,0.025
                    TARG/<0.148,0.0466,-0.053>,<0,-0.0436,0.999>,<0,-0.9990482,-0.0436194>,<-1,0,0>
                    SHOW FEATURE PARAMETERS=NO
                    SHOW CONTACT PARAMETERS=NO
        ID_PNT2    =FEAT/POINT,CARTESIAN,NO
                    THEO/<0.148,0.0452,-0.0197>,<0,-0.0436194,0.9990482>
                    ACTL/<0.148,0.0452,-0.0196>,<0,-0.0436194,0.9990482>
                    CONSTR/POINT,PIERCE,ID_LINE2,ID2
        ID_LINE3   =FEAT/CONTACT/LINE/DEFAULT,CARTESIAN,UNBOUNDED
                    THEO/<0.148,-0.0466,-0.053>,<0,0.0436,0.999>,<0,0.9990482,-0.0436194>,<-1,0,0>,0.025
                    ACTL/<0.148,-0.0466,-0.053>,<0,0.0436,0.999>,<0,0.9990482,-0.0436194>,<-1,0,0>,0.025
                    TARG/<0.148,-0.0466,-0.053>,<0,0.0436,0.999>,<0,0.9990482,-0.0436194>,<-1,0,0>
                    SHOW FEATURE PARAMETERS=NO
                    SHOW CONTACT PARAMETERS=NO
        ID_PNT3    =FEAT/POINT,CARTESIAN,NO
                    THEO/<0.148,-0.0481,-0.086>,<0,0.0436194,0.9990482>
                    ACTL/<0.148,-0.0452,-0.0196>,<0,0.0436194,0.9990482>
                    CONSTR/POINT,PIERCE,ID_LINE3,ID3
        ID_LINE4   =FEAT/CONTACT/LINE/DEFAULT,CARTESIAN,UNBOUNDED
                    THEO/<0.148,-0.0466,0.053>,<0,0.0436,-0.999>,<0,0.9990482,0.0436194>,<-1,0,0>,0.025
                    ACTL/<0.148,-0.0466,0.053>,<0,0.0436,-0.999>,<0,0.9990482,0.0436194>,<-1,0,0>,0.025
                    TARG/<0.148,-0.0466,0.053>,<0,0.0436,-0.999>,<0,0.9990482,0.0436194>,<-1,0,0>
                    SHOW FEATURE PARAMETERS=NO
                    SHOW CONTACT PARAMETERS=NO
        ID_PNT4    =FEAT/POINT,CARTESIAN,NO
                    THEO/<0.148,-0.0481,0.086>,<0,0.0436194,-0.9990482>
                    ACTL/<0.148,-0.0452,0.0196>,<0,0.0436194,-0.9990482>
                    CONSTR/POINT,PIERCE,ID_LINE4,ID3
                    MOVE/INCREMENT,<0,0,1>
                    MOVE/INCREMENT,<-1,0,0>
        A10        =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
                    ALIGNMENT/LEVEL,XPLUS,AXISLINE
                    ALIGNMENT/ROTATE,YPLUS,TO,INIT_ROTLINE2,ABOUT,XMINUS
                    ALIGNMENT/TRANS,YAXIS,ID1
                    ALIGNMENT/TRANS,ZAXIS,ID1
                    ALIGNMENT/TRANS,XAXIS,FRONT_PLANE
                    ALIGNMENT/END
                    TIP/T1A90B90, SHANKIJK=-1, -0.0003, -0.0004, ANGLE=90.5512
        DIM DIST1= 2D DISTANCE FROM POINT OD_POINT_1 TO POINT ID_PNT3 PAR TO   YAXIS,NO_RADIUS  UNITS=IN,$
        GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH
        AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL
        M       0.037+0     0.0050     0.0050     0.0346    -0.0024     0.0000 --#------
        DIM DIST2= 2D DISTANCE FROM POINT OD_POINT_1 TO POINT ID_PNT4 PAR TO   YAXIS,NO_RADIUS  UNITS=IN,$
        GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH
        AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL
        M       0.037+0     0.0050     0.0050     0.0346    -0.0024     0.0000 --#------
        DIM DIST3= 2D DISTANCE FROM POINT OD_POINT_2 TO POINT ID_PNT1 PAR TO   YAXIS,NO_RADIUS  UNITS=IN,$
        GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH
        AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL
        M       0.037+0     0.0050     0.0050     0.0344    -0.0026     0.0000 --#------
        DIM DIST4= 2D DISTANCE FROM POINT OD_POINT_2 TO POINT ID_PNT2 PAR TO   YAXIS,NO_RADIUS  UNITS=IN,$
        GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH
        AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL
        M       0.037+0     0.0050     0.0050     0.0344    -0.0026     0.0000 --#------
        C_FILE     =FILE/OPEN,C_PATH,APPEND
                    FILE/WRITELINE,C_FILE,"/CAVITY ID/" + "," + TRACE_FOLDER + "," + "Position " + V1 + "," + POS
                    FILE/WRITELINE,C_FILE,"/DATA/" + "," + CHAR_1 + V1 + "," + DIST1.M.MEAS
                    FILE/WRITELINE,C_FILE,"/DATA/" + "," + CHAR_2 + V1 + "," + DIST2.M.MEAS
                    FILE/WRITELINE,C_FILE,"/DATA/" + "," + CHAR_3 + V1 + "," + DIST3.M.MEAS
                    FILE/WRITELINE,C_FILE,"/DATA/" + "," + CHAR_4 + V1 + "," + DIST4.M.MEAS
                    FILE/CLOSE,C_FILE,KEEP
        A5         =ALIGNMENT/START,RECALL:DCC_FIXT_ALIGN,LIST=YES
                    ALIGNMENT/END
                    MOVE/POINT,NORMAL,<-4.0000,14.0000,12.0000>
        C_FILE     =FILE/OPEN,C_PATH,APPEND
                    FILE/WRITELINE,C_FILE,"/END/"
                    FILE/CLOSE,C_FILE,KEEP

        Comment


        • measurestuff413
          measurestuff413 commented
          Editing a comment
          I don't really understand your "pool" comment at the end there..but thanks for the code. Its easily understandable. I'll digest this and will be getting some training at Hex very shortly (Level 3 stuff)

        • louisd
          louisd commented
          Editing a comment
          "But if you want to dive into this head first" ... "Don't hit your head on the bottom of the pool. lol" Get it now?

          It's a metaphor for "Don't f*ck up and break a probe or crash the CMM"

          Obviously your print/output command to PDF is going to differ from my *.CSV writelines.

      • #5
        one more tip. The demon does not like to write to network drives. trust me on this, we have confirmed that it can omit data outputs.
        I write everything local to a "C_Temp" location, which is an assignment at the beginning of the routine.
        then at the end of the routine (I truncated the above code), I insert a move command to move the completed report output from the C drive over to the networked "T" drive.

        Code:
        TEMPFILE3=FILE/OPEN,C_TEMP,APPEND
                    FILE/WRITELINE,C_TEMPFILE3,"/END/"
                    FILE/CLOSE,C_TEMPFILE3,KEEP
                FILE/MOVE,C_TEMP,T_PATH
        use this file/move command and I can guarantee you won't have missing data or reports. If you write directly to network address... good luck!

        Comment


        • measurestuff413
          measurestuff413 commented
          Editing a comment
          You're the man. Thank you very much

          I am taking this code with me to a level three course in RI soon and I'll work with the Application Engineers to make this stick.

      • #6
        @louisd where does you loop end command go in the above code?

        Comment


        • louisd
          louisd commented
          Editing a comment
          Just after A5 alignment at end.

          Code:
          A5         =ALIGNMENT/START,RECALL:DCC_FIXT_ALIGN,LIST=YES
                      ALIGNMENT/END
          LOOP/END
          Note that i recall the DCC_FIXT_ALIGN just before AND at end of loop, so alignment coords are the same when loop cycle ends and restarts.
          Also first align within loop is "USE ACTIVE ALIGNMENT" this is also very important.

      • #7
        Originally posted by louisd View Post
        What you are asking for is like asking a doctor for a dozen prescriptions at once.
        We'd need to assess/guide you through each one. Speaking frankly, this is taught, very effectively, in HexagonU classes much better than we can toss it all together in posts.
        But if you want to dive into this head first, here's an entire looped routine with pretty much all you are looking for. decode it, understand it, and its free. Don't hit your head on the bottom of the pool. lol.

        Code:
        QTYQUESTION=LABEL/
        QTY =COMMENT/INPUT,NO,FULL SCREEN=YES,
        How many parts
        are in this shot?
        IF/!(QTY.INPUT>=1 AND QTY.INPUT<9)
        COMMENT/OPER,NO,FULL SCREEN=YES,AUTO-CONTINUE=NO,
        Invalid input! Please input
        a value between 1 and 8.
        GOTO/QTYQUESTION
        END_IF/
        Playing the Devil's Advocate here, this test wouldn't fail and ask for a new input if an operator typed in 1.5 for the quantity. Consider this:

        Code:
        IF/!(QTY.INPUT>=1 AND QTY.INPUT<9 AND QTY.INPUT==INT(QTY.INPUT))

        Comment


        • louisd
          louisd commented
          Editing a comment
          good call, this was an older version of my input validation. now i use
          Code:
          IF/QTY.INPUT-INT(QTY.INPUT)<>0 OR !(QTY.INPUT>=1 AND QTY.INPUT<=8)

      Related Topics

      Collapse

      Working...
      X