跳到主要内容

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

将一组指令数据插入到运行队列中

类型

int =>将一组指令数据插入到运行队列中

参数 Option

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

示例代码

std::vector<NRC_InstrDataBase*> instrVec;
//可以不创建队列,会自动创建
instrVec.push_back(new NRC_InstrDataMOVJ(50, pos1, 5));
instrVec.push_back(new NRC_InstrDataMOVL(30, pos2, 2));
instrVec.push_back(new NRC_InstrDataMOVC(20, pos0, 3));
instrVec.push_back(new NRC_InstrDataMOVC(20, pos1, 3));
NRC_InsertNoFlieRunqueue(instrVec);
//可以分成多组分次插入,后面插入的会接在之前插入的后面
instrVec.clear();
instrVec.push_back(new NRC_InstrDataIMOV(40, dev1, 0));
instrVec.push_back(new NRC_InstrDataDOUT(5, 1));
instrVec.push_back(new NRC_InstrDataTIMER(3.3));
instrVec.push_back(new NRC_InstrDataWAIT(new NRC_ConditionJudge(NRC_ConditionJudge::INT_, 3, NRC_ConditionJudge::LESS, NRC_ConditionJudge::DOUBLE_, 5), 2.2));
instrVec.push_back(new NRC_InstrDataWAIT(new NRC_ConditionJudge(NRC_ConditionJudge::DIN_, 2, NRC_ConditionJudge::EQUAL_TO, NRC_ConditionJudge::CONST_, 1), 0));
instrVec.push_back(new NRC_InstrDataMOVJ(30, pos1, 1));
NRC_InsertNoFlieRunqueue(instrVec);
//开始执行队列
NRC_StartRunNoFlieRunqueue();