by beefy » Sat Dec 10, 2016 7:42 pm
Hi Terry,
yes I understand and appreciate the dangers involved. I wouldn't for instance try and insert code to make the axis go a different direction to what the gcode had commanded. That would be like having gcode pulling the right leg one way and macro code pulling the left leg the other way at the same time, a bit disastrous.
All I'm wanting is a temporary reduction in feedrate then put back to normal a short time later.
I ended up doing the following and things did not go well:
for(i = 0; i < 4; i++) // "Press" decrease feedrate button 4 times to get 60% feedrate
{
exec.Callbutton(133);
while(exec.IsMoving()){}
exec.Wait(2000)
}
That one worked but it worked in a very strange way. The code would just halt for 8 seconds (4 x 2000 milliseconds) then the DRO would change from 1000 to 600 in one hit. There was no change every 2 seconds like I expected - 1000, 900, 800, 700, 600. A point of note is that the axis were NOT in motion when the feedrate was reduced.
Anyway at least it worked BUT putting the feedrate back to normal did not work.
for(i = 0; i < 4; i++) // "Press" increase feedrate button 4 times to go from 60% to 100% feedrate
{
exec.Callbutton(132);
while(exec.IsMoving()){}
exec.Wait(2000)
}
This time the axis were already in motion when it came to putting the feedrate back to normal.
This time is was complete disaster, the feedrate would only increase to 700 so it seems as though button 132 is only getting called once.
I even tried taking the code out of the for loop and just running it 4 times directly but the result was the same.
I had to go and start pulling the friggin excavator apart again so left it at that but the next thing I might try is just doing "exec.Code(132);" four times in a row all on its' own.
Keith