hexagon logo

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?
  • 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.
  • 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....
  • 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.

    Dim PCDApp, PCDPartPrograms, PCDPartProgram
    
    Set PCDApp = CreateObject("PCDLRN.Application")
    Set PCDPartPrograms = PCDApp.PartPrograms
    
      PCDApp.Visible = True
      PCDPartPrograms.Open "[COLOR="red"]Z:\test1.PRG[/COLOR]", "[COLOR="red"]CMM1[/COLOR]"
    
    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 "[COLOR="red"]Z:\test2.PRG[/COLOR]", "[COLOR="red"]CMM1[/COLOR]"
    
    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.
  • 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.
  • try this C# Project (Visual Studio 2012):

    RunSequentiallyPartProgram

    You can find the exe file in "..\RunSequentiallyPartProgram\bin\Debug\RunSequentiallyPartProgram.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 :-)
  • Got any info regarding the functions of H_PCDMIS.DLL?

    You have pcd.Connect, but are there more functions?
  • 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 ;-)
  • 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...
  • I wanted a code to open a program and wanted to uncheck the manual part of the program.
    I already tried with this code but the error.
    Someone can help me?
    “ Dim PCDApp, PCDPartPrograms, PCDPartProgram, PCDCommands, PCDCommand


    Set PCDApp = CreateObject("PCDLRN.Application")
    Set PCDPartPrograms = PCDApp.PartPrograms
    Set PCDPartProgram = PCDApp.ActivePartProgram

    Set PCDCommands = PCDPartProgram.Commands

      PCDApp.Visible = True
      PCDPartPrograms.Open "Z:\MM.PRG", "CMM1"
      
    '************************************************* *************
    Dim WshShell
    set WshShell = WScript.CreateObject("WScript.Shell")



    '************************************************* *************
    Set PCDPartProgram = PCDApp.ActivePartProgram

    PCDCommands.Mark.true
     MsgBox "mark"”
  • I would like to know how can I mark and unmark the program through a script?