hexagon logo

Study hard (want to write scrip of loop measure)

I want to know how to perform a feature by VBS. For example, a separate-execution "PNT1".such as the "CTRL+E",how to achieve this script.
seeking the core code or key function
  • Create feature in PCDMIS. File>Export>BASIC. Study result. Keep it simple to start.
  • thanks,but this problem how to solve
    ???core code ???
  • I want to know how to perform a feature by VBS. For example, a separate-execution "PNT1".such as the "CTRL+E",how to achieve this script.
    seeking the core code or key function


    I'm trying to understand exactly what you want to accomplish, and also why you would want to do so.

    CTRL-E is mouse-cursor dependent execution of a single feature (or move).
    It is an action that is only performed manually by the user, and is used for testing purposes.
    Is that really what you want to automate with VB?

    If so, why?
    It is common to use VB to automate the writing and execution of entire part programs. This meets the goal of automated inspection.

    The only goal for automated single-feature-execution I can possibly think of is re-inspection, where a dimension failed so we want to double-check it's feature. However this usually occurs after more manual steps, such as cleaning or deburring, and usually involves the manual operation of "knowledgeable CMM person watches stylus hits to look for problems". Is re-inspection your goal?

    - Josh
  • I'm trying to understand exactly what you want to accomplish, and also why you would want to do so.

    CTRL-E is mouse-cursor dependent execution of a single feature (or move).
    It is an action that is only performed manually by the user, and is used for testing purposes.
    Is that really what you want to automate with VB?

    If so, why?
    It is common to use VB to automate the writing and execution of entire part programs. This meets the goal of automated inspection.

    The only goal for automated single-feature-execution I can possibly think of is re-inspection, where a dimension failed so we want to double-check it's feature. However this usually occurs after more manual steps, such as cleaning or deburring, and usually involves the manual operation of "knowledgeable CMM person watches stylus hits to look for problems". Is re-inspection your goal?

    - Josh


    thanks Josh
    in fact , I want to write scrip of loop measure , but it can not be achieved by use “PCDLRN.PartProgram.AsyncExecute”.so , I want to try to other method!!
  • thanks Josh
    in fact , I want to write scrip of loop measure , but it can not be achieved by use “PCDLRN.PartProgram.AsyncExecute”.so , I want to try to other method!!


    Looping is fun and easy inside of PC-DMIS.
    Write the loops in PC-DMIS, export your file to BASIC, and there you have the code.
  • thanks Josh
    in fact , I want to write scrip of loop measure , but it can not be achieved by use “PCDLRN.PartProgram.AsyncExecute”.so , I want to try to other method!!


    One of the things I will demonstrating in my thread 'Automating PCDMIS with Visual C#' is a way of performing loops with Automation code.

    In our shop we have inspection process where the individual parts are set next to each other on the table surface against an 'L' bracket. The length and width of the part varies, because of this fact the number of parts which fit on the table varies. It is also possible that 1 to maximum number of possible parts may be measured in one setting. It also possible that if 9 possible parts can be arrayed 3X3. The operator may choose to have only 3 parts placed in one column or the same three might be arrayed in the top row.

    In one example the Dotnet application is configured by the operator with the selected parts in the selected arrangement and the measurement is begun. The first part parameters are written to a subroutine file via the PCDLRN, then the measurement program is started by using a call to the AsyncExecute method of the PCDLRN. The measurement program calls the subroutine which was updated previously. The DotNet application is listening via an event delegate for the end of the pcdmis program. When it is notified that the current measurement program has ended, the Dotnet application queues up the next part and the process is repeated.

    Because the PCDMIS program is executed asynchronously, the DotNet application is still active and can be used to view the measurement report of completed parts while the measurement process is still continuing with the remaining parts.

    Because of all the possibilities it's hard to answer your question specifically without having a better description of your particular scenario.

    The library I provide in my thread is already capable of doing the above. By the way if you're fairly experienced with VB the library should work with Visual VB as long as you are using MS Framework 3.5.
  • Don't know if this matters to anyone, but I was able to create a step and repeat program code for our machining centers. It used just one part program to run the quantity needed on the billet. It would run one or more up to the full quantity that was allowed. The start location could be varied by setting a variable related to parts previously ran and the quantity variable would determine the end point. It worked great, Disappointed but we don't use it because we're scared or something. Can't recall the code, but it had 1,2,3,4,5, 6 variables two controled quantity and start part, two controlled X,Y location and any others were used for calculations only. There were more variables to hold constants too. It only ran the same direction whereever it started X+ to X- tehn step Y- or any other direction, but it was always the same. Not sure how it could be converted into PC-DMIS commands but I could give a short of it if you were interested.
    Thought maybe your operator could arrange the parts in the set direction and just set the variable to equal the quantity and it would stop when done. I belive it was a WHILE DO statement.