FieldTalk™ Modbus Master .NET Library

MbusTcpMasterProtocol.openProtocol Method (String, Int16)

Connects to a TCP slave.

[Visual Basic]
Overloads Public Function openProtocol( _
   ByVal hostName As String, _
   ByVal portNo As Short _
) As Integer
[C#]
public int openProtocol(
   string hostName,
   short portNo
);

Parameters

hostName
String with IP address or host name (eg "127.0.0.1")
portNo
Port number to be used when opening the connection

Return Value

BusProtocolErrors.FTALK_SUCCESS on success or error code. See BusProtocolErrors for possible error codes.

Remarks

This function establishes a logical network connection between master and slave. After a connection has been established data and control functions can be used. A TCP/IP connection should be closed if it is no longer needed.

See Also

MbusTcpMasterProtocol Class | FieldTalk Namespace | MbusTcpMasterProtocol.openProtocol Overload List