kl-mc
v1.0.0
Published
考拉悠然mc通信库
Downloads
6
Readme
考拉悠然三菱mc通信
一、API
- 创建及初始化连接
const klMcClientProxy = new KlMcClientProxy();
await klMcClientProxy.initClient("127.0.0.1", 6000);- 关闭连接
klMcClientProxy.close();- 发送/读取字符串
const str = "klMcClientProxy";
await klMcClientProxy.writeString("D0", str);
const res1 = await klMcClientProxy.readString("D0", str.length);- 发送数组/读取数组
const arr = [111, 222, 333, 444, 555, 666, 777];
await klMcClientProxy.writeArr("D0", arr);
const res2 = await klMcClientProxy.readArr("D0", 7);- 发送/读取单个数值
await klMcClientProxy.writeNum("D0", 888);
const res3 = await klMcClientProxy.readNum("D0");二、安装
npm install kl-mc