FieldTalk™ Modbus Master .NET Library

MbusAsciiMasterProtocol Constructor (String, Int32, Int32, Int32, Int32)

Creates new instance and configures port settings

[Visual Basic]
Overloads Public Sub New( _
   ByVal portName As String, _
   ByVal baudRate As Integer, _
   ByVal dataBits As Integer, _
   ByVal stopBits As Integer, _
   ByVal parity As Integer _
)
[C#]
public MbusAsciiMasterProtocol(
   string portName,
   int baudRate,
   int dataBits,
   int stopBits,
   int parity
);

Parameters

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

Exceptions

Exception Type Condition
OutOfMemoryException OutOfMemoryException Creation of class failed

See Also

MbusAsciiMasterProtocol Class | FieldTalk Namespace | MbusAsciiMasterProtocol Constructor Overload List