2 % PROCESSERROR - Processes a MATLAB exception
 
    4 %   
retVal = processError(mException, 
sockfd, signal) processes
 
    7 %   Next, 
if the BCVTB library can be loaded
 
    9 %   this 
function sends 'signal' to the socket.
 
   11 %   If sending a message to the socket was 
successful, then
 
   14 %   This 
function will also load the library libbcvtb unless it is
 
   19 %  2011-10-20 MWetter@lbl.gov: First version.
 
   21 % Print error message to console
 
   22 fprintf(['*** Error: ', getReport(mException)]);
 
   23 fprintf([
'           ', 
'Trying to send client error from MATLAB to the BCVTB.']);
 
   25 % Load library 
if it is not already loaded
 
   31 if ~libisloaded(BCVTBLIB)    
 
   32   msg='Error. Failed to load BCVTB library.';
 
   33   ME = MException('BCVTB:ConnectError', ...
 
loadlibrary(LIBBCVTB,... 'matlabSocket.h',... 'includepath', './..',... 'mfilename', 'bcvtb.m')%-------------------------------------------------------------------%Check if Simulink is installed on this system.If Simulink is%is not installed
 
function sockfd will be a positive integer for the socket file descriptor In case of error
 
if ~libisloaded(BCVTBLIB) loadlibrary(BCVTBLIB
 
function if the BCVTB library can be loaded and if sockfd is not a negative then this function sends signal to the socket If sending a message to the socket was successful
 
fprintf([' ', 'Trying to send client error from MATLAB to the BCVTB.'])
 
end Establish the socket connection if and(libisloaded(BCVTBLIB),(status==1)) sockfd
 
static void XMLCALL end(void *data, const char *el)
Call back functions that will be used by the expat xml parser. 
 
if(strcmp(os,'windows'))%have Windows LIBBCVTB
 
Load library if it is not already loaded BCVTBLIB
 
function[retVal, flaRea, simTimRea, dblValRea]
 
function if the BCVTB library can be loaded and if sockfd is not a negative number