跳到主要内容

NRC_AppendRunInstr(std::vector<NRC_InstrDataBase*>& instrVec)

追加运行模式下,添加运行队列

添加运行队列后,机器人将会立即执行加入的队列,请注意安全

添加的运行队列只能是机器人移动指令

类型

int =>追加运行模式下,添加运行队列

参数 Option

参数类型说明
instrVecstd::vector<NRC_InstrDataBase*>&要插入的一组指令数据

示例代码

//开启追加运行模式,机器人自动上使能
NRC_OpenInstrAppendRunMode();
std::vector<NRC_InstrDataBase*> instrVec;
instrVec.push_back(new NRC_InstrDataMOVJ(50, pos1, 5));
instrVec.push_back(new NRC_InstrDataMOVL(30, pos2, 2));
//添加队列后,机器人直接运行
NRC_AppendRunInstr(instrVec);
......
instrVec.clear();
instrVec.push_back(new NRC_InstrDataMOVC(20, pos0, 3));
instrVec.push_back(new NRC_InstrDataMOVC(20, pos1, 3));
//机器人运行完之前添加的队列后,会接上本次添加的队列
NRC_AppendRunInstr(instrVec);
......
NRC_PauseInstrAppendRun();//暂停运行
......
instrVec.clear();
instrVec.push_back(new NRC_InstrDataMOVJ(50, pos1, 5));
instrVec.push_back(new NRC_InstrDataMOVL(30, pos2, 2));
//暂停时添加的队列,调用再启动运行后,也可正常运行
NRC_AppendRunInstr(instrVec);
......
NRC_RestartInstrAppendRun();//再启动运行
......
//停止运行,机器人停止,并清空全部队列
NRC_StopInstrAppendRun();
//关闭追加运行模式,机器人自动下使能
NRC_CloseInstrAppendRunMode();