push_message_handler()

Installs a message handler function to receive messages from a server. When a message is received from the server, the handler function is called and passed the server handle, type code for the message, and the message text. The message type codes are:

0 = command
1 = data
2 = begin data block
3 = continue data block
4 = end data block
5 = done (server acknowledge of command)
6 = error
7 = server died

For non-EEsof server programs, only data messages may be exchanged. Returns: none.

See also: pop_message_handler(), create_server().

Syntax:

push_message_handler( messageFn, server_handle);

where

messageFn is the name of an AEL function to receive messages from server.

server_handle is a handle of simulator/server returned by create_server().

Example:
decl my_server=create_server("myserver", "MyServerProcess", "");
defun print_message( sh, type, msg )
{
 if (type == 0)
  fputs( stderr, strcat( "Command:",msg ));
 if (type == 1)
  fputs( stderr, strcat( "Data:",msg ));
 if (type == 2)
  fputs( stderr, strcat( "Start data:",msg ));
 if (type == 3)
  fputs( stderr, strcat( "Cont data:",msg ));
 if (type == 4)
  fputs( stderr, strcat( "End data:",msg ));
 if (type == 5)
  fputs( stderr, strcat( "Done:",msg ));
 if (type == 6)
  fputs( stderr, strcat( "Error:",msg ));
 if (type == 7)
  fputs( stderr, strcat( "Server died:",msg ));
}
push_message_handler( print_message, my_server );
Where Used:

Measurement Expressions (Data Display equations and Schematic MeasEqns), Schematic, Layout, Simulation, GUI

 

Privacy Statement  | Terms of Use  | Legal | Contact Us  | © Agilent 2000-2008 

Contents
Additional Resources