Event Handling from PCDLRN Object

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

  • Event Handling from PCDLRN Object

    I've developed a VB.NET program that uses the PCDLRN object. The VB program gets inputs from operator and datafiles. Based on the inputs, the VB program uses automation to generate a PCDMIS part program and execute. Everythings works great, now I want to add code to handle events generated by PCDMIS but when I set it up according to page 176 of the PCDMIS basic manual none of the event handlers are entered.

    Any Ideas?

  • #2
    OK I was just able to create a sub for a PCDMIS event. It went smooth creating it like you but I have not run it to see if it handles the event. I'll give it a shot hopefully but it won't be today. Is there anything specific you'd like me to try?

    VB.Net 2005

    Craig
    <internet bumper sticker goes here>

    Comment


    • #3
      I would like to handle either the OnEndExecute or OnObjectExecuted event.

      Comment


      • #4
        Could you please post your program? I am trying to do something similar but have been unsuccesful. I'd like to try too what you seem to want to do.


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

        Comment


        • #5
          OK I'll give it a shot. Hopefullt tomorrow. As an alternative you might be able to code it to call a sub from the end of your sub that executes your part program. Essentially that sub is executing until PCDMIS completes the part program execution. I'm not sure what you have going on so I don't know exactly what your solution will be.

          How are you with VB? I'm pretty green.

          Craig
          <internet bumper sticker goes here>

          Comment


          • #6
            For the moment I'm calling the DmisPartProgram.Execute() from within a worker thread. I do this so that the VB user interface isn't dead while PCDMIS is executing. I have a Gridview component in the interface which displays the measurement results of previously measured parts. The Gridview is populated with data from an MS SQL database where the measurement results are stored.

            The worker thread has an event which is triggered when the DmisPartProgram.Execute() method is completed . So I put the code for collecting the measurement data, writing the data to the database, updating the gridview and Xbar charts (which are also on the user interface).

            I built this application mostly because of a need here in our shop, and partly out of interest in just doing it to see if it could be done. So I look thru the Object brower at the various PCDLRN objects and methods, find something interesting so I plug it into the VB program just to see how it works

            As for VB experience...my job for the past 20 years has been primarily creating custom solutions for CAD/CAM application via 3rd generation languages. Sometimes I would be use an internal language like Cypress Basic is internal to PCDMIS or CVMAC is internal to Cadds5 etc, other times it would be using C, C++, Java, FORTRAN or C# to create sharable code modules callable from within the parent CAD/CAM software.

            I'll create a bare bones VB program and post it here, maybe by tomorrow.

            Comment


            • #7
              Just as an update I did a bare bones with Vb.net 2005 and nada on the events you mentioned. So I did the same with Excel (start PCDMIS > open a .prg that I hard coded in my app > execute > then quit PCDMIS after excution) with events (I put a message box in each event) still nada, no message boxes at said events.

              Craig
              <internet bumper sticker goes here>

              Comment


              • #8
                Hi all. (A belated Merry Christmas and Happy New Year to you all!)

                I've created a working example of PC-DMIS Event Handling for anyone insterested. It doesn't do anything terribly exciting; it essentially shows message boxes from Excel when three events are called in PC-DMIS (when a part program opens, when it executes, and when it finishes executing).

                Please download the attached .zip file. Inside you will find an Excel worksheet (.xls). Follow the instructions that appear within the Readme.txt and the worksheet.

                (You can also get this file from the Custom Script Repository.)

                Let me know if you have any questions. While I admit I'm no expert in all this, I'll do my best to help where I can.
                Attached Files
                Jared Hess - PC-DMIS Documentation Team Lead @ HMI
                [View 2008 Reporting Tutorials Here]

                Comment


                • #9
                  Hi

                  I was wondering how far you have gone with PC-DMIS and VB.NET?

                  Have you done any printing?

                  I have a launcher program that is working nicely, except for printing. It will randomly only print have a page (spliting 1 page into 2, doubling the number of pages printed). If I open the same program that just ran (directly in PC-DMIS) and manually print the report, it prints out normal - as it does if the operator executes the program directly in PC-DMIS. This is ver 3.7mr3

                  Sorry to hi-jack your thread.
                  sigpic:rolleyes:

                  Comment


                  • #10
                    Originally posted by SeanO View Post
                    I was wondering how far you have gone with PC-DMIS and VB.NET?

                    Have you done any printing?

                    I have a launcher program that is working nicely, except for printing. It will randomly only print have a page (spliting 1 page into 2, doubling the number of pages printed). If I open the same program that just ran (directly in PC-DMIS) and manually print the report, it prints out normal - as it does if the operator executes the program directly in PC-DMIS. This is ver 3.7mr3

                    Sorry to hi-jack your thread.
                    I wrote a front end in VB.Net that prints and I get the same thing. I hate that, I have not figured it out but I did come up with a workaround. My VB app picks up the .rtf file that PCDMIS spits out and displays it in an .rtf box. If I print it as a string (from the box) it prints formatted with all of that space even though it is not displayed that way. So what I did is I put an option in my front end to print with MS Word. I automate MS Word to print the document without Word being displayed. I had to pause the thread a little (3 seconds) to give it time to get to the printer but it not only prints in color like I wanted but it prints without all of that space. It is not the best solution especially since I late bind Word and you will have issues if Word is already open but it is working for me.

                    What version of .Net are you using? I can share my example. It requires you to print out an .rtf from PCDMIS.
                    <internet bumper sticker goes here>

                    Comment


                    • #11
                      Craig,
                      Email one of those RTF files with the extra space in it. I want to see what is making the extra space.
                      thanks
                      Links to my utilities for PCDMIS

                      Comment


                      • #12
                        OK Done.
                        <internet bumper sticker goes here>

                        Comment


                        • #13
                          The info provide by Jared Hess does work. Regarding the printing issue, I don't mind the hijack, it only raises an issue that I haven't got to yet as I explore the various ways of developing and automating PCDMIS programs.

                          Regarding what version of VB.net: I'm using the free copy of VB.net 2005 Express. Comes with MS SQL and .Net 2.0

                          It seems to work ok, no complaints.

                          At my site I have responsibility for 7 local CMM's currently running mm4. I was recently given responsibility for development of measurement programs in PCDMIS for these 7 and 8 other CMMs located in Poland, France, Spain, Thailand and Germany.

                          I'm currently in the process of upgrading the 7 local CMMs to PCDMIS 3.7mr3 with mm4 Legency 5.03 and Datapage (v?).

                          We measure parts that are similar in shape but vary greatly in size. Our current mm4 programs are parametric in the sense they read a data file built for a specific part to obtain the dimensions, tolerance, location and vectors of the features to be measured. Cell operators know only how to setup the part, run the correct program, answer the prompts and read the results.

                          Shop managers want to keep it that way as we migrate to PCDMIS.

                          My initial impression of developing generic part measurement programs using PCDMIS/Cypress Basic is that it's flaky. Features/Dimensions don't consistently update with part input data (nominal measurement and tolerance values). Development of multi-lingual application is not as straight forward as it is in VB. I’m not sure why Wilcox decided to use Cypress Basic instead of VBA. There are other companies such as the makers of TurboCad and the makers of Espirit (CAM) who have incorporated VBA into their applications.

                          It seems for now I can get better results by:
                          1. Using PCDMIS in learn mode to develop a measurement program for a part. Focus only on the measurement of features.
                          2. Export the PCDMIS program as a Basic program. Insert the Basic program into a VB.net module.
                          3. Replace hard code values in the PCDMIS/basic statements with VB.net variables. (This is an over simplification of what I really do with these Basic statements)
                          4. Use the VB.net main program to present and get info/input from the operator, obtain and control the PCDMIS object, and read the part data file.
                          5. Using the PCDMIS object create a new program object, call the VB module containing the PCDMIS commands (from step 2) which then writes into the program object a new PCDMIS program with features correctly configured for the part.
                          6. Execute the PCDMIS program.

                          My current working code for testing the above is a little to much to upload as an example. It seems there are at least a few here who are interested or have already done something like this. I'll upload my sample code in the section of the forum for PCDMIS programming. On a side note, somebody 3 levels up from me, who lives in Europe has dictated that any customizations done to PCDMIS shall be written in C++. The reason is because he heard that VB would be obsolete by 2008.

                          Comment


                          • #14
                            Originally posted by kneislyd View Post
                            Regarding what version of VB.net: I'm using the free copy of VB.net 2005 Express. Comes with MS SQL and .Net 2.0
                            I am using VS2005 Pro and .NET 2.0.

                            Originally posted by kneislyd View Post
                            It seems for now I can get better results by:
                            1. Using PCDMIS in learn mode to develop a measurement program for a part. Focus only on the measurement of features.
                            2. Export the PCDMIS program as a Basic program. Insert the Basic program into a VB.net module.
                            3. Replace hard code values in the PCDMIS/basic statements with VB.net variables. (This is an over simplification of what I really do with these Basic statements)
                            4. Use the VB.net main program to present and get info/input from the operator, obtain and control the PCDMIS object, and read the part data file.
                            5. Using the PCDMIS object create a new program object, call the VB module containing the PCDMIS commands (from step 2) which then writes into the program object a new PCDMIS program with features correctly configured for the part.
                            6. Execute the PCDMIS program.
                            Wow...that's a lot more than what I'm doing:
                            1. Part Program is developed offline, moved to network share.
                            2. A new "button" is created in my launcher app using Path, run options, operation pictures for the part program.
                            3. The operator clicks the launcher button and I pass the part program path/options to an already running instance of PCDMIS (it's started when the launcher is started).
                            4. Part program is executed.

                            (See the attachment for the basic layout.)

                            Originally posted by kneislyd View Post
                            The reason is because he heard that VB would be obsolete by 2008.
                            Attached Files
                            sigpic:rolleyes:

                            Comment


                            • #15
                              How do you handle variations in feature size nominials? Typical part may have 5 -10 features which vary in size from part to part. We might make 2 to 12 of the same size part.

                              Thanks

                              Comment

                              Related Topics

                              Collapse

                              Working...
                              X