hexagon logo

visual studio

I am struggling with two problems. Hopefully someone can help.
The following code will open pcdmis 2014.1, 32 bit, execute a program and close pcdmis.

1) How can I make pcdmis visible? Seems like "PCDApp.visible = True" doesn't do anything.
2) How can I make the application moveable when pcdmis is running? The application can be moved around the screen before and after pcdmis runs, but not during.

Dim PCDApp, PCDPartPrograms, PCDPartProgram
        PCDApp = CreateObject("PCDLRN.Application")
        PCDApp.visible = True
        PCDPartPrograms = PCDApp.PartPrograms
        PCDPartPrograms.Open("c:\test.PRG", "CMM1")
        PCDPartProgram = PCDApp.ActivePartProgram
        PCDPartProgram.Execute()
        PCDPartProgram.Close()
        PCDApp.Quit()
Parents
  • 1. Maybe you have to do a .Restore or .Maximize on the PC-DMIS Window? Just guessing, I've never seen that problem.

    2. Use .AsyncExecute instead of .Execute. To know when the part program has ended execution, you have to catch the .PCD_ApplicationEventsEndExecution and/or .PCD_PartProgEventsEndExecution or whatever those events are actually called in your development environment.

    I use (2) in a cell system, where my control program also lights up a red/yellow/green flasher, depending on the result of the part program run. There's also a 'watchdog timer' getting reset on every PC-DMIS event, so the red flash can be turned on if PC-DMIS stops generating events (usually means that PC-DMIS has crashed...).
Reply
  • 1. Maybe you have to do a .Restore or .Maximize on the PC-DMIS Window? Just guessing, I've never seen that problem.

    2. Use .AsyncExecute instead of .Execute. To know when the part program has ended execution, you have to catch the .PCD_ApplicationEventsEndExecution and/or .PCD_PartProgEventsEndExecution or whatever those events are actually called in your development environment.

    I use (2) in a cell system, where my control program also lights up a red/yellow/green flasher, depending on the result of the part program run. There's also a 'watchdog timer' getting reset on every PC-DMIS event, so the red flash can be turned on if PC-DMIS stops generating events (usually means that PC-DMIS has crashed...).
Children
No Data