This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Specify local host port for connection


You configure LocalPort to be the port value of the local host. The default value is [].

If LocalPortMode is set to auto or if LocalPort is [], the property is assigned any free port when you connect the object to the hardware with the fopen function. If LocalPortMode is set to manual, the specified LocalPort value is used when you issue fopen. If you explicitly configure LocalPort, LocalPortMode is automatically set to manual.

You can configure LocalPort only when the object is disconnected from the hardware. You disconnect a connected object with the fclose function. A disconnected object has a Status property value of closed.




Read only

While open

Data type



The default value is [].

See Also


fclose, fopen, tcpip, udp