Welcome! Log In Create A New Profile

Advanced

Help defining custom M code for inserting a new move

Posted by aquabook 
Help defining custom M code for inserting a new move
October 11, 2021 02:27PM
I am trying to write a new MCode to insert a move immediately after the current move has finished executing. The MCode is defined as follows :

case 840:	// insert move 
{
    for (size_t axis = 0; axis < numVisibleAxes; ++axis)
	{
		if (gb.Seen(axisLetters[axis]))
		{
			const float ipval = gb.GetFValue();
			reply.catf("input given is  : %.3f \n",(double)ipval);
                        if (reprap.GetMove().MoveCompleted())
                        {
				//insert this ipval to the be executed
			}
		}
	}
}
break;

where MoveCompleted is defined as :

bool DDARing::MoveCompleted() const noexcept
{
	return myDda == getPointer->GetState() == DDA::completed;
}

Is my approach correct? How can I insert the move after the previous move has been completed
Sorry, only registered users may post in this forum.

Click here to login