RobotStudio event

Send Fatal Error

Hello,

I am doing some communication with LabVIEW as the server, and RobotStudio as the client. I am communicating via Sockets. What I am trying to do, is to have RAPID send LV the error number when it encounters a fatal error. Is this possible? Because when RS encounters a fatal error, it stops the program, thus no longer connected to LV. Is there a way to have RAPID send the error number to LV right before the program stops and communication is lost?

Or alternatively, is there a way that RS can send LV its last known error on startup after a fatal error has occurred?

Thanks for any help,
SM