Choosing Program Operations

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

  • Choosing Program Operations

    Good morning,
    I am trying to set up a program that uses multiple operations. I want to use variables because I think it will work better than flow control without confusing the operator. What is the best way to set that up?
    Darroll
    2018R2

  • #2
    I have done this, however it's not cut and dry. It depends on your features.

    You will need to use a lot of variables, if end_if, while end_while, cases, labels, goto, etc. to bounce between your program. Targets will require variables, so will diameters, distances, dimensions, etc.
    Whatever a man sows, he shall reap.

    Comment


    • Darrollh
      Darrollh commented
      Editing a comment
      Seems like it would just be easier to write a separate program for the ops. Lol

  • #3
    I would do this:

    1) write a program for each OP.

    2) save each op program as a subroutine.

    3) make ONE program for your part. add some operator input questions (that feed some select/case statements that will then call the appropriate subroutine) so you can measure the current OP the part is at.


    You could also make a parametric program (lock everything down with "+0"s or "*1"s and move things around with variables).

    Comment


    • #4
      I write an entire programs and use variables entered through a form for all my flow controls as bfire85 suggested.
      I don't like having to maintain multiple programs for the same part.

      Comment


      • #5
        Sample of op10-->
        Code:
        STARTUP =ALIGNMENT/START,RECALL:USE_PART_SETUP,LIST=YES
        ALIGNMENT/END
        SUBROUTINE/PART_OP_010,
        =
        LOADPROBE/7107_G_4X20
        TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=0
        MODE/DCC
        CIR1 =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
        THEO/<0,0,0>,<0,0,1>,2
        ACTL/<0,0,0>,<0,0,1>,2
        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
        CIR2 =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
        THEO/<1,0,0>,<0,0,1>,4
        ACTL/<1,0,0>,<0,0,1>,4
        TARG/<1,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
        DIM LOC1= LOCATION OF CIRCLE CIR1 UNITS=IN ,$
        GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
        AX NOMINAL +TOL -TOL MEAS MAX MIN DEV OUTTOL
        X 0.0000 0.0020 0.0020 0.0000 1.0000 -0.9010 0.0000 0.0000 ----#----
        Y 0.0000 0.0020 0.0020 0.0000 0.9749 -0.9749 0.0000 0.0000 ----#----
        D 2.0000 0.0020 0.0020 2.0000 0.0000 0.0000 0.0000 0.0000 ----#----
        END OF DIMENSION LOC1
        DIM LOC2= LOCATION OF CIRCLE CIR2 UNITS=IN ,$
        GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
        AX NOMINAL +TOL -TOL MEAS MAX MIN DEV OUTTOL
        X 1.0000 0.0020 0.0020 1.0000 3.0000 -0.8019 0.0000 0.0000 ----#----
        Y 0.0000 0.0020 0.0020 0.0000 1.9499 -1.9499 0.0000 0.0000 ----#----
        D 4.0000 0.0020 0.0020 4.0000 0.0000 0.0000 0.0000 0.0000 ----#----
        END OF DIMENSION LOC2
        ENDSUB/
        Program operators will use-->
        Code:
        STARTUP =ALIGNMENT/START,RECALL:USE_PART_SETUP,LIST=YES
        ALIGNMENT/END
        LOADPROBE/7107_G_4X20
        TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=0
        C1 =COMMENT/INPUT,NO,FULL SCREEN=NO,
        What OP would you like to measure?
        
        Type one of the following:
        
        10
        20
        30
        SELECT/C1.INPUT
        CASE/10
        CS1 =CALLSUB/PART_OP_010,C:\Users\z03236\Desktop\subroutinedesk top\part_op_010.PRG:,
        GOTO/ENDPRG
        END_CASE/
        CASE/20
        CS2 =CALLSUB/PART_OP_020,C:\Users\z03236\Desktop\subroutinedesk top\part_op_020.PRG:,
        GOTO/ENDPRG
        END_CASE/
        CASE/30
        END_CASE/
        END_SELECT/
        ENDPRG =LABEL/

        Comment


        • #6
          I have to give a huge shout out to InspectorJester what a smart kid, with his help I was able to get a Form Editor, functioning popup at the beginning of my program


          What I did Darrollh
          (In Memory of my Loving wife, "Ronda" who I lost March 7, 2016. I love you baby.)
          They say "Nobody's Perfect." I must be Nobody.

          Comment


          • #7
            Thanks everyone! I’m working on it now. Will let you all know how it turns out.
            Darroll
            2018R2

            Comment


            • #8
              @Darrollh There is a topic around here somewhere talking about the same thing. In that topic, I posted up sample code of what I do in this scenario. Search around (possibly using my name) and see if you can find it. In the sample code I posted, there are footnotes explaining what the code does and why. The original topic was posted less than 6 months ago.

              I tried to find it but I have a lot of work to do at the moment. I will look again later if you want it and are unsuccessful in finding it.
              Remembering my beautiful wife Taz who's life was lost on 6-13-2020. I love you and I miss you.

              Comment


              • #9
                Isn't this something that can be solved with Marked Sets or Mini Routines - is it really necessary to write a lot of extra code when PC-DMIS can do it out of the box? Or am I missing something?
                AndersI
                SW support - Hexagon Metrology Nordic AB

                Comment


                • A-machine-insp
                  A-machine-insp commented
                  Editing a comment
                  I use a yes/no question with flow control to do it.

                • davehocum
                  davehocum commented
                  Editing a comment
                  Andersl, you are correct. Using Marked Sets and Mini Routines with INSPECT will not work in the same manor. INSPECT will not let the operator open the Marked Sets and Mini Routines dialog windows from within INSPECT.

              Related Topics

              Collapse

              Working...
              X