To Open/Execute Several Programs Sequentially Using Basic Script

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

  • To Open/Execute Several Programs Sequentially Using Basic Script

    All the while I've been using CallSubs to do that from within the main program, but i've met several bugs and errors from the subroutines i've executed. Can anybody show me a simple basic script to open, execute, save, close several programs simultaneously?

  • #2
    I don't think you can do it simultaneously.

    You can do it sequentially (open, execute, close, open, execute, close or open, open, open, execute 1, wait, execute 2, wait, execute 3, wait...).
    There might be a script for something like that already available in here.
    Last edited by vpt.se; 04-05-2013, 05:05 AM.
    PC-DMIS CAD++ 2o16.0

    Comment


    • #3
      my bad, yes i do mean sequentially, not simultaneously because only 1 program can run online at a time.... i've seen searching for the whole afternoon, i can't find traces of such script....

      Comment


      • #4
        Found this in my repository...

        This code has not been extensively tested and I cannot be held responsible to any damages done by running the code. You run this on your own risk.

        For starters, create a program that simply does nothing more than displays an operator comment with some text, just to see how/that it works. If you choose to include this in an production environment - then that is totally up to you. As always, tweak the code to your own liking.

        It's more like a proof of concept than a complete solution - the customized solution is left for you to create.

        Code:
        Dim PCDApp, PCDPartPrograms, PCDPartProgram
        
        Set PCDApp = CreateObject("PCDLRN.Application")
        Set PCDPartPrograms = PCDApp.PartPrograms
        
          PCDApp.Visible = True
          PCDPartPrograms.Open "Z:\test1.PRG", "CMM1"
        
        Set PCDPartProgram = PCDApp.ActivePartProgram
          
          'msgbox "This will start the execution of the partprogram!"
          PCDPartProgram.Execute
        
          ' PC-DMIS executes the partprogram
        
          PCDPartProgram.Close
        
          ' PC-DMIS closes and saves the partprogram
        
        PCDPartPrograms.Open "Z:\test2.PRG", "CMM1"
        
        Set PCDPartProgram = PCDApp.ActivePartProgram
          
          'msgbox "This will start the execution of the partprogram!"
          PCDPartProgram.Execute
        
          ' PC-DMIS executes the partprogram
        
          PCDPartProgram.Close
        
          ' PC-DMIS closes and saves the partprogram
        
        ' Cleanup
        Set PCDPartProgram = nothing
        Set PCDPartPrograms = nothing
        Set PCDApp = nothing
        Save this as 'starter.vbs'. Then edit the path to the partprogram to reflect the partprogram you wish to run. Change the CMM1 to whatever machine interface you want to use and save it.

        Make sure PC-DMIS is running and then doubleclick the starter.vbs to start, execute and save/close the partprogram.
        This should (in theory) open "test1.prg", execute it, close and save and then open "test2.prg", execute it, close and save.
        PC-DMIS CAD++ 2o16.0

        Comment


        • #5
          If you have some money in the budget you could talk to your salesperson about purchasing Bladerunner. It is intended to be used to execute al of the many files required for Blade to operate correctly but can be used as a general Pc-DMIS program execution interface. You simply create a text file for each part number. The file contains operation names and then all of the programs that you want to execute in sequence when each operation is called. When you open the interface you choose the part number from a drop down, the operation from a drop down, and then it automatically executes all of the programs in sequence. Works great.
          2013MR1 SP6
          Global Frames, Tesastar-M Heads, LSP-X1M/H Probes

          Comment


          • #6
            try this C# Project (Visual Studio 2012):

            RunSequentiallyPartProgram

            You can find the exe file in "..\RunSequentiallyPartProgram\bin\Debug\RunSequen tiallyPartProgram.exe"

            You need Microsoft Framework 4.0.

            I tested it with "Pcdmis 2011 Mr1" & "2012 Mr1" ,
            i hope it will work with other version (also you can debug it ;-)

            Enjoy it :-)

            Comment


            • #7
              Got any info regarding the functions of H_PCDMIS.DLL?

              You have pcd.Connect, but are there more functions?
              PC-DMIS CAD++ 2o16.0

              Comment


              • #8
                Originally posted by vpt.se View Post
                Got any info regarding the functions of H_PCDMIS.DLL?

                You have pcd.Connect, but are there more functions?
                It's a class Library project, to do pcdmis automation work with many version of pcdmis, without "PCDLRN reference DLL" in your .NET project.

                if you would like you can download it HERE.



                this is just a beginning of the project ;-)

                Comment


                • #9
                  Originally posted by CharlyBoy View Post
                  It's a class Library project, to do pcdmis automation work with many version of pcdmis, without "PCDLRN reference DLL" in your .NET project.

                  if you would like you can download it HERE.



                  this is just a beginning of the project ;-)
                  Many thanks!

                  Have been looking for a DLL to use for this kind of stuff, was hoping that Hexagon/Wilcox could provide one for users to enhance PC-DMIS with external apps...
                  PC-DMIS CAD++ 2o16.0

                  Comment

                  Working...
                  X