开源改变世界

挂件 API 命令 – 示例开始/停止/暂停 #490

推推 grbl 3年前 (2023-02-03) 170次浏览
关闭
12 个任务中的第 4 个
bradanlane 打开了这个问题 2019 年 6 月 3 日 · 2 条评论
关闭
12 个任务中的第 4 个

挂件 API 命令 – 示例开始/停止/暂停#490

bradanlane 打开了这个问题 2019 年 6 月 3 日 · 2 条评论

注释

挂件 API 命令 - 示例开始/停止/暂停 #490
布拉丹巷 评论了 2019 年 6 月 3 日  

描述

我有一个 NECS 控制器连接到运行 CNCjs 的 Raspberry Pi。我用它来回家/慢跑/设置 W0,0 等。

我当前的所有命令都使用类似于以下的语法:socket.emit('write', options.port, "$H;\n");

我不知道如何发送操作命令,例如开始/停止/暂停。

我假设已经加载了 GRBL。我希望能够从我的 NECS 挂件应用程序开始/停止工作。

版本

  • CNCjs:1.9.15
  • 节点.js:10.15.3
  • NPM:6.4.1

你如何安装CNCjs?

  • [] NPM
  • 下载 CNCjs 桌面应用程序
  • 树莓派图像

数控系统

  • Grbl
  • 冰沙
  • TinyG/g2核心

硬件

  • 树莓派
  • 台式机或笔记本电脑
  • 移动设备

操作系统

  • 不适用
  • 视窗
  • 苹果
  • Linux
挂件 API 命令 - 示例开始/停止/暂停 #490 bradanlane 更改了标题 Pendant API 命令 – ege 开始/停止/暂停 挂件 API 命令 – 示例开始/停止/暂停 2019 年 6 月 3 日
挂件 API 命令 - 示例开始/停止/暂停 #490
合作者

@bradanlane

抱歉,它在 wiki 中没有很好的记录,您可以在控制器代码中看到所有支持的命令:
https ://github.com/cncjs/cncjs/blob/master/src/server/controllers/Grbl/GrblController.js# L1029-L1330

这里有一些例子:

socket.emit('command', options.port, 'gcode:load', name, gcode);
socket.emit('command', options.port, 'gcode:start');
socket.emit('command', options.port, 'gcode:pause');
socket.emit('command', options.port, 'gcode:resume');
socket.emit('command', options.port, 'gcode:stop');
socket.emit('command', options.port, 'cyclestart');
socket.emit('command', options.port, 'feedhold');
挂件 API 命令 - 示例开始/停止/暂停 #490
作者

感谢您的回复和解答。CNCjs 对我来说是一个有价值的项目。