v0.2.0
modbus
適用於 Dart 的簡單 Modbus 客戶端程式庫。目前僅支援 TCP 連接。
36喜歡 878近 30 天下載140Pub 分數
AndroidiOSmacOSWindowsLinux
hacker-cb/modbus-dart open-source repository details.
以下為英文專案原文快照,最新內容請造訪 GitHub。
Simple Modbus client library for dart. Currently only the TCP connection is supported.
import 'package:modbus/modbus.dart' as modbus;
main(List<String> arguments) async {
var client = modbus.createTcpClient(
'10.170.1.20',
port: 1001,
mode: modbus.ModbusMode.rtu,
);
try {
await client.connect();
var slaveIdResponse = await client.reportSlaveId();
print("Slave ID: " + slaveIdResponse);
} finally {
client.close();
}
}
import 'package:modbus/modbus.dart' as modbus;
main(List<String> arguments) async {
var client = modbus.createTcpClient(
'10.170.1.20',
port: 1001,
mode: modbus.ModbusMode.rtu,
);
try {
await client.connect();
client.setUnitId(100);
var slaveIdResponse = await client.reportSlaveId();
print("Slave ID: " + slaveIdResponse);
client.setUnitId(150);
var slaveIdResponse = await client.reportSlaveId();
print("Slave ID: " + slaveIdResponse);
} finally {
client.close();
}
}
SerialConnector is not implemented yet.
先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗