Using Logic

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

  • Using Logic

    I'm only asking this question because I currently have a lot of free time at work.

    Is there a workbook or something i could use to start learning logic within PC-DMIS? I would really like to start playing around with it. However, i really dont know how to start. I have tried using the search bar within the forums to find as much information on this as i can.

    If there is nothing, then i will wait till i go to level 3 class with hexagon and start learning that way. That is still a while off however, and i would like to get a headstart on learning some things.

    Thanks.

  • #2
    Use the help file. Search for terms like If End_if, While End_While, Case End_Case

    I believe you can search for: A List of Available Variables in the help file to find all the GETTEXT commands.

    Comment


    • #3
      Search the help file for “Flow Control“

      B&S CHAMELEON/PCDMIS CAD++ V2011

      There are no bugs, only "UNDOCUMENTED ENHANCEMENTS!"

      sigpic

      Comment


      • #4
        Read up on logical statements in a programming language like VB or C or whatever (Python(?) is a free (?) download)

        The concepts are the same, the syntax varies.

        Comment


        • #5
          Here :
          ftp://ftp.wilcoxassoc.com/docs/v2019r2manual/
          Then, download the core manual, and print the chapter 21. "21_Branching by Using Flow Control"

          Comment


          • ThePudds
            ThePudds commented
            Editing a comment
            *22 you mean. Thank you by the way!

        • #6
          Can you think of any programming situations you've encountered in the past where you'd have liked some logic incorporated? It might be easier to teach you some basic stuff through example instead of reading those dry help files.

          Comment


          • ThePudds
            ThePudds commented
            Editing a comment
            I cant necessarily think of a specific example. I would mostly like to make sure i have a fail safe for any of my programs in case "I" am not the one running the part. So let's say the part is REALLY bad, my program starts. A basic program relies on alignments to know where the part is on the machine. If the part is bad enough and the alignment is messed up, you risk crashing, correct me if im wrong of course. I would like to be able to make fail safes within my program to ensure crashes DO NOT HAPPEN. Thanks Dan.

        • #7
          Flow control is great to learn. I didn't use it for years then I started using it about 2 years ago and now my programs are way more user friendly. Most of the time our parts come in with tooling tabs then later without tooling tabs. I write one program for the part and use flow control to direct the CMM to include or omit certain points depending on what machining stage the part is at. I also use it to turn reporting on/off for certain dimensions so the report only includes dimensioning for the part up to and including the current stage. Wonderful WONDERFUL tool to use.
          Remembering my beautiful wife Taz who's life was lost on 6-13-2020. I love you and I miss you.

          Comment


          • #8
            ThePudds

            I think you might like this. Haven't used it yet but it works offline.

            I have a part with a cylindrical bore through my part's Y- face that is perpendicular to my part's Z axis. I will be probing that bore with a small & skinny probe. If my part isn't square within 0.72°, I'll shank out. So, I wrote this code to make sure the measured y- face of the part is square to the CMM's WCS within 0.5°. If it isn't, operator will get a prompt to re-square and try again.

            If the measured angle is within desired range, the IF statement is skipped and the code resumes.

            Code:
            GROUP_OPERATOR_INSTRUCTIONS_1=GROUP/SHOWALLPARAMS=YES
            L1 =LABEL/
            COMMENT/OPER,NO,FULL SCREEN=YES,AUTO-CONTINUE=NO,
            Put part on fixture. Front face must be square
            to CMM's X Axis within 0.5° as shown.
            
            Press OK to continue.
            COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
            Alignment is manual, follow prompts on screen.
            
            Press OK to continue.
            ENDGROUP/ID=GROUP_OPERATOR_INSTRUCTIONS_1
            PLN1 =FEAT/CONTACT/PLANE/DEFAULT,CARTESIAN,TRIANGLE,LEAST_SQR
            THEO/<0.6154,0.6621,0.0197>,<0,0,1>
            ACTL/<0.6154,0.6621,0.0197>,<0,0,1>
            TARG/<0.6154,0.6621,0.0197>,<0,0,1>
            ANGLE VEC=<1,0,0>,RADIAL
            SHOW FEATURE PARAMETERS=NO
            SHOW CONTACT PARAMETERS=NO
            LIN1 =FEAT/CONTACT/LINE/DEFAULT,CARTESIAN,BOUNDED
            THEO/<0.6506,0,0.0197>,<0.3689,0,0.0197>,<-1,0,0>,<0,-1,0>,<0,0,1>,0.2817
            ACTL/<0.6506,0,0.0197>,<0.3689,0,0.0197>,<-1,0,0>,<0,-1,0>,<0,0,1>,0.2817
            TARG/<0.6506,0,0.0197>,<0.3689,0,0.0197>,<-1,0,0>,<0,-1,0>,<0,0,1>
            SHOW FEATURE PARAMETERS=NO
            SHOW CONTACT PARAMETERS=NO
            PNT1 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
            THEO/<0,0.3748,0.0086>,<-1,0,0>
            ACTL/<0,0.3748,0.0086>,<-1,0,0>
            TARG/<0,0.3748,0.0086>,<-1,0,0>
            SHOW FEATURE PARAMETERS=NO
            SHOW CONTACT PARAMETERS=NO
            A1 =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
            ALIGNMENT/LEVEL,ZPLUS,PLN1
            ALIGNMENT/ROTATE,XMINUS,TO,LIN1,ABOUT,ZPLUS
            ALIGNMENT/TRANS,XAXIS,PNT1
            ALIGNMENT/TRANS,YAXIS,LIN1
            ALIGNMENT/TRANS,ZAXIS,PLN1
            ALIGNMENT/END
            MODE/DCC
            CLEARP/ZPLUS,1,ZPLUS,1,ON
            MOVE/CLEARPLANE
            PLN1_DCC =FEAT/CONTACT/PLANE/DEFAULT,CARTESIAN,TRIANGLE,LEAST_SQR
            THEO/<0.6154,0.6621,0>,<0,0,1>
            ACTL/<0.6154,0.6621,0>,<0,0,1>
            TARG/<0.6154,0.6621,0>,<0,0,1>
            ANGLE VEC=<1,0,0>,RADIAL
            SHOW FEATURE PARAMETERS=NO
            SHOW CONTACT PARAMETERS=NO
            MOVE/CLEARPLANE
            LIN1_DCC =FEAT/CONTACT/LINE/DEFAULT,CARTESIAN,BOUNDED
            THEO/<0.6506,0,0>,<0.3689,0,0>,<-1,0,0>,<0,-1,0>,<0,0,1>,0.2817
            ACTL/<0.6506,0,0>,<0.3689,0,0>,<-1,0,0>,<0,-1,0>,<0,0,1>,0.2817
            TARG/<0.6506,0,0>,<0.3689,0,0>,<-1,0,0>,<0,-1,0>,<0,0,1>
            SHOW FEATURE PARAMETERS=NO
            SHOW CONTACT PARAMETERS=NO
            MOVE/CLEARPLANE
            PNT1_DCC =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
            THEO/<0,0.3748,-0.0111>,<-1,0,0>
            ACTL/<0,0.3748,-0.0111>,<-1,0,0>
            TARG/<0,0.3748,-0.0111>,<-1,0,0>
            SNAP=NO
            SHOW FEATURE PARAMETERS=NO
            SHOW CONTACT PARAMETERS=NO
            A2 =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
            ALIGNMENT/LEVEL,ZPLUS,PLN1_DCC
            ALIGNMENT/ROTATE,XMINUS,TO,LIN1_DCC,ABOUT,ZPLUS
            ALIGNMENT/TRANS,XAXIS,PNT1_DCC
            ALIGNMENT/TRANS,YAXIS,LIN1_DCC
            ALIGNMENT/TRANS,ZAXIS,PLN1_DCC
            ALIGNMENT/END
            RECALL/ALIGNMENT,INTERNAL,STARTUP
            DIM ANGL1= 2D ANGLE FROM LINE LIN1_DCC TO XAXIS ,$
            GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH
            AX MEAS NOMINAL +TOL -TOL DEV OUTTOL
            A 0.0000 0.0000 0.5000 0.5000 0.0000 0.0000 ----#----
            IF/ANGL1.A.MEAS<0 OR ANGL1.A.MEAS>0.5
            COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
            Part is not square enough on fixture!
            
            CMM probe will shank out later on!
            
            Press OK to re-square the part & try again.
            GOTO/L1
            END_IF/
            ENDPROGRAM =LABEL/
            Last edited by DAN_M; 05-28-2020, 01:57 PM.

            Comment


            • #9
              Here is an example from what i use, we have 2 different machines with different probing. I write my programs to run on either machine.
              Code:
              M1 =COMMENT/INPUT,NO,FULL SCREEN=NO,
              WHICH MACHINE IS IN USE
              ENTER 1 FOR 12.30.10
              ENTER 2 FOR 7.10.7
              SELECT/M1.INPUT
              CASE/1
              ASSIGN/V1="12.30.10"
              ASSIGN/PROBE1="2X40X10"
              ASSIGN/PROBE2="1X35X40CYL"
              END_CASE/
              CASE/2
              ASSIGN/V1="7.10.7"
              ASSIGN/PROBE1="2X30X50"
              ASSIGN/PROBE2="1X35X20CYL"
              END_CASE/
              DEFAULT_CASE/
              COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
              INVALID ENTRY
              TRY AGAIN
              GOTO/M1
              END_DEFAULTCASE/
              END_SELECT/
              COMMENT/REPT,
              "***** PART "+PART+" RUN ON MACHINE "+V1+" *****"
              **************************************
              LOADPROBE/PROBE1
              TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=0
              Here is another example of 1 program running 11 different parts.
              Code:
              C2 =COMMENT/INPUT,YES,FULL SCREEN=NO,
              ENTER PART NUMBER
              SELECT/RIGHT(C2.INPUT,3)
              CASE/201
              ASSIGN/DIMA=0.795
              ASSIGN/DIMB=1.335/2
              ASSIGN/DIMC=1.085/2
              ASSIGN/DIMD=0.045
              ASSIGN/DIME=0.0225
              ASSIGN/DIMF=0.720/2
              END_CASE/
              CASE/202
              ASSIGN/DIMA=0.835
              ASSIGN/DIMB=1.375/2
              ASSIGN/DIMC=1.125/2
              ASSIGN/DIMD=0.045
              ASSIGN/DIME=0.0225
              ASSIGN/DIMF=0.720/2
              END_CASE/
              CASE/203
              ASSIGN/DIMA=0.880
              ASSIGN/DIMB=1.420/2
              ASSIGN/DIMC=1.170/2
              ASSIGN/DIMD=0.045
              ASSIGN/DIME=0.0225
              ASSIGN/DIMF=0.720/2
              END_CASE/
              CASE/204
              ASSIGN/DIMA=0.619
              ASSIGN/DIMB=1.159/2
              ASSIGN/DIMC=0.909/2
              ASSIGN/DIMD=0.055
              ASSIGN/DIME=0.0275
              ASSIGN/DIMF=0.544/2
              END_CASE/
              CASE/205
              ASSIGN/DIMA=0.674
              ASSIGN/DIMB=1.214/2
              ASSIGN/DIMC=0.964/2
              ASSIGN/DIMD=0.055
              ASSIGN/DIME=0.0275
              ASSIGN/DIMF=0.60/2
              END_CASE/
              CASE/206
              ASSIGN/DIMA=0.729
              ASSIGN/DIMB=1.269/2
              ASSIGN/DIMC=1.019/2
              ASSIGN/DIMD=0.055
              ASSIGN/DIME=0.0275
              ASSIGN/DIMF=0.654/2
              END_CASE/
              CASE/207
              ASSIGN/DIMA=0.934
              ASSIGN/DIMB=1.474/2
              ASSIGN/DIMC=1.224/2
              ASSIGN/DIMD=0.045
              ASSIGN/DIME=0.0225
              ASSIGN/DIMF=0.720/2
              END_CASE/
              CASE/208
              ASSIGN/DIMA=0.760
              ASSIGN/DIMB=1.300/2
              ASSIGN/DIMC=1.050/2
              ASSIGN/DIMD=0.045
              ASSIGN/DIME=0.0225
              ASSIGN/DIMF=0.686/2
              END_CASE/
              CASE/209
              ASSIGN/DIMA=0.501
              ASSIGN/DIMB=1.041/2
              ASSIGN/DIMC=0.791/2
              ASSIGN/DIMD=0.045
              ASSIGN/DIME=0.0225
              ASSIGN/DIMF=0.428/2
              END_CASE/
              CASE/210
              ASSIGN/DIMA=0.546
              ASSIGN/DIMB=1.086/2
              ASSIGN/DIMC=0.836/2
              ASSIGN/DIMD=0.045
              ASSIGN/DIME=0.0225
              ASSIGN/DIMF=0.472/2
              END_CASE/
              CASE/211
              ASSIGN/DIMA=0.591
              ASSIGN/DIMB=1.131/2
              ASSIGN/DIMC=0.881/2
              ASSIGN/DIMD=0.045
              ASSIGN/DIME=0.0225
              ASSIGN/DIMF=0.516/2
              END_CASE/
              DEFAULT_CASE/
              COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
              YOU HAVE ENTERED AN INCORRECT PART NUMBER
              PLEASE TRY AGAIN
              GOTO/C2
              END_DEFAULTCASE/
              END_SELECT/
              This is how the feature is used and toleranced.
              Code:
              CIR2 =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
              THEO/<DIMC,DIME,0.725>,<0,-1,0>,0.1295
              ACTL/<0.585,0.0225,0.725>,<0,-1,0>,0.1295
              TARG/<DIMC,DIME,0.725>,<0,-1,0>
              START ANG=0,END ANG=360
              ANGLE VEC=<1,0,0>
              DIRECTION=CCW
              SHOW FEATURE PARAMETERS=NO
              SHOW CONTACT PARAMETERS=YES
              NUMHITS=4,DEPTH=0.1,PITCH=0
              SAMPLE METHOD=SAMPLE_HITS
              SAMPLE HITS=0,SPACER=0
              AVOIDANCE MOVE=BEFORE,DISTANCE=0.3
              FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
              SHOW HITS=NO
              FCFLOC1 =POSITION : CIR2
              FEATCTRLFRAME/SHOWNOMS=YES,SHOWPARAMS=YES,SHOWEXPANDED=YES,
              CADGRAPH=OFF,REPORTGRAPH=OFF,TEXT=OFF,MULT=10.00,A RROWDENSITY=100,OUTPUT=REPORT,UNITS=IN,
              COMPOSITE=NO,FIT TO DATUMS=YES,DEV PERPEN CENTERLINE=ON,OUTPUT ALIGNMENT=Datum Reference Frame
              CUSTOMIZED DRF=NO
              STANDARDTYPE=ASME_Y14_5
              SIZE TOLERANCES/1,DIAMETER,0.1295,0.0005,0
              PRIMARY DIMENSION/POSITION,DIAMETER,0.002,MMC,E,A,C
              SECONDARY DIMENSION/,<tol>,<MC>,<dat>,<dat>,<dat>
              NOTE/FCFLOC1
              FEATURES/CIR2,,
              CIR2
              X:NOM=DIMC
              Z:NOM=0.725
              <NEW>
              Hope this is of some help.

              Comment


              • #10
                very simple flow control, but works like a charm:

                Code:
                LAB1 =LABEL/
                CL1 =COMMENT/INPUT,NO,''1=Validator
                ,2=Global'
                ,3=Global slow for testing'
                IF_GOTO/CL1.INPUT<1,GOTO = LAB1
                IF_GOTO/CL1.INPUT>3,GOTO = LAB1
                IF_GOTO/CL1.INPUT>2,GOTO = GLO2
                IF_GOTO/CL1.INPUT>1,GOTO = GLO
                IF_GOTO/CL1.INPUT<2,GOTO = VAL
                GOTO/CL1
                VAL =LABEL/
                ASSIGN/MS = 150
                ASSIGN/TS = 2.5
                GOTO/LAB2
                GLO =LABEL/
                ASSIGN/MS = 500
                ASSIGN/TS = 6
                GOTO/LAB2
                GLO2 =LABEL/
                ASSIGN/MS = 150
                ASSIGN/TS = 6
                GOTO/LAB2
                LAB2 =LABEL/
                MOVESPEED/ MS
                TOUCHSPEED/ TS
                ASSIGN/ACL = MS*2
                ACCELERATION/MAXACCELX=ACL, MAXACCELY=ACL, MAXACCELZ=ACL
                sigpic
                Originally posted by AndersI
                I've got one from September 2006 (bug ticket) which has finally been fixed in 2013.

                Comment


                • #11
                  If you're running 2020 r1 (you can run it with the free work at home license if your current SMA isn't up to date) - go to the discover tab on the homepage and check out the example routines. I'm pretty sure at least some of them will have examples of how to use logic, flow control and variables.
                  Neil Challinor
                  PC-DMIS Product Owner

                  T: +44 870 446 2667 (Hexagon UK office)
                  E: [email protected]

                  Comment


                  • #12
                    Here is a macro program that can handle up to 6 parts (but as few as 1 if they prefer).

                    One "while loop" handles all of the serial numbers up front and then another "while loop" handles the looping of the code. Operator doesn't even have to touch the jogbox.

                    Code:
                    STARTUP =ALIGNMENT/START,RECALL:USE_PART_SETUP,LIST=YES
                    ALIGNMENT/END
                    MOVESPEED/ 300*0.9
                    LOADPROBE/7107_Y_1BY20
                    TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=0
                    GROUP_SETUPINSTRUCTION_QUESTION=GROUP/SHOWALLPARAMS=NO
                    ENDGROUP/ID=GROUP_SETUPINSTRUCTION_QUESTION
                    GROUP_SOFTWARE_CONTROL=GROUP/SHOWALLPARAMS=NO
                    ENDGROUP/ID=GROUP_SOFTWARE_CONTROL
                    GROUP_PROGRAMMING_NOTES=GROUP/SHOWALLPARAMS=NO
                    ENDGROUP/ID=GROUP_PROGRAMMING_NOTES
                    GROUP_PROBEQUAL_FLOWCOMMANDS=GROUP/SHOWALLPARAMS=NO
                    ENDGROUP/ID=GROUP_PROBEQUAL_FLOWCOMMANDS
                    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
                    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\\XXXXXX\\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
                    `
                    Program code goes here.
                    EVERYTHING must be locked down with a "+0" or a "*1" in the "THEO" column as shown below. This applies to move/points, move/incriments, etc..
                    Code:
                    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
                    `
                    Code:
                    PRINT/REPORT,EXEC MODE=END,$
                    TO_FILE=ON,AUTO=1,AUTO OPEN=OFF,$
                    TO_PRINTER=OFF,COPIES=1,$
                    TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=REPORT_NAME,$
                    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
                    TO_EXCEL=OFF,$
                    PREVIOUS_RUNS=KEEP_INSTANCES
                    UNTIL/CURR_POS==TOTAL_PARTS
                    ENDPRG =LABEL/
                    Last edited by DAN_M; 05-29-2020, 09:05 AM.

                    Comment


                    • #13
                      Here is how I handle auto-calibration. I have this "group" in every program. Before every program that is run, the operator has the option to calibrate without getting a programmer.

                      This is my sample, I have to delete certain comments depending on the machine it is going on, I am missing some goto labels, but i'm sure you'll get the idea.

                      Code:
                      GROUP_PROBEQUAL_FLOWCOMMANDS=GROUP/SHOWALLPARAMS=YES
                      QUAL_QUESTION =COMMENT/YESNO,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
                      Has the CMM been calibrated??
                      IF_GOTO/QUAL_QUESTION.INPUT=="YES",GOTO = LABEL_END_CALGROUP
                      QUAL_ACTION =COMMENT/INPUT,NO,FULL SCREEN=NO,
                      1--> Let's calibrate the CMM now.
                      
                      2--> Just run the program. I
                      don't need to calibrate.
                      
                      3--> I need help.
                      
                      IF_GOTO/LEN(QUAL_ACTION.INPUT)<>1,GOTO = QUAL_ACTION
                      ASSIGN/VAR_1=ARRAY(1,2,3)
                      ASSIGN/VAR_2=MIN(ABS(VAR_1-QUAL_ACTION.INPUT))
                      IF_GOTO/VAR_2<>0,GOTO = QUAL_ACTION
                      SELECT/QUAL_ACTION.INPUT
                      CASE/1
                      CHECK/0.25,1
                      DISPLAYPRECISION/7
                      COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
                      Ensure sphere is in calibration hole.
                      
                      Remove cap from sphere.
                      
                      Press OK to continue.
                      COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
                      Ensure sphere is in calibration hole.
                      
                      Ball facing CMM's Y+ (if applicable).
                      
                      Press okay when complete.
                      AUTOCALIBRATE/PROBE, PARAMETER_SET=ALL-TIPS-WITH-DEFAULTS, QUALTOOL_MOVED=YES_DCC,
                      CHECK COLLISION=NO, SHOW_SUMMARY=NO, OVERWRITE_RESULTSFILE=NO
                      AUTOCALIBRATE/PROBE, PARAMETER_SET=ALL-TIPS-WITH-DEFAULTS, QUALTOOL_MOVED=NO,
                      CHECK COLLISION=NO, SHOW_SUMMARY=NO, OVERWRITE_RESULTSFILE=NO
                      COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
                      Put cap back on sphere.
                      
                      Press OK to continue.
                      COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
                      MOVE PROBE FAR OUT OF THE WAY.
                      
                      Once probe is out of the way, remove
                      the sphere & put in safe place.
                      
                      Press OK to continue.
                      DISPLAYPRECISION/4
                      GOTO/
                      END_CASE/
                      CASE/2
                      GOTO/LABEL_END_CALGROUP
                      END_CASE/
                      CASE/3
                      GOTO/
                      END_CASE/
                      END_SELECT/
                      CHECK/0.1,1
                      LABEL_END_CALGROUP =LABEL/
                      ENDGROUP/ID=GROUP_PROBEQUAL_FLOWCOMMANDS

                      Comment


                      • #14
                        Thank you all so much! Y'all are awesome!

                        Comment


                        • #15
                          I've found the code samples section of the forum gives me as much as I can handle with the free time I have.
                          sigpicHave a homebrew

                          Comment

                          Related Topics

                          Collapse

                          Working...
                          X