Skip to main content

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

Add a run queue in append run mode

After adding the run queue, the robot will immediately execute the added queue, please pay attention to safety

The added run queue can only be robot movement instructions

Type

int =>Add a run queue in append run mode

Parameter Option

ParameterTypeDescription
instrVecstd::vector<NRC_InstrDataBase*>&A set of instruction data to be inserted

Sample code

//Turn on the append run mode, and the robot is automatically powered on
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));
//After adding the queue, the robot will run the added queue directly
NRC_AppendRunInstr(instrVec);
......
instrVec.clear();
instrVec.push_back(new NRC_InstrDataMOVC(20, pos0, 3));
instrVec.push_back(new NRC_InstrDataMOVC(20, pos1, 3));
//After the robot finishes running the queue added before, it will continue to run the queue added this time
NRC_AppendRunInstr(instrVec);
......
NRC_PauseInstrAppendRun();//Pause
......
instrVec.clear();
instrVec.push_back(new NRC_InstrDataMOVJ(50, pos1, 5));
instrVec.push_back(new NRC_InstrDataMOVL(30, pos2, 2));
//The queue added during pause can also run normally after calling the restart command
NRC_AppendRunInstr(instrVec);
......
NRC_RestartInstrAppendRun();//Restart
......
//Stop running, the robot stops, and the entire queue is cleared
NRC_StopInstrAppendRun();
//Turn off the append run mode, and the robot is automatically powered off
NRC_CloseInstrAppendRunMode();