No, The program stops exactly after executing 600 lines. But the lines are sent to the rotary buffer which is 1200 provided by PR command once after the motion is stopped. Also the GUI get back to the update thread since the PR value is more than 750.
The first rotary open is as follows
PMACCom("A");
PMACCom("&1");
PMACCom("Q CLOSE I9=0");
PMACCom("&1 DEL ROT");
PMACCom("CLS");
PMACCom("CLR");
sprintf( strCom, "&1 DEFINE ROT %d",BufferSize);
PMACCom(strCom);
PMACCom("DELETE TRACE");
PMACCom("DELETE GATHER");
PMACCom("&1 DEFINE LOOKAHEAD 1000,500");
PMACCom("&1B0");
PMACCom("&1 OPEN ROT CLR");
And the subsequent open is as in the code snippet provided.
The code execution is fine, if I don't close the buffer until all the NC codes are sent to the buffer. Hope you could provide a solution for this problem since we are struggling with it for long time now.
In your code:
LineIndex++;
if(LineIndex>=(total_line_count))
{
PMACCom("CLOSE");
tmrUpdateMachineState->Enabled = true;
return;
}
}
}
else
{
PMACCom("CLOSE");
tmrUpdateMachineState->Enabled = true;
}
}
else
{
PMACCom("CLOSE");
tmrUpdateMachineState->Enabled = true;
return;
}
//******************************************************
I would comment out the PMACCom("CLOSE"); and see what happened.
I´m almost sure it will make it.
This code:
if(LineIndex>=(total_line_count))
{
PMACCom("CLOSE");
->will stop execution before it is finish.
Instead of sending "CLOSE" ,send a M30 and make a CMD"CLOSE" inside the M30, but first try the
comment out of the PMACCom("CLOSE"); and test it.
//**********************************************
To find out pmac need more lines I use to read this address
ry:$203f
Read bit 17 :
pmac need more lines if (readresult and 65536)=0
I only use the PR command for fun to display a progressbar.
The CLOSE after
if(LineIndex>=(total_line_count))
{
PMACCom("CLOSE");
and the last close after the last else is to close the buffer once all the NC codes are sent to PMAC. So I had commented the 2nd "CLOSE" and just enabled the machine timer.
I tried with commenting the "Close" command. But there is memory violation errors popping out. I hope since the buffer is open and i try to update the machine status, PMAC creates an error since the UI queries the M variables.
//******************************************
Instead of comment out the PMACCom("CLOSE");
//PMACCom("CLOSE");
you can change it to PMACCom("M30"); But not the first Close command in the top of your program
or you can make a BIIG delay (10 sek or more) before all the the PMACCom("CLOSE"); and
if it makes a different