hexagon logo

Automation Issue with .NET

When opening and executing PC-DMIS programs from a Windows VB.Net application, on SOME machines SOME of the time, the main PC-DMIS window will not display.
Only the PC-DMIS Execution Window is displayed - PC-DMIS User Prompts are essentially unavailable. In this case, closing PC-DMIS via task manager is the only solution.

My open and Execute construct are (essentially) the following:

PCDMISapplication = New PCDLRN.Application
PCDprograms = PCDMISapplication.PartPrograms
PCDMISapplication.Visible = True
PCDpartPrg = PCDMISprograms.Open(pathAndFilename, machineName)
Threading.Thread.Sleep(2000) ' Wait while program opens
PCDMISapplication.WaitUntilReady(200)
PCDpartPrg.Visible = True
PCDpartPrg.EXECUTE()


I suspect the solution is to add a variable the Thread.Sleep() and WaitUntilReady() methods and increase the times until this stops. But that doesn't explain the random nature.

Another Thought: Since I'm also handling some PartProgram Object events, I'm tempted to put the PCDpartPrg.Visible = True in a regularly fired event. But this seems like wikkid overkill. Again, I'd just like to understand the nature of this random problem.

Any thoughts?

Thanks,
Dan (in DFW - supposedly)
Parents
  • The problem is solved - or at least it's not recurring in the limited machines' testing I've done.

    The solution was related to one (or a combination of some) of three things below.

    1) Re-Install of most current version of PC-DMIS (64 bit) on my TestPC (that almost always runs PC-DMIS offline).
    2) Set the PC-DMISapplicationObject.OperatorMode=False before calling PC-DMISapplicationObject.Visible or PC-DMISapplicationObject.SetActive methods.
    3) Check PC-DMISapplicationObject.Visible with an event during PC-DMIS program Execution. Iff False, set Visible=True and call SetActive.

    Re: #3 above, limited testing/logging shows repeated True values for my event check of PC-DMISapplicationObject.Visible.

    BTW, anyone know significance of the Application.SetActive() return value (boolean)? If FALSE, does PC-DMIS fails to set the main window 'Active'? There's little info in the PCDMISbasic.chm file...


    Thanks Everyone for your suggestions.
Reply
  • The problem is solved - or at least it's not recurring in the limited machines' testing I've done.

    The solution was related to one (or a combination of some) of three things below.

    1) Re-Install of most current version of PC-DMIS (64 bit) on my TestPC (that almost always runs PC-DMIS offline).
    2) Set the PC-DMISapplicationObject.OperatorMode=False before calling PC-DMISapplicationObject.Visible or PC-DMISapplicationObject.SetActive methods.
    3) Check PC-DMISapplicationObject.Visible with an event during PC-DMIS program Execution. Iff False, set Visible=True and call SetActive.

    Re: #3 above, limited testing/logging shows repeated True values for my event check of PC-DMISapplicationObject.Visible.

    BTW, anyone know significance of the Application.SetActive() return value (boolean)? If FALSE, does PC-DMIS fails to set the main window 'Active'? There's little info in the PCDMISbasic.chm file...


    Thanks Everyone for your suggestions.
Children
No Data