Results 1 to 9 of 9

Thread: To Open/Execute Several Programs Sequentially Using Basic Script

  1. #1
    Junior Member
    Join Date
    Nov 2011
    Location
    Penang
    Posts
    20

    Default 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. #2
    PC-DMIS Guru
    • Additional Information
      • Years CMM Experience:
      • Since 1994
      • Software Version:
      • PC-DMIS CAD++ 2013 MR1 SP2
      • Machine Type:
      • CEJ12C, CEJ12000
      • Location:
      • Sweden
      • Job Function:
      • Quality tech., CMM programmer/operator
    vpt.se's Avatar
    Join Date
    Feb 2007
    Location
    Sweden
    Posts
    4,770

    Default

    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 at 05:05 AM.
    PC-DMIS CAD++ 2o14 SP1

  3. #3
    Junior Member
    Join Date
    Nov 2011
    Location
    Penang
    Posts
    20

    Default

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

  4. #4
    PC-DMIS Guru
    • Additional Information
      • Years CMM Experience:
      • Since 1994
      • Software Version:
      • PC-DMIS CAD++ 2013 MR1 SP2
      • Machine Type:
      • CEJ12C, CEJ12000
      • Location:
      • Sweden
      • Job Function:
      • Quality tech., CMM programmer/operator
    vpt.se's Avatar
    Join Date
    Feb 2007
    Location
    Sweden
    Posts
    4,770

    Default

    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++ 2o14 SP1

  5. #5
    Ultra Senior Member
    Join Date
    Aug 2011
    Location
    N.E. United States
    Posts
    813

    Default

    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 SP5
    Global Frames, Tesastar-M Heads, LSP-X1M/H Probes

  6. #6
    Junior Member

    Join Date
    Jun 2013
    Posts
    4

    Default

    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 :-)

  7. #7
    PC-DMIS Guru
    • Additional Information
      • Years CMM Experience:
      • Since 1994
      • Software Version:
      • PC-DMIS CAD++ 2013 MR1 SP2
      • Machine Type:
      • CEJ12C, CEJ12000
      • Location:
      • Sweden
      • Job Function:
      • Quality tech., CMM programmer/operator
    vpt.se's Avatar
    Join Date
    Feb 2007
    Location
    Sweden
    Posts
    4,770

    Default

    Got any info regarding the functions of H_PCDMIS.DLL?

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

  8. #8
    Junior Member

    Join Date
    Jun 2013
    Posts
    4

    Default

    Quote 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 ;-)

  9. #9
    PC-DMIS Guru
    • Additional Information
      • Years CMM Experience:
      • Since 1994
      • Software Version:
      • PC-DMIS CAD++ 2013 MR1 SP2
      • Machine Type:
      • CEJ12C, CEJ12000
      • Location:
      • Sweden
      • Job Function:
      • Quality tech., CMM programmer/operator
    vpt.se's Avatar
    Join Date
    Feb 2007
    Location
    Sweden
    Posts
    4,770

    Default

    Quote 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++ 2o14 SP1

Similar Threads

  1. Script to check for open workbook
    By cduve in forum PC-DMIS for CMMs
    Replies: 3
    Last Post: 01-05-2012, 01:40 AM
  2. basic script
    By here we go again in forum DataSuite SPC
    Replies: 5
    Last Post: 09-24-2008, 09:44 AM
  3. Basic Script
    By mdcon in forum PC-DMIS for CMMs
    Replies: 21
    Last Post: 01-31-2008, 05:06 PM
  4. Basic script
    By Virgil UK in forum PC-DMIS for CMMs
    Replies: 2
    Last Post: 03-07-2007, 06:54 AM
  5. Basic Script
    By KasonQC in forum PC-DMIS for CMMs
    Replies: 13
    Last Post: 08-17-2006, 11:09 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •