Variable/flow control question

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

  • Variable/flow control question

    I have a part that needs to be "bin" sorted for matched assembly. ( Customer requirement ) I have 2 measured features that need to be sorted on each part. I have no Issues with assigning the variables and sorting for a single feature but I cannot figure out how to make this process work for 2.

    Example- Part 1 dia1 meas .500 and dia2 meas .250 so part goes in "bin" 1
    Part 2 dia1 meas .501 and dia2 meas .250 so part goes in "bin" 2
    Part 3 dia1 meas .500 and dia2 meas .251 so part goes in "bin" 3

    I cant seem to find any "If/And " type of statement, any suggestions?!?
    Badges..... We don't need no stinkin badges.

  • #2
    I'm not sure I understand what your sort criteria are. Are they sorted by DIA1 and DIA2 together or independently of each other?

    Craig
    <internet bumper sticker goes here>

    Comment


    • #3
      Try something like this:

      Code:
      ASSIGN/V9 = (PNT4.Z+PNT5.Z+PNT6.Z)/3
                  ASSIGN/V1 = (CIR3.DIAM-CIR3.TDIAM)*-.5
                  ASSIGN/V2 = (CIR3.X-CIR3.TX)*-1
                  ASSIGN/V3 = (CIR3.Y-CIR3.TY)*-1
                  ASSIGN/V4 = (V9-PNT4.TZ)*1
                  ASSIGN/V10 = PNT4.TZ
                  ASSIGN/V5 = IF(ABS(V1)<0.0001,0,V1)
                  ASSIGN/V6 = IF(ABS(V2)<0.0001,0,V2)
                  ASSIGN/V7 = IF(ABS(V3)<0.0001,0,V3)
                  ASSIGN/V8 = IF(ABS(V4)<0.0001,0,V4)
      This ought to help.


      Jan.
      ***************************
      PC-DMIS/NC 2010MR3; 15 December 2010; running on 18 machine tools.
      Romer Infinite; PC-DMIS 2010 MR3; 15 December 2010.

      Comment


      • #4
        The parts need to be sorted for both dimensions but the 2 dimensions have different criteria.
        Badges..... We don't need no stinkin badges.

        Comment


        • #5
          So I'm thinking based on the dimensions for each you want to throw up a comment telling the operator what bin to place the part in? Am I following? If that is so, let us know the criteria and we'll see what we come up with.

          Craig
          <internet bumper sticker goes here>

          Comment


          • #6
            nested loops

            Try something like this:

            assign bin=o

            if dia1.d =.500
            if dia2.d = .250
            assign bin=1
            end if
            end if

            if dia1.d =.501
            if dia2.d = .250
            assign bin=2
            end if
            end if

            if dia1.d =.500
            if dia2.d = .251
            assign bin=3
            end if
            end if
            comment, report "Part belongs in bin: " + bin
            Last edited by Duckhunter; 08-15-2006, 03:45 PM.

            Comment


            • #7
              Yeah ultimatly we want the comment to pop on the bin number.

              Tray A= Dia 1- .38350-.38385
              Bin 1 in Tray A dia 2- .32530-.32535
              bin 2 in tray A dia 2- .32535-.32565
              bin 3 tray A dia 2- .32565-.32570

              Tray B= Dia 1- .38385-.38415
              Bin 1 in Tray B dia 2- .32530-.32535
              bin 2 in tray B dia 2- .32535-.32565
              bin 3 tray B dia 2- .32565-.32570

              Tray C= Dia 1- .38415-.38420
              Bin 1 in Tray C dia 2- .32530-.32535
              bin 2 in tray C dia 2- .32535-.32565
              bin 3 tray C dia 2- .32565-.32570

              You dont need to tell me how crazy impossible these tolerances are, lol, we just shake our heads when we are asked to do these things.
              Badges..... We don't need no stinkin badges.

              Comment


              • #8
                Code:
                DIA1       =FEAT/CIRCLE,RECT,IN,LEAST_SQR
                            THEO/0,0,0,0,0,1,0.3838
                            ACTL/0,0,0,0,0,1,0.3838
                            MEAS/CIRCLE,6,WORKPLANE
                            HIT/BASIC,NORMAL,0.074,0,0,-1,0,0,0.074,0,0,USE THEO = YES
                            HIT/BASIC,NORMAL,0.037,0.0641,0,-0.5,-0.8660254,0,0.037,0.0641,0,USE THEO = YES
                            HIT/BASIC,NORMAL,-0.037,0.0641,0,0.5,-0.8660254,0,-0.037,0.0641,0,USE THEO = YES
                            HIT/BASIC,NORMAL,-0.074,0,0,1,0,0,-0.074,0,0,USE THEO = YES
                            HIT/BASIC,NORMAL,-0.037,-0.0641,0,0.5,0.8660254,0,-0.037,-0.0641,0,USE THEO = YES
                            HIT/BASIC,NORMAL,0.037,-0.0641,0,-0.5,0.8660254,0,0.037,-0.0641,0,USE THEO = YES
                            ENDMEAS/
                            IF/DIA1.DIAM >= 0.3835 AND DIA1.DIAM <= 0.38385
                            ASSIGN/TRAY = "TRAY A"
                            END_IF/
                            IF/DIA1.DIAM > 0.38385 AND DIA1.DIAM <= 0.38415
                            ASSIGN/TRAY = "TRAY B"
                            END_IF/
                            IF/DIA1.DIAM > 0.38415 AND DIA1.DIAM <= 0.3842
                            ASSIGN/TRAY = "TRAY C"
                            END_IF/
                            ELSE/
                            ASSIGN/TRAY = "REJECT"
                            END_ELSE/
                DIA2       =FEAT/CIRCLE,RECT,IN,LEAST_SQR
                            THEO/0,0,0,0,0,1,0.3838
                            ACTL/0,0,0,0,0,1,0.3838
                            MEAS/CIRCLE,6,WORKPLANE
                            HIT/BASIC,NORMAL,0.074,0,0,-1,0,0,0.074,0,0,USE THEO = YES
                            HIT/BASIC,NORMAL,0.037,0.0641,0,-0.5,-0.8660254,0,0.037,0.0641,0,USE THEO = YES
                            HIT/BASIC,NORMAL,-0.037,0.0641,0,0.5,-0.8660254,0,-0.037,0.0641,0,USE THEO = YES
                            HIT/BASIC,NORMAL,-0.074,0,0,1,0,0,-0.074,0,0,USE THEO = YES
                            HIT/BASIC,NORMAL,-0.037,-0.0641,0,0.5,0.8660254,0,-0.037,-0.0641,0,USE THEO = YES
                            HIT/BASIC,NORMAL,0.037,-0.0641,0,-0.5,0.8660254,0,0.037,-0.0641,0,USE THEO = YES
                            ENDMEAS/
                            IF/DIA2.DIAM >= 0.3253 AND DIA2.DIAM <= 0.32535
                            ASSIGN/BIN = "BIN 1"
                            END_IF/
                            IF/DIA2.DIAM > 0.32535 AND DIA2.DIAM <= 0.32565
                            ASSIGN/BIN = "BIN 2"
                            END_IF/
                            IF/DIA2.DIAM > 0.32565 AND DIA2.DIAM <= 0.3257
                            ASSIGN/BIN = "BIN 3"
                            END_IF/
                            ELSE/
                            ASSIGN/BIN = "REJECT"
                            END_ELSE/
                            IF/TRAY == "REJECT" OR BIN == "REJECT"
                            COMMENT/OPER,NO,"PLACE THIS PART IN THE REJECT BIN"
                            END_IF/
                            ELSE/
                            COMMENT/OPER,NO,"PLACE THIS PART IN " + TRAY + " " + BIN
                            END_ELSE/
                This is how I'd do it but not after explaining that this is utterly and absolutely unreasonable from a tolerance standpoint. You will not be accurate in sorting these with a CMM with these tolerances so this is just a show of code really, as applied it is worthless pratically. Good luck

                Craig
                Last edited by craiger_ny; 08-16-2006, 09:59 AM.
                <internet bumper sticker goes here>

                Comment


                • #9
                  That looks like it will do exactly what I want. Thanks!

                  As for the tolerance issue .......well...... anyone, who knows anything, knows better. I guess Engineers and Estimators don't exactly fit that category.
                  Badges..... We don't need no stinkin badges.

                  Comment


                  • #10
                    BTW you might not want to model your features after mine. I just created two circles wit 6 hits as an example. I have no idea what your part configuration will demand. This of course is aside from the tolerance issue............

                    Craig
                    <internet bumper sticker goes here>

                    Comment


                    • #11
                      Yeah, the features aren't really circles n e way. Its actually a sphere rad and a cone crosssection. I just need to get the code written, what "they" do with it is someone elses problem.

                      Maybe when a new pmm-c gets here we can have better luck.
                      Badges..... We don't need no stinkin badges.

                      Comment

                      Related Topics

                      Collapse

                      Working...
                      X