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 ↗