Close DMIS after program runs

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

  • Close DMIS after program runs

    Is there a way to put some VB code in the end of program to make it close the application after it measures the part?

    Thanks,


    Gail

  • #2
    What do you want to do?

    You can also use Script to start a .BAT file. I run my PC-DMIS program and then I wrote some VB stuff to move files around for archival purposes. I start this VB file through a script call. In the Script, I execute a .BAT file in that .BAT file, I call the VBS file. Works great for me.

    Why do you really want to close the part program, before running the VB???


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

    Comment


    • #3
      It sounds like he wants to exit PCDMIS after the end of the program cycle... I too am curious why thats necessary...
      Links to my utilities for PCDMIS

      Comment


      • #4
        PCDMIS has plenty of "features" that bomb the whole application out. Put one of those at the end of your program.
        <internet bumper sticker goes here>

        Comment


        • #5
          Originally posted by craiger_ny View Post
          PCDMIS has plenty of "features" that bomb the whole application out. Put one of those at the end of your program.
          So True,
          sigpic

          B&S Global 544
          Using 3.7mr3


          Peace
          Greg


          Nothin left ta dew but :) :) :) !

          Comment


          • #6
            Originally posted by Gregl View Post
            So True,
            So I guess recommending PCDMIS to a new person is like trying to get your buddies married...
            Links to my utilities for PCDMIS

            Comment


            • #7
              OK this is someone new so I guess she should get legit help.

              What Jan said is the ticket. Any info you can give us would always be a help. Sometimes questions can seem straight forward but with this stuff there is always at least 10 different solutions for every problem. We are here to help with any recommendation you need, especially if you need a beer recommendation. But if you need help with this PCDMIS problem that is OK too, we have good heads here.
              <internet bumper sticker goes here>

              Comment


              • #8
                gplush,

                I think what you want is a VB application to run your programs. That is the only way I can think of that will close your program for you. You can also run programs sequentially if you wished.
                I used to be high on life but I built up a tolerance.

                Brown & Sharpe Global Advantage
                PCDMIS CAD++ v2011mr2
                PH10MQ/SP600M


                sigpic

                Comment


                • #9
                  Originally posted by gplush View Post
                  Is there a way to put some VB code in the end of program to make it close the application after it measures the part?

                  Thanks,


                  Gail


                  G

                  This can definitely be done, as other said, with a script. BUT, to get it right we need to know what you are trying to accomplish. How many programs will you have to choose from (1 or more than 1)? Can the program be started from outside of PC-DMIS?

                  Comment


                  • #10
                    Sorry, I got pulled into a couple other messes. Eventually, I'm going to get the operator touch screen. My immediate goal is to keep the operators from going out and selecting programs. What I have done is put the program number in a shortcut. So, I want them to click the shortcut and launch the program. When it is done, I want DMIS to close, forcing them to click their program.

                    Thanks,


                    Gail

                    Comment


                    • #11
                      Run this .bas at the end of your program. Note it will save your part programs when it closes, use PartProg.Quit if you don't want to save. Also it will close immediately after the inspection routine so the report will not be visible when the routine is done so I hope you are printing it out. You can put an operator comment before the .bas call to keep it open to view.

                      Code:
                      Sub Main()
                      
                        Dim PcdmisApp As Object
                        Set PcdmisApp = CreateObject("PCDLRN.Application")
                        Dim PartProg As Object
                        Set PartProg = PcdmisApp.ActivePartProgram
                        PartProg.Close
                        PcdmisApp.Quit
                        
                      End Sub
                      Last edited by craiger_ny; 08-17-2007, 01:16 PM.
                      <internet bumper sticker goes here>

                      Comment


                      • #12
                        I think the easiest way to do that is to write some VB in Excel. If you have Excel, you already have this. Search the board here and you will find some simple examples to get started.

                        This way, you can create some buttons in Excel that they can press.

                        Or if you are more adventurous, use VB, as many other threads will be able to help you with.


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

                        Comment


                        • #13
                          I put the script file in, but it isn't working. I'm going to keep plugging away at it.

                          Comment


                          • #14
                            I'm getting a "run-time error" on line 6

                            Comment


                            • #15
                              Originally posted by gplush View Post
                              I'm getting a "run-time error" on line 6
                              Sorry it was my Set line

                              Code:
                              Sub Main()
                              
                                Dim PcdmisApp As Object
                                Set PcdmisApp = CreateObject("PCDLRN.Application")
                                Dim PartProg As Object
                                Set PartProg = PcdmisApp.ActivePartProgram  'change the App.ActivePartProgram to PcdmisApp.ActivePartProgram
                                PartProg.Close
                                PcdmisApp.Quit
                                
                              End Sub
                              <internet bumper sticker goes here>

                              Comment

                              Related Topics

                              Collapse

                              Working...
                              X