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

window XP and Pcommserver 4.3.3.0.
Reply
#4
Close the PMAC device and kill the server - then restart.
Reply
#5
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?
Reply
#6
I think it the problem is on my application code.
Reply
#7
Restart the server and then re open your PMAC device.
Reply
#8
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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)