MbusSerialServerBasestartupServer 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.Slave
Assembly:
FieldTalk.Modbus.Slave (in FieldTalk.Modbus.Slave.dll) Version: 2.11.0-eval+eb1ecbe71c969eff5d7c05d58da16dade0474678
Syntaxpublic int startupServer(
string portName,
int baudRate,
int dataBits,
int stopBits,
int parity
)
Public Function startupServer (
portName As String,
baudRate As Integer,
dataBits As Integer,
stopBits As Integer,
parity As Integer
) As Integer
public:
int startupServer(
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 |
|---|
| 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