Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pcommserver COMexception was unhandled
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.
What OS and what is the version of Pcommserver?
(07-28-2015, 08:41 AM)steve.milici Wrote: What OS and what is the version of Pcommserver?

window XP and Pcommserver
Close the PMAC device and kill the server - then restart.
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?
I think it the problem is on my application code.
Restart the server and then re open your PMAC device.
To reset your comms with the PMAC I do this:

HERE call pcomm function to close the connection
public static void CloseDevice()
if (DeviceNum > -1) Pmac.Close(DeviceNum);
Online = false;

Online = false;

Here go to windows and kill the pcommserver process

string processName = "PcommServer";
foreach (Process proc in Process.GetProcessesByName(processName))

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.

Forum Jump:

Users browsing this thread: 1 Guest(s)