ModbusClientTcp class
The Modbus TCP client class.
Constructors
- ModbusClientTcp(String serverAddress, {int serverPort = 502, ModbusConnectionMode connectionMode = ModbusConnectionMode.autoConnectAndKeepConnected, Duration connectionTimeout = const Duration(seconds: 3), Duration responseTimeout = const Duration(seconds: 3), Duration? delayAfterConnect, int? unitId})
Properties
- connectionMode → ModbusConnectionMode
-
finalinherited
- connectionTimeout → Duration
-
final
- delayAfterConnect → Duration?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isConnected → bool
-
Returns true if connection to client is established.
no setter
- responseTimeout → Duration
-
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- serverAddress → String
-
final
- serverPort → int
-
final
- unitId → int?
-
finalinherited
Methods
-
connect(
) → Future< bool> - Connect the socket if not already done or disconnected
-
disconnect(
) → Future< void> - Handle socket being closed
-
getResponseTimeout(
ModbusRequest request) → Duration -
If
request
has its ownresponseTimeout
defined, then it will override this clientresponseTimeout
.inherited -
getUnitId(
ModbusRequest request) → int -
If
request
has its ownunitId
defined, then it will override this clientunitId
. If bothunitId
are not defined the a 0 is returned.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
send(
ModbusRequest request) → Future< ModbusResponseCode> -
Sends the modbus requests. A
ModbusResponseCode
is returned as a future. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited