PCDMIS Automation with Visual CSharp 2010 Express

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

  • PCDMIS Automation with Visual CSharp 2010 Express

    Introduction to PCDMIS Automation

    It will take a number of postings in this thread to present all the topics needed to understand and implement my particular method of PCDMIS automation. If you're interested in this thread or want to comment on some part of it, would you consider doing so by email to me. I will reserve the questions and comments and include them in the relevant posting that should answer the question(s). I think this way the thread stays organized and on topic.

    Everything I post will work with PCDMIS any version 3.7 and up and MS Visual C Sharp 2010 Express. Sorry no VB Express examples at this time, maybe later after the entire method is presented, I'll go back and add VB. But if you haven't used C Sharp or the MS Visual C Sharp Express IDE, don't worry, the C Sharp code will be very easy to follow and there will be a number of postings that will explain the IDE and how to use it.

    For more in-depth exposure to programming in C Sharp I recommend any of the Visual C Sharp 2010 books available. I'm going to try and stay on topic and focus on presenting the method of PCDMIS automation. If I see that a few of you are stuck on a particular C Sharp issue, I'll present a short side bar, so to speak, to maybe help you out.

    I make no claims of expertise in the 'correct method' to measure features using CMM. In fact I frequent this forum to learn of such things from others.

    To follow this series of postings you will need:
    1. Any version of PCDMIS 3.7 and higher.
    2. Online or offline.
    3. MS Visual C Sharp Express 2010, installed using default settings.

    Express 2010 can be downloaded free at:

    http://www.microsoft.com/visualstudi...csharp-express

    In addition to the above items, I also recommend using the following PCDMIS file path settings, once you see how things work and interact with each other, then you can modify the code so that your preferred file path settings will still work.

    PCDMIS Search Path Settings
    Set 'Default Part Program Directory' to anything other than the default installation directory of PCDMIS. I use c:\PcdmisApps\.

    Set 'Probe Directory' to a folder located in part program directory. I use c:\PcdmisApps\Probes.

    Set 'Recall Directory' to another folder in the part program directory. I use c:\PcdmisApps\Alignments.

    At some point we will be creating an application folder, also located in the part program directory. Name this folder something that leaves no doubt what part the application is to measure. I use the name of the part being measured. When ever I use *App-folder* I mean for you to substitute the name that you gave the application folder. I will reference this a lot.

    Inside the *App-folder* are several standard folders which I use inside every application folder. They are:
    Doc - Contains application user documentation and/or other notes.
    Data-sets - Contains data used by application.
    Subroutines - PCDMIS subprograms.
    DotNet - The DotNet executable and libraries.
    Reports - Reports generated by PCDMIS or DotNet application.

    All PCDMIS programs (.PRG files) used by the application are located in the *App-folder* for which is was written.

    The method for automating PCDMIS being presented here was developed to answer the following requirements.

    1. Parametric PCDMIS programs for the measurement of a family of parts using one PCDMIS program.
    2. Hide the PCDMIS IDE from the CMM operator.
    3. Internationalization (multi-language user interface)
    4. Bidirectional interaction with databases for part data and measurements.
    5. Bidirectional interaction with Quality documents in MS Excel or Open Office.
    6. To resolve performance and maintenance issues with PCDMIS code.

    The first objective is to learn how to create a C Sharp application uses the PcdmisSession library to interact with the PCDLRN in various ways.

    The second objective is to demonstrate how to create a PCDMIS parametric program

    The third objective is explain the contents PcdmisSession library, so that you can make changes to suit your requirements. This library is where the actual connection to PCDMIS happens. I built this library so that I wouldn't have to write the same code for each application.

    The fourth objective is to demonstrate how to read/write measurement data from the PCDLRN to a spreadsheet.

    I am interested in hearing from you if any of the code shown in this thread is not working for you, please email me if something doesn't seem to work as demonstrated.

    In the next post I will start by providing the PcdmisSession library (dll) file which contains everything needed to connect to and bidirectionally interact with PCDMIS or more accurately the PCDLRN process. As I mentioned before, details or source code for the library will be presented last.

    I'm going to assume that most have not used the C Sharp Express IDE, so I will present some pointers to help you get started and include an avi movie file of my screen as I demonstrate concepts.

  • #2
    The PcdmisSession LIbrary

    Before starting this activity you will need to have downloaded the zip file containing the PcdmisSession Library.

    You will also need to have started 'Microsoft Visual C# Express 2010' program at least once to set up the default IDE folders. Be sure to register and get the registration code (no cost) and follow the steps to register your copy.

    Create a folder named 'PcdmisLibrary' in the 'Visual Studio 2010' folder which is located in your 'My Documents'. UnZip and place the contents of the zip file into this folder.

    PcdmisSession.zip

    Comment


    • #3
      Subscribed.

      Comment


      • #4
        subscribed

        Comment


        • #5
          Creating and Setting up your first PCDMIS automation application.

          In lesson 1.0 Avi.
          You will start your first AutoPcdmis application, learn how to make certain settings to prepare your application for PCDMIS, and learn how to include a reference to the PcdmisSession library and your copy of PCDMIS. During the lesson I will be demonstrating how to change the version of Microsoft FrameWork the application uses, this is required because both the application (that you create) and the PcdmisSession Library must use the same version of Framework. The PcdmisSession Library was developed using MS FrameWork 3.5, therefore your application must use the same.

          Adding a reference is a way for making known to your application other resources of which it can use. In this case the reference to the PcdmisSession library makes available the C# code included in the library. The second reference we will make is to the PCDMIS or PCDLRN object. This reference is needed by the PcdmisSession library. Our DotNet application will never directly communicate with the PCDLRN object, all communication with the PCDLRN will happen through the PcdmisSession Library. The why of this I will explain as we get further along in this thread. The main point here is that you will perform the actions of this lesson for each dotnet application you create.

          The lesson video can be view at YouTube at this link: http://youtu.be/r4iZ2KB41EA

          Comment


          • #6
            Connecting to the PCDLRN

            Lesson 1.1

            Sorry about the viewing quality of the 1st video, I'll try another setting on the next video.

            Now that you have started your application and made the necessary references, lets continue and see how to connect your DotNet application to PCDMIS, or more specifically the PCDLRN by using the PcdmisSession Library.

            To do this we add four lines of code to your application.

            1> Using PcdmisSession;
            2> DmisSession Session;
            3> Session = New DmisSession("myApp");
            4> Session.connectPcdmis();

            The line numbers are not part of the code.

            Line 1 declares to the IDE and compiler that we intend to use the code contained in the PcdmisSession library somewhere in this body of code.

            Line 2 declares that the variable 'Session' is of the type 'DmisSession' which is a class contained within the PcdmisSession library.

            Line 3 is where the variable becomes an object or instance of the DmisSession class.

            Line 4 invokes the connection to the PCDLRN. After the connection is made, we will be able to use the 'Session' variable/object to perform many other interactions with the PCDLRN.

            One of those interactions is the ability turn the visibility of the PCDMIS IDE window on and off. We will do this by adding a visual check-box object to the application window form. A method is then added to the code section of the application, that will be executed each time you check and uncheck the check-box object.

            You will also learn about the Object viewer which will useful as you write and use DotNet to perform PCDMIS automation. In this video we also add a check-box object to the application window form. We change the 'Text' property of the check-box object as well as the name of the check-box. For each visual object we add to the main window form, there is a list of properties we can change to modify the visual object.

            It is essential that you are able to successfully perform the actions shown in this video. The lessons that follow are dependent on your first application working. Please let me know via email what issues you may have.

            The link to the video is: http://youtu.be/fvgfuFcuyo4

            Comment


            • #7
              Subscribed, this topic and intial posts have peaked my interests good sir.

              Comment


              • #8
                Just wondering if you have any additional comments to add?
                Been waiting a while for updates.
                Roses are red
                Violets are glorious
                Don't try to sneak up
                On Oscar Pistorius.

                MIL-TFP-41C

                3.7mr3, 2012mr1, 2013mr1

                Comment


                • #9
                  I will definitely be looking forward to see what can be done with this! When the comments become to much maybe the admin can delete these and leave only the 'lessons'.

                  Comment


                  • #10
                    Subscribed

                    Comment


                    • #11
                      How can i download PcdmisSession.zip ?

                      [email protected]

                      Best Regards,
                      Marco Gaspar

                      Comment


                      • #12
                        From this post?

                        http://www.pcdmisforum.com/showthrea...l=1#post334671
                        PC-DMIS CAD++ 2o19 R1 SP6

                        Comment


                        • #13
                          Bad luck!

                          i have no access to youtube in China.

                          so,would you please send the vadio files to me by email?

                          [email protected]

                          many thanks!

                          Comment


                          • #14
                            Originally posted by quentin66 View Post
                            Bad luck!

                            i have no access to youtube in China.

                            so,would you please send the vadio files to me by email?

                            [email protected]

                            many thanks!

                            I get it via VPN.THANKS

                            Comment


                            • #15
                              any more lessons?

                              Comment

                              Related Topics

                              Collapse

                              Working...
                              X