FieldTalk™ Modbus Master .NET Library

MbusSerialMasterProtocol.openProtocol Method (String, Int32)

Opens a serial Modbus protocol and the associated serial port with the port parameters configured via properties

[Visual Basic]
Overloads Public Function openProtocol( _
   ByVal portName As String, _
   ByVal baudRate As Integer _
) As Integer
[C#]
public int openProtocol(
   string portName,
   int baudRate
);

Parameters

portName
Serial port identifier (eg "COM1")
baudRate
The port baud rate in bps (1200 - 115200, higher on some platforms)

Return Value

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

Remarks

This function opens the serial port with a specific baudrate. After a port has been opened, data and control functions can be used.

See Also

MbusSerialMasterProtocol Class | FieldTalk Namespace | MbusSerialMasterProtocol.openProtocol Overload List