• Libraries
  • Shop
  • Doc
  • Free Modbus
  • Support
  • Login
FieldTalk Modbus Master Library for .NET
FieldTalk Modbus Master Library for .NET
Namespaces
FieldTalk.Modbus.Master
MbusSerialClientBase Class
MbusSerialClientBase Methods
openProtocol Method
openProtocol Method
openProtocol Method (String, Int32, Int32, Int32, Int32)
Click or drag to resizeClick or drag to resize

MbusSerialClientBaseopenProtocol Method (String, Int32, Int32, Int32, Int32)

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

Namespace:  FieldTalk.Modbus.Master
Assembly:  FieldTalk.Modbus.Master (in FieldTalk.Modbus.Master.dll) Version: 2.15.2-eval+3d8362b4bb861c05760d48b11d303e954bb8597c
Syntax
C#
VB
C++
Copy
public int openProtocol(
	string portName,
	int baudRate,
	int dataBits,
	int stopBits,
	int parity
)
Public Function openProtocol ( 
	portName As String,
	baudRate As Integer,
	dataBits As Integer,
	stopBits As Integer,
	parity As Integer
) As Integer
public:
int openProtocol(
	String^ portName, 
	int baudRate, 
	int dataBits, 
	int stopBits, 
	int parity
)

Parameters

portName
Type: SystemString
Serial port identifier (eg "COM1")
baudRate
Type: SystemInt32
The port baud rate in bps (1200 - 115200, higher on some platforms)
dataBits
Type: SystemInt32
SER_DATABITS_7: 7 data bits (ASCII protocol only), SER_DATABITS_8: 8 data bits
stopBits
Type: SystemInt32
SER_STOPBITS_1: 1 stop bit, SER_STOPBITS_2: 2 stop bits
parity
Type: SystemInt32
SER_PARITY_NONE: no parity, SER_PARITY_ODD: odd parity, SER_PARITY_EVEN: even parity

Return Value

Type: Int32
BusProtocolErrors.FTALK_SUCCESS on success or error code. See BusProtocolErrors for possible error codes.
Remarks
This function opens the serial port with a specific port settings. After a port has been opened, data and control functions can be used.
Note Note
The Modbus standard requires two stop bits if no parity is chosen. This library is not enforcing this but it is a recommended configuration.
See Also

Reference

MbusSerialClientBase Class
openProtocol Overload
FieldTalk.Modbus.Master Namespace
FieldTalk Modbus Master Library for .NET
Library version 2.15.2
Speak to the Experts
Modbus Organization Member logo

We are member of the Modbus Organization, Inc.

Buy with Confidence
30-day money back guarantee All our FieldTalk web sales are backed by a 30-day Money Back Guarantee.
We Accept
Bank VISA MasterCard PayPal
Customer Info
  • Info & Contact
  • Customer Login
  • Terms of Service
  • Terms of Sale
  • Privacy Policy
© 2005-2025 proconX Pty Ltd. All rights reserved. proconX and FieldTalk are trademarks of proconX Pty Ltd.
All other trademarks and registered trademarks appearing on www.modbusdriver.com are the property of their respective owners.