Cant Subroutinize my Scans

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

  • Cant Subroutinize my Scans

    Well the Demon strikes again.

    I have two programs.

    1. The main program that measures everything on part except for a seal groove.
    2. A seal groove width program that measures nothing else but one feature via scanning, and then spits out some measurements to a text file.

    I wanted to run these both together via subroutines but it really doesnt work very well this way.

    The subroutine part does execute from the first stupid PCDMIS program but draws in all of the constructed features that were hidden in the 2nd program. Normally not a big deal right, but my Second program has is OVER 18,000 Lines of code just for one silly feature (Mainly all because of creating work arounds for other bugs in the PCDMIS). Any who that way there is soo much crap I cant see what I even wanted to measure in the first place, and of course no way to turn it off or keep it from creating all of that garbage. Also PCDMIS placed the CAD graphic of the dimensions at the CAD origin, completely detacted from all of the other features it decided to poo-poo all over the screen.

    So I guess Im stuck having to open and close programs to run each part.

    Sigh, yet another annoying time waster...
    Mr. Comment
    SCIROCCO-NT 13-20-10
    B3C-LC Controller (Leitz Protocol), SP600M, TP200
    PCDMIS CAD++ v4.3 MR1(Build: 12/11/08)
    sigpic

  • #2
    Blade and Gear packages are based around calling subroutines that run different styles of scans so I'm sure this can work very well. Sounds like a fun one actually.

    Comment


    • #3
      I'm running 4.1 and have many programs that do one, two, ... many different just using IF/ statments "scans included" wouldn't this be a easer way to do what you want. I have some programs that decide for themselfs what program or part of the program to run. And I have different Graphics come up for different things just by saving views and calling per what was run.

      Comment


      • #4
        Matt,

        I don’t think I’m going to be able to convenience management to fork out the money for another PCDMIS license. Sure its "fun" to fart around with trying different things, but I have to get these things done in a timely manner also.

        My first attempt at programming this (see attached pic) used looping and logic statements, and the code was nice and short (only 3 pages long). I could also step through the code and see that it was working like I would have expected. (It seemed to work fine for short segments)

        Now for the real world, the slowness problem became even more of an issue when it was time to measure the entire feature. PCDMIS took so long in "creating" each constructed point and redefining the array (eventually taking more then an hour) it just to slowed the computer down until I could read the code faster then it was (Progressively longer). The code came to a squeaking grinding standstill only during the first 501 hits, where all I was doing was converting the measured hits from the first scan into separate lines.

        The only work around for speeding up the processing of the code is to create a separate individually named feature for each measured scan hit I want to use else where in my program. (See Below Code)

        This code below is what it takes to measure just 1 section of the groove shown in the picture.

        Though you could hand type this entire BS in by hand for every point in your scans (I didn’t). Its better to have Visual Basic write the code directly into the PCDMIS edit window for you. Since most of this crap only has one or two variables that need to change within each command.

        Sample Code:

        SCN1_PNT1 =GENERIC/POINT,DEPENDENT,RECT,$
        NOM/XYZ,SCN1.HIT[1].TX,SCN1.HIT[1].TY,SCN1.HIT[1].TZ,$
        MEAS/XYZ,SCN1.HIT[1].X,SCN1.HIT[1].Y,SCN1.HIT[1].Z,$
        NOM/IJK,SCN1.HIT[1].TI,SCN1.HIT[1].TJ,SCN1.HIT[1].TK,$
        MEAS/IJK,SCN1.HIT[1].I,SCN1.HIT[1].J,SCN1.HIT[1].K
        SCN1_LIN1 =GENERIC/LINE,DEPENDENT,RECT,$
        NOM/XYZ,SCN1.HIT[1].TX,SCN1.HIT[1].TY,SCN1.HIT[1].TZ,$
        MEAS/XYZ,SCN1.HIT[1].X,SCN1.HIT[1].Y,SCN1.HIT[1].Z,$
        NOM/IJK,SCN1.HIT[1].TI,SCN1.HIT[1].TJ,SCN1.HIT[1].TK,$
        MEAS/IJK,SCN1.HIT[1].I,SCN1.HIT[1].J,SCN1.HIT[1].K,$
        DISTANCE/8,8
        SCN2_PNT23 =GENERIC/POINT,DEPENDENT,RECT,$
        NOM/XYZ,SCN2.HIT[23].TX,SCN2.HIT[23].TY,SCN2.HIT[23].TZ,$
        MEAS/XYZ,SCN2.HIT[23].X,SCN2.HIT[23].Y,SCN2.HIT[23].Z,$
        NOM/IJK,SCN2.HIT[23].TI,SCN2.HIT[23].TJ,SCN2.HIT[23].TK,$
        MEAS/IJK,SCN2.HIT[23].I,SCN2.HIT[23].J,SCN2.HIT[23].K
        SCN2_PNT24 =GENERIC/POINT,DEPENDENT,RECT,$
        NOM/XYZ,SCN2.HIT[24].TX,SCN2.HIT[24].TY,SCN2.HIT[24].TZ,$
        MEAS/XYZ,SCN2.HIT[24].X,SCN2.HIT[24].Y,SCN2.HIT[24].Z,$
        NOM/IJK,SCN2.HIT[24].TI,SCN2.HIT[24].TJ,SCN2.HIT[24].TK,$
        MEAS/IJK,SCN2.HIT[24].I,SCN2.HIT[24].J,SCN2.HIT[24].K
        SCN2_PNT25 =GENERIC/POINT,DEPENDENT,RECT,$
        NOM/XYZ,SCN2.HIT[25].TX,SCN2.HIT[25].TY,SCN2.HIT[25].TZ,$
        MEAS/XYZ,SCN2.HIT[25].X,SCN2.HIT[25].Y,SCN2.HIT[25].Z,$
        NOM/IJK,SCN2.HIT[25].TI,SCN2.HIT[25].TJ,SCN2.HIT[25].TK,$
        MEAS/IJK,SCN2.HIT[25].I,SCN2.HIT[25].J,SCN2.HIT[25].K
        SCN2_PNT26 =GENERIC/POINT,DEPENDENT,RECT,$
        NOM/XYZ,SCN2.HIT[26].TX,SCN2.HIT[26].TY,SCN2.HIT[26].TZ,$
        MEAS/XYZ,SCN2.HIT[26].X,SCN2.HIT[26].Y,SCN2.HIT[26].Z,$
        NOM/IJK,SCN2.HIT[26].TI,SCN2.HIT[26].TJ,SCN2.HIT[26].TK,$
        MEAS/IJK,SCN2.HIT[26].I,SCN2.HIT[26].J,SCN2.HIT[26].K
        SCN2_PNT27 =GENERIC/POINT,DEPENDENT,RECT,$
        NOM/XYZ,SCN2.HIT[27].TX,SCN2.HIT[27].TY,SCN2.HIT[27].TZ,$
        MEAS/XYZ,SCN2.HIT[27].X,SCN2.HIT[27].Y,SCN2.HIT[27].Z,$
        NOM/IJK,SCN2.HIT[27].TI,SCN2.HIT[27].TJ,SCN2.HIT[27].TK,$
        MEAS/IJK,SCN2.HIT[27].I,SCN2.HIT[27].J,SCN2.HIT[27].K
        SCN2_PNT28 =GENERIC/POINT,DEPENDENT,RECT,$
        NOM/XYZ,SCN2.HIT[28].TX,SCN2.HIT[28].TY,SCN2.HIT[28].TZ,$
        MEAS/XYZ,SCN2.HIT[28].X,SCN2.HIT[28].Y,SCN2.HIT[28].Z,$
        NOM/IJK,SCN2.HIT[28].TI,SCN2.HIT[28].TJ,SCN2.HIT[28].TK,$
        MEAS/IJK,SCN2.HIT[28].I,SCN2.HIT[28].J,SCN2.HIT[28].K
        SCN2_PNT29 =GENERIC/POINT,DEPENDENT,RECT,$
        NOM/XYZ,SCN2.HIT[29].TX,SCN2.HIT[29].TY,SCN2.HIT[29].TZ,$
        MEAS/XYZ,SCN2.HIT[29].X,SCN2.HIT[29].Y,SCN2.HIT[29].Z,$
        NOM/IJK,SCN2.HIT[29].TI,SCN2.HIT[29].TJ,SCN2.HIT[29].TK,$
        MEAS/IJK,SCN2.HIT[29].I,SCN2.HIT[29].J,SCN2.HIT[29].K
        SEC2_CIR1 =FEAT/CIRCLE,RECT,OUT,LEAST_SQR
        THEO/0,0,-1.006,0,0,1,77
        ACTL/-2.235,-2.478,-0.956,-0.0008489,-0.0000276,0.9999996,84.189
        CONSTR/CIRCLE,BFRE,SCN3_PNT1,SCN3_PNT2,SCN3_PNT3,SCN3_PNT 4,SCN3_PNT5,SCN3_PNT6,SCN3_PNT7,,
        OUTLIER_REMOVAL/OFF,3
        FILTER/OFF,UPR=0
        ASSIGN/V8 = SCN1_PNT1.TX+3.50*SCN1_PNT1.TI
        ASSIGN/V9 = SCN1_PNT1.TY+3.50*SCN1_PNT1.TJ
        ASSIGN/V10 = SCN1_PNT1.TZ+3.50*SCN1_PNT1.TK
        SEC1_PPNT1 =FEAT/POINT,RECT
        THEO/V8,V9,V10,SCN1_LIN1.TI,SCN1_LIN1.TJ,SCN1_LIN1.TK
        ACTL/-4.925,38.453,-0.94,0.1455113,-0.9893566,0.0000962
        CONSTR/POINT,PIERCE,SCN1_LIN1,SEC1_CIR1
        DIM SEC1_DIST1= 2D DISTANCE FROM POINT SCN1_PNT1 TO POINT SEC1_PPNT1 PAR TO POINT SEC1_PPNT1, NO_RADIUS UNITS=MM ,$
        GRAPH=ON TEXT=OFF MULT=10.00 OUTPUT=NONE
        AX NOMINAL +TOL -TOL MEAS DEV OUTTOL
        M 3.500 0.100 0.100 3.570 0.070 0.000 -------#-
        ASSIGN/V11 = "SEC1_POSITION_DATA_1" + ", "
        ASSIGN/V12 = SCN1_PNT1.TX + ", " + SCN1_PNT1.TY + ", " + SCN1_PNT1.TZ + ", " + SCN1_PNT1.TI + ", " + SCN1_PNT1.TJ + ", " + SCN1_PNT1.TK + ", "
        ASSIGN/V13 = SCN1_PNT1.X + ", " + SCN1_PNT1.Y + ", " + SCN1_PNT1.Z + ", " + SCN1_PNT1.I + ", " + SCN1_PNT1.J + ", " + SCN1_PNT1.K + ", "
        ASSIGN/V14 = SEC1_PPNT1.TX + ", " + SEC1_PPNT1.TY + ", " + SEC1_PPNT1.TZ + ", " + SEC1_PPNT1.TI + ", " + SEC1_PPNT1.TJ + ", " + SEC1_PPNT1.TK + ", "
        ASSIGN/V15 = SEC1_PPNT1.X + ", " + SEC1_PPNT1.Y + ", " + SEC1_PPNT1.Z + ", " + SEC1_PPNT1.I + ", " + SEC1_PPNT1.J + ", " + SEC1_PPNT1.K + ", "
        ASSIGN/V16 = SEC1_DIST1.M.NOM + ", " + SEC1_DIST1.M.MEAS
        FILE/WRITELINE,FPTR,V11+V12+V13+V14+V15+V16
        The code above executes in a fraction of the time it takes for any code with Loops or Logic in it. So what took hours before and then crashes without explanation, will completely measure, calculate and write everything out to text file in under 4 mins, however the program is also over 18,000 lines long, so not exactly easy to edit later on.
        Last edited by MrComment; 04-17-2007, 12:34 PM.
        Mr. Comment
        SCIROCCO-NT 13-20-10
        B3C-LC Controller (Leitz Protocol), SP600M, TP200
        PCDMIS CAD++ v4.3 MR1(Build: 12/11/08)
        sigpic

        Comment


        • #5
          I've got a quick question. How is this "DIM SEC1_DIST1= 2D DISTANCE FROM POINT SCN1_PNT1 TO POINT SEC1_PPNT1 PAR TO POINT SEC1_PPNT1, NO_RADIUS UNITS=MM ,$
          GRAPH=ON TEXT=OFF MULT=10.00 OUTPUT=NONE
          AX NOMINAL +TOL -TOL MEAS DEV OUTTOL
          M 3.500 0.100 0.100 3.570 0.070 0.000 -------#-"

          working? 2D distance parallel to a POINT?????

          Comment


          • #6
            It does actually work.

            The graphic shows the end result when the entire 18000 line program is executed.

            The command apparently interprets the Point similarly as if you constructed a cast line based off one hit point. However that doesnt quite work as expected (well at least not entirely) because a cast line gets constructed where the point becomes an endpoint and not the midpoint like a Generic Line would as shown below. Cast lines gets confusing because the dimesions will interpret the Theo location from the midpoint of the cast line, instead of whats in the edit window of the program.

            SCN1_LIN1 =GENERIC/LINE,DEPENDENT,RECT,$
            NOM/XYZ,SCN1.HIT[1].TX,SCN1.HIT[1].TY,SCN1.HIT[1].TZ,$
            MEAS/XYZ,SCN1.HIT[1].X,SCN1.HIT[1].Y,SCN1.HIT[1].Z,$
            NOM/IJK,SCN1.HIT[1].TI,SCN1.HIT[1].TJ,SCN1.HIT[1].TK,$
            MEAS/IJK,SCN1.HIT[1].I,SCN1.HIT[1].J,SCN1.HIT[1].K,$
            DISTANCE/8,8
            Technically I could probably reduce my code by 501 lines by just using the Generic lines in my Dimensions, but that actually makes less sense to me then using two seperate points.

            Also after reviewing my code I posted earlier I just noticed I posted the "wrong" circle from the edit window. Oops, but Im sure you get the idea.

            My method & other notes:
            1. Construct "Generic Points" from Outer Scan's Hits (Perhaps an optional step)
            1.1 - Use Generic Points because cast points execute slower (dont know why)
            1.2 - Cast points also do not automatically update their Theo values
            1.3 - Scan hits change their theos part to part (You can't avoid Findnoms for Defined Scans, even if you set it as Nominals it will do a Findnoms anyway.(As such you must have CAD)
            2. Construct "Generic Lines from the same hits as step 1
            2.1 - Reference step 1, same issues as above.
            2.2 - Dont use CAST Lines because cast line Theo gets created from the point as an endpoint and not the midpoint, dimensions will reference the Theo midpoint anyway. Just use Generic Lines instead and save yourself the headache.
            3. Construct BF Circles for boundary arcs from 7 of the hits within proximity of each lines pierce point.
            3.1 - This could be better if you could create the pierce points from constructed Arcs or the Scan itself.
            3.2 - Yet to determine best method for creating boundaries off of theorectially straight features.
            3.3 - Number of points used to construct circles can create artifically filtered results. Which may be unwanted, fewer points would result in less filtering, too few may create gigantic boundary circles
            4. Construct Pierce points, from the Generic Lines with Circles.
            4.1 - Pierce point theos do not automatically recalculate with new Theos on execution.(They need to because the scans hits update their theos on every part) Therefore you have to manually solve for these, and therefore must know the correct groove width ahead of time. Why cant the pierce point, have a findnoms option also?
            5. Create 2D dimension between Generic Point and Pierce Point.
            5.1 - Dimensions seem to ignore the Theo distance between two points if they change after creation. There should be an option to have it recalc the Theo or Nom distance as well. This isnt so much of a problem as long as the Theo width doesnt change.
            6. Write the Point data and dimension results to text file for Excel formatted as CSV.
            Mr. Comment
            SCIROCCO-NT 13-20-10
            B3C-LC Controller (Leitz Protocol), SP600M, TP200
            PCDMIS CAD++ v4.3 MR1(Build: 12/11/08)
            sigpic

            Comment

            Related Topics

            Collapse

            Working...
            X