hexagon logo

Launch PC-DMIS in Operator Mode through VB

I searched through the forum and couldn't find a solution for my issue.

I was wondering if it is possible to launch pc-dmis in operator mode from a script.

I made a front end GUI and wanted to be able to display pc dmis (in operator mode) while it's running a program. Right now I just hide everything besides the Execution window.

I'll attach the code I'm using to start pc dmis if it helps

TIA

Sub PCDMISProgramRun()


Dim PCDApp, PCDPartProgram, PCDProgramCommand


''

Set PCDApp = CreateObject("PCDLRN.Application") 'Opens PC-DMIS

    If Not PCDApp.WaitUntilReady(300) Then
        MsgBox "Machine did not initialize, Exiting"
        Exit Sub
    End If

    PCDApp.Visible = False
Parents


  • Yes that does work as well, I just tested it. The shell method takes a little less code to do so I'll use that in startup now

    The reason I use the CreateObject method is because of connecting to an already open PC-DMIS like stated.

    Thanks for your suggestions


    I think everyone is talking about GetObject() instead of CreateObject() if I'm not mistaken and yes you can also iterate thru the list of running processes and tag your Pcd Object to it... kinda what GetObject() is.

    PcDmis ONLY runs one pcdlrn instance so most of us do just fine with CreateObject() but if for example you're doing some work with Excel and while debugging you notice more than one instance of Excel process that's because Excel allows more than one process to be ran at a time (good spot to use GetObject() first else if not found use CreateObject() assuming no other Excel workbooks are to be open while your executable is running).

    Helpful link:
    https://docs.microsoft.com/en-us/off...bject-behavior
Reply


  • Yes that does work as well, I just tested it. The shell method takes a little less code to do so I'll use that in startup now

    The reason I use the CreateObject method is because of connecting to an already open PC-DMIS like stated.

    Thanks for your suggestions


    I think everyone is talking about GetObject() instead of CreateObject() if I'm not mistaken and yes you can also iterate thru the list of running processes and tag your Pcd Object to it... kinda what GetObject() is.

    PcDmis ONLY runs one pcdlrn instance so most of us do just fine with CreateObject() but if for example you're doing some work with Excel and while debugging you notice more than one instance of Excel process that's because Excel allows more than one process to be ran at a time (good spot to use GetObject() first else if not found use CreateObject() assuming no other Excel workbooks are to be open while your executable is running).

    Helpful link:
    https://docs.microsoft.com/en-us/off...bject-behavior
Children
No Data