hexagon logo

PC-Dmis Automation C#

So I retired as of last July, but had all this stuff about PC-Dmis Automation which I've finally got around to uploading. Don't know it it is of any interest, but here it is.

The zip file has to Visual Studio project folders, both written in C#. One folder is a Class Library which has all the code for connecting with and dynamically interacting with PC-Dmis. The second folder is a C# application with uses the Class Library to connect and interact with PC-Dmis.

I also included two documents one explains how to setup the two Projects the other is about the application program.

Rather than trying to anticipate every possible question, the provided documents should be sufficient for someone familiar with visual studio and C#. Otherwise, I'll watch for questions to show up here. I can't promise to answer every question, given the complexity of what the answer might require. But I have taken phone calls and zoom opens up the possibility to demo live.

Good Luck

https://drive.google.com/drive/folders/1EDMe0GvN6TC_0Fcr_7Zt7_UqH-EV_8o2?usp=sharing
Parents
  • I received some messages with several questions on Visual Studio regarding setting up C# for writing programs for PC-Dmis, so I created this long comment that hopefully may answer some of those questions. This is in two parts, this part is mostly about setting up a bare bones application that connects with PC-Dmis. The second part has the actual code for this bare bones project. This bare bones project does not use any code from the google drive in my first comment above. It just has the bare minimum code for connecting to PC-Dmis in a separate thread.

    Good Luck

    Here are the steps for creating a barebones C# application that connects to PC-Dmis. This is not really what I consider a best practice form of writing C# code, but it does present a simplified code view of the process. In this demo I'm using the Community 2019 Edition of Visual Studio (it's free). Other version are okay, the interface on startup may differ but all the same tasks for creating a new project are the same, just located on different menus.

    I start Visual Studio and select 'Create a new project'.



    Select 'Windows Forms App (.NET Framework)'



    If you're new to C# use the same Project name and Solution name (uncheck the 'Place solution and project in the same directory' box if checked) that I use in the screen shot below. Under 'Framework', it doesn't generally matter which framework version you choose as long as use use the same version for all your PC-Dmis C# programming apps and libraries. The later versions may have C# code features not available in earlier versions. I've been using 4.5 successfully for the past couple of years.



    We now add the reference to the PC-Dmis COM file. On the right side of the VS window is the 'Solution Explorer'.. Right-click on 'References' and select 'Add References'.

    In the 'Reference Manager' pop-up menu (see next image below), on the left side select 'COM'. Then in the center pane, scroll down to a 'PC-DMIS ####.# Object Library' entry. Select that line ( if you have more than one version of PC-Dmis installed, pick one, it doesn't matter which). After selecting the line, be sure to also click on the check box to the left of that line. Now click the 'OK' button on bottom right.



    The 'Solution Explorer' should look like the following image. Note the addition of 'PCDLRN' to the list under 'References'.



    Next we create the User interface.
Reply
  • I received some messages with several questions on Visual Studio regarding setting up C# for writing programs for PC-Dmis, so I created this long comment that hopefully may answer some of those questions. This is in two parts, this part is mostly about setting up a bare bones application that connects with PC-Dmis. The second part has the actual code for this bare bones project. This bare bones project does not use any code from the google drive in my first comment above. It just has the bare minimum code for connecting to PC-Dmis in a separate thread.

    Good Luck

    Here are the steps for creating a barebones C# application that connects to PC-Dmis. This is not really what I consider a best practice form of writing C# code, but it does present a simplified code view of the process. In this demo I'm using the Community 2019 Edition of Visual Studio (it's free). Other version are okay, the interface on startup may differ but all the same tasks for creating a new project are the same, just located on different menus.

    I start Visual Studio and select 'Create a new project'.



    Select 'Windows Forms App (.NET Framework)'



    If you're new to C# use the same Project name and Solution name (uncheck the 'Place solution and project in the same directory' box if checked) that I use in the screen shot below. Under 'Framework', it doesn't generally matter which framework version you choose as long as use use the same version for all your PC-Dmis C# programming apps and libraries. The later versions may have C# code features not available in earlier versions. I've been using 4.5 successfully for the past couple of years.



    We now add the reference to the PC-Dmis COM file. On the right side of the VS window is the 'Solution Explorer'.. Right-click on 'References' and select 'Add References'.

    In the 'Reference Manager' pop-up menu (see next image below), on the left side select 'COM'. Then in the center pane, scroll down to a 'PC-DMIS ####.# Object Library' entry. Select that line ( if you have more than one version of PC-Dmis installed, pick one, it doesn't matter which). After selecting the line, be sure to also click on the check box to the left of that line. Now click the 'OK' button on bottom right.



    The 'Solution Explorer' should look like the following image. Note the addition of 'PCDLRN' to the list under 'References'.



    Next we create the User interface.
Children
No Data