Open TCP/IP connection to Simulink Real-Time system


int xPCOpenTcpIpPort(const char *ipAddress, const char 


Do not use this C API type definition. Support for this type definition relies on support for the C API, which will be removed in a future release.



Enter the IP address of the target as a dotted decimal character string. For example, "".


Enter the associated IP port as a character string. For example, "22222".


Returns a nonnegative integer that you can then use as the port value for a Simulink® Real-Time™ API function that requires it. If this operation fails, this function returns -1.


The xPCOpenTcpIpPort function opens a connection to the TCP/IP location specified by the IP address. If xPCOpenTcpIpPort succeeds, it returns a nonnegative integer. Use this integer as the ipPort variable in the Simulink Real-Time API functions that require a port value. The global error number is also set, which you can get using xPCGetLastError.

Introduced before R2006a