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
  • 2) Looks like background worker is the way to go. Thanks!


    I would still recommend .AsyncExecute. It's already there, built into PC-DMIS.

    AndersI, any chance of posting some of the 'watchdog timer' code?


    It's just a timer set to X seconds, activated on part program start, and reset each time any PC-DMIS event arrives. If PC-DMIS stays silent (event-wise) for more than X seconds, the timer event will be triggered, and the red flash is turned on (via RS232 communication to a PLC). End of PP execution deactivates the timer.
Reply
  • 2) Looks like background worker is the way to go. Thanks!


    I would still recommend .AsyncExecute. It's already there, built into PC-DMIS.

    AndersI, any chance of posting some of the 'watchdog timer' code?


    It's just a timer set to X seconds, activated on part program start, and reset each time any PC-DMIS event arrives. If PC-DMIS stays silent (event-wise) for more than X seconds, the timer event will be triggered, and the red flash is turned on (via RS232 communication to a PLC). End of PP execution deactivates the timer.
Children
No Data