Skip to Main Content Skip to Search
Product Documentation

xPCOpenTcpIpPort - Open TCP/IP connection to xPC Target system

Prototype

int xPCOpenTcpIpPort(const char *ipAddress, const char 
*ipPort);

Arguments

ipAddress

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

ipPort

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

Return

The xPCOpenTcpIpPort function returns a nonnegative integer that you can then use as the port value for any xPC Target API function that requires it. If this operation fails, this function returns -1.

Description

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

See Also

API functions xPCOpenSerialPort, xPCClosePort, xPCReOpenPort, xPCTargetPing

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS