Skip to main content

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

Insert a set of instruction data into the run queue

Type

int =>Insert a set of instruction data into the run queue

Parameter Option

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

Sample code

std::vector<NRC_InstrDataBase*> instrVec;
//You don't need to create a queue, it will be created automatically
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);
//They can be divided into multiple groups and inserted in separate batches, with the later insertions being appended after the previous ones
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);
//Start executing the queue
NRC_StartRunNoFlieRunqueue();