Documentation

xPCGetAppName

Return real-time application name

Prototype

char *xPCGetAppName(int port, char *model_name);

Arguments

port

Enter the value returned by the function xPCOpenTcpIpPort.

model_name

The xPCGetAppName function copies the real-time application name character string into the buffer pointed to by model_name. model_name is then returned. You can later use model_name in a function such as printf.

The maximum size of the buffer is 256 bytes. To reserve enough space for the name character string, allocate a buffer of size 256 bytes.

Return

Returns a character string with the name of the real-time application.

Description

The xPCGetAppName function returns the name of the real-time application. You can use the return value, model_name, in a printf or similar statement. If an error occurs, the name character string is unchanged.

Examples

Allocate 256 bytes for the buffer appname.

char *appname=malloc(256);
xPCGetAppName(iport,appname);
appname=realloc(appname,strlen(appname)+1);
...
free(appname);

Introduced before R2006a

Was this topic helpful?