Automated execution of several consecutive programs

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

  • Automated execution of several consecutive programs

    Hi guys.
    I would like to know how i can automate the execution of several consecutive programs and which software i can do it easily.
    Maybe somebody can share some code of vba or c+.
    the goal is to run a program and after completion execute the next until finish all programs that i need. I will use an external alignment in every program in order to mesure all parts that i have fixed on the cmm table.
    Thank you

    Enviado desde mi SM-G928F mediante Tapatalk

  • #2
    There's a tool / utility in the Wizards folder (pc-dmis install direcory > Wizards) called MultiExecute which does what you want I think.
    Automettech - Automated Metrology Technology

    Comment


    • #3
      Ok i will try it. Thank you very much

      Enviado desde mi SM-G928F mediante Tapatalk

      Comment


      • #4
        Basic Script

        This might help.
        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
        
        Last edited by dph51; 05-16-2016, 09:09 AM.

        B&S CHAMELEON/PCDMIS CAD++ V2011

        There are no bugs, only "UNDOCUMENTED ENHANCEMENTS!"

        sigpic

        Comment


        • #5
          Thank you i will try it

          Enviado desde mi SM-G928F mediante Tapatalk

          Comment


          • #6
            Hexagon are also making INSPECT available for free with PC-Dmis 2017. Inspect is the replacement for the old STI (Single Touch Interface) and it allows you to create a queue of programs to run one after another. You get an option (tick box) to install INSPECT when installing PC-Dmis 2017.

            Comment


            • #7
              Thank you for your information about it. But i will be waiting two years to get this version.
              currently i use the 2015 and the next year i going to use the 2016 version. This is the recommendation from my local hexagon support maybe they are wrong. Because there ara a lot of people who already use 2016...

              Comment


              • #8
                Originally posted by dph51 View Post
                Basic Script

                This might help.
                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
                
                hi dph51

                I have stolen your code and all works fine apart from when I try and execute the code without pcdmis being open, it starts in offline mode. When I start it with Pcdmis open all works fine. Do you know the reasoning behind this? Do I have to start pcdmis before executing the code.

                I am using a button in an excel sheet to execute the code by the way.

                Also very new to trying this kind of stuff so there may be a reason why it is doing it, running 2012MR1

                Comment


                • #9
                  Maybe check if your machine is named "CMM1" and not anything else (I think the names differs between languages).
                  PC-DMIS CAD++ 2o19 R1 SP11

                  Comment


                  • #10
                    Originally posted by vpt.se View Post
                    Maybe check if your machine is named "CMM1" and not anything else (I think the names differs between languages).
                    How do I find the machine name, I cannot seem to locate it anywhere.

                    Comment


                    • #11
                      Try

                      In your basic script

                      Code:
                      Dim CMM_Name,Msg
                      
                      CMM_Name = PCDDmisPart.ActiveMachine
                      
                      If CMM_Name = "CMM1" Then
                      
                      Set PCDDmisCommand = PCDDmisCommands.Add(ASSIGNMENT,True)
                      
                      PCDDmisCommand.Marked = True
                      
                      retval = PCDDmisCommand.PutText("CMM_NAME",DEST _EXPR,0)
                      
                      retval = PCDDmisCommand.PutText("STR(""CMM1"")",SRC_EXPR,0)
                      
                      End If
                      This should create an assignment into the program with the cmm name. (Assuming the cmm name is CMM1)
                      Last edited by dph51; 04-19-2017, 08:06 AM.

                      B&S CHAMELEON/PCDMIS CAD++ V2011

                      There are no bugs, only "UNDOCUMENTED ENHANCEMENTS!"

                      sigpic

                      Comment


                      • bigtallanddopey
                        bigtallanddopey commented
                        Editing a comment
                        doing this throws up an error, Error executing basic script.

                        I am guessing this means that my CMM isn't called CMM1

                    • #12
                      What i wrote is not the entire script.

                      You would add this into an existing script.

                      B&S CHAMELEON/PCDMIS CAD++ V2011

                      There are no bugs, only "UNDOCUMENTED ENHANCEMENTS!"

                      sigpic

                      Comment


                      • bigtallanddopey
                        bigtallanddopey commented
                        Editing a comment
                        I realized that after I wrote the comment above, tried to get it to work myself and failed. I must have missed something out, ill check your code below.

                    • #13
                      Try this stand alone script.

                      This should bring up a message window with the CMM name


                      Code:
                      Dim PCDDmisApp As Object
                      Dim PCDDmisPart As Object
                      Dim PCDDmisCommands As Object
                      Dim PCDDmisCommand As Object
                      
                      Sub Main
                      Set PCDDmisApp = CreateObject("PCDLRN.Application")
                      Set PCDDmisPart = PCDDmisApp.ActivePartProgram
                      Set PCDDmisCommands = PCDmisPart.Commands
                      
                      CMM_Name = PCDDmisPart.ActiveMachine
                      
                      Dim CMM_Name,Msg
                      Msg = CMM_Name
                      MsgBox Msg
                      
                      PCDDmisPart.RefreshPart
                      
                      End Sub
                      Last edited by dph51; 04-19-2017, 10:41 AM.

                      B&S CHAMELEON/PCDMIS CAD++ V2011

                      There are no bugs, only "UNDOCUMENTED ENHANCEMENTS!"

                      sigpic

                      Comment


                      • bigtallanddopey
                        bigtallanddopey commented
                        Editing a comment
                        Just missed this part out if anyone else comes across this script.

                        CMM_Name = PCDPart.ActiveMachine

                    • #14
                      OK, so after all that, the name of the CMM is, CMM1

                      Comment


                      • #15
                        The CMM name is also displayed in the "Open" dialog if I'm not mistaken.
                        PC-DMIS CAD++ 2o19 R1 SP11

                        Comment

                        Related Topics

                        Collapse

                        Working...
                        X