Delta Tau Forums
Pcommserver COMexception was unhandled - Printable Version

+- Delta Tau Forums (http://forums.deltatau.com)
+-- Forum: Delta Tau Data Systems (http://forums.deltatau.com/forumdisplay.php?fid=1)
+--- Forum: Turbo PMAC (http://forums.deltatau.com/forumdisplay.php?fid=6)
+--- Thread: Pcommserver COMexception was unhandled (/showthread.php?tid=1989)



Pcommserver COMexception was unhandled - aims - 07-28-2015

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.


RE: Pcommserver COMexception was unhandled - steve.milici - 07-28-2015

What OS and what is the version of Pcommserver?


RE: Pcommserver COMexception was unhandled - aims - 07-28-2015

(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.


RE: Pcommserver COMexception was unhandled - steve.milici - 07-29-2015

Close the PMAC device and kill the server - then restart.


RE: Pcommserver COMexception was unhandled - aims - 07-29-2015

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?


RE: Pcommserver COMexception was unhandled - aims - 07-29-2015

I think it the problem is on my application code.


RE: Pcommserver COMexception was unhandled - steve.milici - 07-30-2015

Restart the server and then re open your PMAC device.


RE: Pcommserver COMexception was unhandled - Unit101 - 08-11-2015

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.