PC-DMIS math functions

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

  • PC-DMIS math functions

    This might be a weird question, but does PC-DMIS offer any sort of math functions for formulas between features? I have three features in a program: an OD, and ID, and the true positon from one to the other. I have to take all three elements and use them in a formula to output wall thickness. As of right now, I'm having to enter all this data into an Excel sheet that has the formula that does the math. Is there any way that I can do this right in the PC-DMIS program and output this directly in the report along with the other data?

  • #2
    PC-DMIS does offer the ability for you to customize your own math functions, in 2 ways
    There are many math functions available via the ASSIGN command which has access to variables, features, and dimensions.
    You can also use BASIC language syntax to write your own custom algorithms, and pass data into and out of it via the command line.

    Comment


    • #3
      Can you give me an example on how the ASSIGN command would be used?

      Comment


      • #4
        It depends on what you want exactly.
        Do you want a average of thickness, the different thicknesses depnds on the centering defect, or the distances point to point ? Or something else ?
        Can you post the code, please ?
        Or the calculation that you do under Excel ?
        It could help to give the right assignments !

        Comment


        • #5
          code.PNG

          Comment


          • #6
            Here is a very simple example to calculate the average of two diameters -

            ASSIGN/V1=(CIR1.DIAM+CIR2.DIAM)/2

            Once you enter the ASSIGN command and the cursor is to the right of the = sign, you can click F2 to expose what is called the expression builder

            Comment


            • #7
              ASSIGN/V1=(B1.D.MEAS-B2.D.MEAS)/2
              ASSIGN/V2=(B3.TP.MEAS)/2
              ASSIGN/V3=V1-V2

              Rough idea - Not actual code - HTH
              3.7mr3CAD++ / 2011mr1CAD++/2012mr1CAD++/QUINDOS7

              Comment


              • JEFMAN
                JEFMAN commented
                Editing a comment
                +1 !
                ASSIGN/V1=(CIR1.D-CIR2.D) /2 should work directly
                OR ASSIGN/V1=CIR1.R-CIR2.R !!!!!!!
                Last edited by JEFMAN; 03-12-2020, 08:35 AM.

              • DAN_M
                DAN_M commented
                Editing a comment
                This works! I do this a lot, see my code below

            • #8
              This just give you the average of thickness, and it doesn't taking into account the circularity defects...
              Last edited by JEFMAN; 06-14-2021, 08:26 AM.

              Comment


              • #9
                Ok, that makes sense. So I'm basically just assigning variables to whatever math function I give it. What do I need to do to output the final variable onto the report?

                Comment


                • #10
                  dcoss What I do..

                  1) Measure both features.

                  2) Create an assignment. I made V1 for this example. It equals the difference between the radial values of the features.

                  3) Force the result of V1 into a generic circle's diameter value. Report that generic circle's diameter to (which is your wall thickness).

                  Code:
                  MOVE/CLEARPLANE
                  CIR2 =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,OUT,LEAST_SQR
                  THEO/<10,10,10>,<0,0,1>,2.5,0
                  ACTL/<10,10,10>,<0,0,1>,2.5,0
                  TARG/<10,10,10>,<0,0,1>
                  START ANG=0,END ANG=360
                  ANGLE VEC=<1,0,0>
                  DIRECTION=CCW
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=NO
                  MOVE/CLEARPLANE
                  CIR4 =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                  THEO/<10,10,10>,<0,0,1>,1.5
                  ACTL/<10,10,10>,<0,0,1>,1.5
                  TARG/<10,10,10>,<0,0,1>
                  START ANG=0,END ANG=360
                  ANGLE VEC=<1,0,0>
                  DIRECTION=CCW
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=NO
                  ASSIGN/V1=CIR2.R-CIR4.R
                  F1 =GENERIC/CIRCLE,DEPENDENT,CARTESIAN,OUT,$
                  NOM/XYZ,<10,10,10>,$
                  MEAS/XYZ,<10,10,10>,$
                  NOM/IJK,<0,0,1>,$
                  MEAS/IJK,<0,0,1>,$
                  DIAMETER/0.5,V1
                  DIM LOC1= LOCATION OF CIRCLE F1 UNITS=IN ,$
                  GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
                  AX MEAS NOMINAL +TOL -TOL DEV OUTTOL
                  D 0.5000 0.5000 0.0020 0.0020 0.0000 0.0000 ----#----
                  END OF DIMENSION LOC1

                  Comment


                  • dcoss
                    dcoss commented
                    Editing a comment
                    I was wondering if I even needed to use a generic circle, but instead maybe a generic line, since the dimension that I would be outputting (wall thickness), seems to make more sense as a linear dimension.

                  • DAN_M
                    DAN_M commented
                    Editing a comment
                    Yeah you could use a line also. Whatever you'd like, there are many ways to accomplish things in PC DMIS.

                    For the line method..You could use my assignment math and then put the variable in the length for the generic line & report the length for your dimension. Be mindful of workplanes and alignments when doing this (as usual.)

                • #11
                  You had me until you got to the generic circle and then I was lost....

                  Comment


                  • DAN_M
                    DAN_M commented
                    Editing a comment
                    Its ok! We'll get this. You're almost there.

                    A generic feature is a feature that you can make in PC DMIS. It is "generic" meaning you ARE NOT CONSTRUCTING IT OUT OF OTHER FEATURES. You create the feature and then drive it's location with typing in nominals (or pumping variables into it). The numbers you type in (or the number that a variable equals that you use) will put the feature in that numeric position/vector relative to your current origin.

                    Go to Insert/Feature/Generic

                    Click Circle and click the Diameter box, then click OK. Now you'll have a generic circle in your Edit Window.

                    Now that the generic circle is in your edit window, it will have junk numbers in it. You have to make it make sense.

                    You'll have these 5 fields:

                    NOMXYZ
                    MEASXYZ
                    NOMIJK
                    MEASIJK
                    DIAMETER 0,0


                    By typing, "force" that generic circle to a NOMINAL and ACTUAL XYZ location that makes sense. Same with the IJK values. On the last line (where it says diameter) the FIRST number is the nominal size and the SECOND number is the measured actual.

                    All you're doing with all of this here is making PC DMIS do math (creating variable) and then you're using this generic feature as a way to HOLD the math and then report it cleanly (ask for diameter of generic circle that is forced to a certain diameter [driven by your variable]).

                    You can put a variable into a report comment and show it that way but I prefer doing it this way because it shows up with all of the other data in a nice & easy way to understand.
                    Last edited by DAN_M; 03-12-2020, 02:49 PM.

                  • dcoss
                    dcoss commented
                    Editing a comment
                    How could I output the variable's results into a report comment? What is the syntax for this? I just want to try it without using the generic feature.

                • #12
                  DAN_M has a good example, one of multiple.

                  I think the simplest way to get a calculated value to the report is with a COMMENT/REPT statement. Its crude, but functional, you can add descriptive text as well.

                  Comment


                  • #13
                    Thanks guys! I think that I got it now. Special thanks to Dan_M!

                    Comment


                    • #14
                      With DAN_M example, assuming the number of hits is the same, I would :
                      ASSIGN/V1=DOT(CIR2.HIT[1..CIR2.NUMHITS].XYZ-CIR4.HIT[1..CIR4.NUMHITS].XYZ,UNIT(CIR2.HIT[1..CIR2.NUMHITS].XYZ-CIR2.XYZ))
                      Which give an array of something which is close to local thickness (projection of points along a radial vector).
                      Then :
                      ASSIGN/AVERAGE_THICKNESS=SUM(V1)/CIR2.NUMHITS
                      ASSIGN/MAX_THICKNESS=MAX(V1)
                      ASSIGN/MIN_THICKNESS=MIN(V1)
                      COMMENT/RPT
                      "Average thickness = "+AVERAGE_THICKNESS
                      "Max thickness = "+MAX_THICKNESS
                      "Min thickness = "+MIN_THICKNESS

                      Hoping Aerage is the same value than Excel one !!!!!

                      Comment


                      • DAN_M
                        DAN_M commented
                        Editing a comment
                        More proof that Jeff is an actual CMM Robot from outer space

                      • JEFMAN
                        JEFMAN commented
                        Editing a comment
                        DAN_M : from outer space without Covid-19 for now ...

                    • #15
                      I never got the ASSIGN command to work. Here is the code that I am using with two different circle features. ASSIGN/V1=(CIR_4.5.DIAM-CIR_3.826.DIAM)/2 Everything after the "=" sign is red, so obviously PC-DMIS doesn't like something I'm doing. Any ideas?

                      Comment


                      • DAN_M
                        DAN_M commented
                        Editing a comment
                        @dcoss

                        Syntax error. PC DMIS is mad because you're using decimals in your names for your features.

                        Now that your programs are becoming more advanced, you should get in the highly advised habit of only using letters, numbers, and underscores to name things. NO spaces or special characters. This goes for features, alignments, constructions, everything in PC DMIS.

                        If you fix that, your code should work fine. Just duplicated it on my end and it worked.

                      • DAN_M
                        DAN_M commented
                        Editing a comment
                        Consider renaming to something like this and you'll be all set:

                        Code:
                        MOVE/CLEARPLANE
                        CIR_4_5    =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                                    THEO/<0,5,8>,<0,-1,0>,1
                                    ACTL/<0,5,8>,<0,-1,0>,1
                                    TARG/<0,5,8>,<0,-1,0>
                                    START ANG=0,END ANG=360
                                    ANGLE VEC=<1,0,0>
                                    DIRECTION=CCW
                                    SHOW FEATURE PARAMETERS=NO
                                    SHOW CONTACT PARAMETERS=NO
                                    MOVE/CLEARPLANE
                        CIR_3PNT826=FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                                    THEO/<0,5,8>,<0,-1,0>,0.5
                                    ACTL/<0,5,8>,<0,-1,0>,0.5
                                    TARG/<0,5,8>,<0,-1,0>
                                    START ANG=0,END ANG=360
                                    ANGLE VEC=<1,0,0>
                                    DIRECTION=CCW
                                    SHOW FEATURE PARAMETERS=NO
                                    SHOW CONTACT PARAMETERS=NO
                                    ASSIGN/V1=(CIR_4_5.DIAM-CIR_3PNT826.DIAM)/2

                      • jtrofatter
                        jtrofatter commented
                        Editing a comment
                        Man, every time i think i have something clever to contribute to these threads low and behold DAN_M and JEFMAN have already posted a +1 (or sometimes +3) version of what i was going to suggest!

                    Related Topics

                    Collapse

                    Working...
                    X