Jump to content
OMRON Forums

Pcommserver COMexception was unhandled


aims
 Share

Recommended Posts

I using VSE C# to develop a winform application. What i want to do is stop the application to read the motor status, speed and position when communication is lost.

I simulate it by unplug the com cable. The error is "The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))". How do I clear the COM object.

 

Please advice what is the right method to detect the com lost and stop my application.

Link to comment
Share on other sites

  • Replies 7
  • Created
  • Last Reply

Top Posters In This Topic

May I know what you mean by saying "restart"??? restart to Pcommserver.exe process or restart the PC???

 

After the exception error happen, my application become lag and slow. I cant get the motor status but the method getresponcex() is still working but it slow to response a bit.

 

For this moment, what i notice is when I am using the PEWIN32 PRO to communicate with PMAC turbo and after that, I am run my C# application again, everthings work smoothly.

 

Any idea?

Link to comment
Share on other sites

  • 2 weeks later...

To reset your comms with the PMAC I do this:

 

HERE call pcomm function to close the connection

public static void CloseDevice()

{

try

{

if (DeviceNum > -1) Pmac.Close(DeviceNum);

Online = false;

 

}

catch

{

Online = false;

}

}

 

 

Here go to windows and kill the pcommserver process

 

string processName = "PcommServer";

foreach (Process proc in Process.GetProcessesByName(processName))

{

proc.Kill();

}

 

Let me know if you need more help with this... I have written a lot of code that will detect when the PMAC connection is lost and make attempts to restore.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share


×
×
  • Create New...