Art
Will give the local dialog, a try made a few mods to peck
I modified cambam post to use the G888 it seems to work but its putting the same G888 line twice in the g code file so i'll have to figure that one out.
Also the continue dialog is still popping up random at some m6 calls not 100% sure but that seems to mess things up sends the axis's back to 0 the right back to where they were before the continue dialog then it loops there can't run past the m6 line if I single step it will run each line and the continue dialog doesn't pop up.
Tried removing the global from my dialog but didn't change anything..
Think i'm getting ahead of myself again but I assuming auggie will not execute the G888 ?
It works fine In the MDI window, is there a way to have auggie read the script G888 while running the G Code file?
//G888 P.25 H1 R.2 I10
// M888 = Peck drilling Call with G888 H = Depth to drill R = retract hight P = Peck distance I Feed Rate
global GCode888 = function()
{
NegValue = ParmsH[0];
NegValue = ToInt(NegValue);
if (NegValue < 0)
{
NegValue= math.abs(NegValue);
print("ParmsH "+NegValue);
ParmsH[0] = NegValue;
}
else if( NegValue == 0 )
{
return;
};
//ok pos value lets do so pecking
print("Peck Drilling ");
for( pecking = 0; pecking <= ParmsH[0]; pecking+=ParmsPRI[0])
{
if (pecking + ParmsPRI[0] > ParmsH[0])
{
pecking = ParmsH[0];
}
print(" Pecking Z = "+pecking);
Engine.GCode("G90 G01 Z-"+pecking+" F"+ParmsPRI[2]);
block("MotionStill");
Engine.GCode("G90 G01 Z"+ParmsPRI[1]+" F"+ParmsPRI[2]);
block("MotionStill");
lastpos = pecking;
sleep(2);
};
yield();
print("Finished pecking to the depth of "+lastpos);
Engine.StopProgram();
};
Thanks gary
reading Pokeys pins
-
gburk
- Site Admin
- Posts: 324
- Joined: Mon Nov 26, 2018 2:57 am
Re: reading Pokeys pins
Last edited by gburk on Mon May 13, 2019 12:45 am, edited 1 time in total.
-
ArtF
- Global Moderator

- Posts: 4557
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
Re: reading Pokeys pins
Gary:
The continue dialog Ill add a switch to stop if one wishes to turn it off. I use it to start a file in the middle
or other location. Its purpose is to move safely to the previous lines end so a program can continue. This works
well as I never offset due to a tool change. Your offsets seem to affect it so Ill add a switch to turn it off
as a config item.
If you create a Gcode script GCode888 it should be called if the Gcode has an G888 in it. Your log, if debug log is
turned on should show the Gcode being called, and should show the parameters as they currently stand due to the call.
Does it show anything?
(Im still checking the dialog cause.)
Art
The continue dialog Ill add a switch to stop if one wishes to turn it off. I use it to start a file in the middle
or other location. Its purpose is to move safely to the previous lines end so a program can continue. This works
well as I never offset due to a tool change. Your offsets seem to affect it so Ill add a switch to turn it off
as a config item.
If you create a Gcode script GCode888 it should be called if the Gcode has an G888 in it. Your log, if debug log is
turned on should show the Gcode being called, and should show the parameters as they currently stand due to the call.
Does it show anything?
(Im still checking the dialog cause.)
Art
-
ArtF
- Global Moderator

- Posts: 4557
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
Re: reading Pokeys pins
Gary:
As an example, if I add a G666 to my Gcode file here, you can see it being executed on the toolpath screen and the data
its receiving. Try it and let me know if you get that text data showing 666 works..
Art
As an example, if I add a G666 to my Gcode file here, you can see it being executed on the toolpath screen and the data
its receiving. Try it and let me know if you get that text data showing 666 works..
Art
-
ArtF
- Global Moderator

- Posts: 4557
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
Re: reading Pokeys pins
Gary:
Auggie is updated to test version 3.6e for you to test.
I made some fairly drastic changes so there may be unexpected
results. I did get your dialogs working on every toolchange, but
it was just the script I changed for that.
The problem was the global nature I think of the dialogs. I changed
the one dialog to this for example..
global ToolWait = function()
{
WaitDialog = Dialog();
WaitDialog.SetRect( 25, 20 );
WaitDialog.SetTitle( "Maunal Tool Change " );
WaitDialog.NextPosition( 5,5,80,50 );
WaitDialog.AddStaticText( " Manual Tool Change now Jog to a safe X Y Z Position");
WaitDialog.NextPosition( 5,15,80,50 );
WaitDialog.AddStaticText( " After new Tool is Inserted PRESS Touch OFF Z");
WaitDialog.NextPosition( 40,50,60,70 );
WaitDialog.SystemButtonsOnOff(true);
WaitDialog.AddButton("Touch OFF Z","MyToolChange");
WaitDialog.DoModeless("none");
};
As the dialog isnt global it has an easier time dealing with it
at deletion time. Dialogs arent really very reusable in Monkey Script.
Try this new version, it seems to track better. Im sure there still exists
bugs and such, but lets see what this one does.
Art
Auggie is updated to test version 3.6e for you to test.
I made some fairly drastic changes so there may be unexpected
results. I did get your dialogs working on every toolchange, but
it was just the script I changed for that.
The problem was the global nature I think of the dialogs. I changed
the one dialog to this for example..
global ToolWait = function()
{
WaitDialog = Dialog();
WaitDialog.SetRect( 25, 20 );
WaitDialog.SetTitle( "Maunal Tool Change " );
WaitDialog.NextPosition( 5,5,80,50 );
WaitDialog.AddStaticText( " Manual Tool Change now Jog to a safe X Y Z Position");
WaitDialog.NextPosition( 5,15,80,50 );
WaitDialog.AddStaticText( " After new Tool is Inserted PRESS Touch OFF Z");
WaitDialog.NextPosition( 40,50,60,70 );
WaitDialog.SystemButtonsOnOff(true);
WaitDialog.AddButton("Touch OFF Z","MyToolChange");
WaitDialog.DoModeless("none");
};
As the dialog isnt global it has an easier time dealing with it
at deletion time. Dialogs arent really very reusable in Monkey Script.
Try this new version, it seems to track better. Im sure there still exists
bugs and such, but lets see what this one does.
Art
-
ArtF
- Global Moderator

- Posts: 4557
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
Re: reading Pokeys pins
Gary:
I found I had another weirdness in my scripts in that a G666 would stop the program. While I do make one
press run after a toolchange, other scripts shouldn't require it. So version 3.6f is online which corrects this and
a few other small memory issues. I fond it now seems to operate as I expected it should. It will pause after
a toolchange, but other Gcode commands you may add will not stop unless you call
for a programstop in the script itself.
Good luck testing. Be cautious as I have rejiggered a fair bit. At this point your testfile runs your dialog
on every toolchange, and waits for run to be pressed afterwards. The continue dialog, should it appear,
has a cancel and continue button added so you can basically ignore it by pressing that when it appears.
I left it in because it IS handy if one wants to start a file in the middle.
Let me know your experiences.
Art
I found I had another weirdness in my scripts in that a G666 would stop the program. While I do make one
press run after a toolchange, other scripts shouldn't require it. So version 3.6f is online which corrects this and
a few other small memory issues. I fond it now seems to operate as I expected it should. It will pause after
a toolchange, but other Gcode commands you may add will not stop unless you call
for a programstop in the script itself.
Good luck testing. Be cautious as I have rejiggered a fair bit. At this point your testfile runs your dialog
on every toolchange, and waits for run to be pressed afterwards. The continue dialog, should it appear,
has a cancel and continue button added so you can basically ignore it by pressing that when it appears.
I left it in because it IS handy if one wants to start a file in the middle.
Let me know your experiences.
Art
-
gburk
- Site Admin
- Posts: 324
- Joined: Mon Nov 26, 2018 2:57 am
Re: reading Pokeys pins
hi art
Thanks will test it out.. I found out why the G888 Wasn't running in the g code.. my error in script..
I attached the updated script and the g code file I ran in the air, and my dialog did pop up on tool changes never seen the continue dialog at all..
The only thing I see going on with this g code file is that it doesn't show up in the display window. most likely the G888 messing it up, but it did run ok..
I am assuming as long as nothing was weird going on then it didn't call the continue dialog..
Thanks gary
Thanks will test it out.. I found out why the G888 Wasn't running in the g code.. my error in script..
I attached the updated script and the g code file I ran in the air, and my dialog did pop up on tool changes never seen the continue dialog at all..
The only thing I see going on with this g code file is that it doesn't show up in the display window. most likely the G888 messing it up, but it did run ok..
I am assuming as long as nothing was weird going on then it didn't call the continue dialog..
Thanks gary
You do not have the required permissions to view the files attached to this post.
-
ArtF
- Global Moderator

- Posts: 4557
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
Re: reading Pokeys pins
Hi Gary:
>>I am assuming as long as nothing was weird going on then it didn't call the continue dialog..
I updated the executing line display, I think that was screwing with the continue dialog, it triggers
if you press run and the last line executed doesnt end at your current line. It then wants to safely move there
to continue the file.
>>he only thing I see going on with this g code file is that it doesn't show up in the display window. m
The file doesnt show up? lol, Ill check that out.
Thx
Art
>>I am assuming as long as nothing was weird going on then it didn't call the continue dialog..
I updated the executing line display, I think that was screwing with the continue dialog, it triggers
if you press run and the last line executed doesnt end at your current line. It then wants to safely move there
to continue the file.
>>he only thing I see going on with this g code file is that it doesn't show up in the display window. m
The file doesnt show up? lol, Ill check that out.
Thx
Art
-
ArtF
- Global Moderator

- Posts: 4557
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
Re: reading Pokeys pins
Gary:
The file shows up eventually, you have a 2 second delay sleep(2) after each peck, so in loading its executing that,
remove it and the file shows up almost immediately. Ill see some way to ignore a sleep while loading a file. While
loading the file is executed to make a toolpath so the sleeps make it slow to load.
Other than that , I had to fix the SetSpindleState to remove the calls to SpindleOn and SpindleOff, then the file
runs as youd expect and I can see it pecking. File seems to run OK now.
Art
The file shows up eventually, you have a 2 second delay sleep(2) after each peck, so in loading its executing that,
remove it and the file shows up almost immediately. Ill see some way to ignore a sleep while loading a file. While
loading the file is executed to make a toolpath so the sleeps make it slow to load.
Other than that , I had to fix the SetSpindleState to remove the calls to SpindleOn and SpindleOff, then the file
runs as youd expect and I can see it pecking. File seems to run OK now.
Art
-
ArtF
- Global Moderator

- Posts: 4557
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
Re: reading Pokeys pins
Gary:
I just upped version 3.6g. This fixes your sleeps slowing the load down. Sleep(x) will be interpreted as sleep(0)
during a load ( essentially a yield()), so the slowdown isnt very noticeable. The files loads very quick here now
and when running delays 2 seconds after each peck of the peck drilling as called for.
Art
I just upped version 3.6g. This fixes your sleeps slowing the load down. Sleep(x) will be interpreted as sleep(0)
during a load ( essentially a yield()), so the slowdown isnt very noticeable. The files loads very quick here now
and when running delays 2 seconds after each peck of the peck drilling as called for.
Art
-
gburk
- Site Admin
- Posts: 324
- Joined: Mon Nov 26, 2018 2:57 am
Re: reading Pokeys pins
Thanks art
The pecking has been a problem with me I keep finding new problems I think I fixed a couple more here I a new peck a also changed the sleep time..
and if the cam program put a -0.1 I was loosing the 1 so would not peck with the 0 value losing values after the decimal..
removed the yield... do you think I should remove the stop program also ?
//G888 P.25 H1 R.2 I10
// M888 = Peck drilling Call with G888 H = Depth to drill R = retract hight P = Peck distance I Feed Rate
global GCode888 = function()
{
HoleDepth = ParmsH[0];
if (HoleDepth< 0)
{
HoleDepth = math.abs(HoleDepth);
}
//ok pos value lets do so pecking
print("Peck Drilling ");
for( pecking = 0; pecking <= HoleDepth; pecking+=ParmsPRI[0])
{
if (pecking + ParmsPRI[0] > HoleDepth)
{
pecking = HoleDepth;
}
print(" Pecking Z = "+pecking);
Engine.GCode("G90 G01 Z-"+pecking+" F"+ParmsPRI[2]);
block("MotionStill");
Engine.GCode("G90 G01 Z"+ParmsPRI[1]+" F"+ParmsPRI[2]);
block("MotionStill");
lastpos = pecking;
sleep(.5);
};
print("Finished pecking to the depth of "+lastpos);
Engine.StopProgram();
};
Thanks gary
The pecking has been a problem with me I keep finding new problems I think I fixed a couple more here I a new peck a also changed the sleep time..
and if the cam program put a -0.1 I was loosing the 1 so would not peck with the 0 value losing values after the decimal..
removed the yield... do you think I should remove the stop program also ?
//G888 P.25 H1 R.2 I10
// M888 = Peck drilling Call with G888 H = Depth to drill R = retract hight P = Peck distance I Feed Rate
global GCode888 = function()
{
HoleDepth = ParmsH[0];
if (HoleDepth< 0)
{
HoleDepth = math.abs(HoleDepth);
}
//ok pos value lets do so pecking
print("Peck Drilling ");
for( pecking = 0; pecking <= HoleDepth; pecking+=ParmsPRI[0])
{
if (pecking + ParmsPRI[0] > HoleDepth)
{
pecking = HoleDepth;
}
print(" Pecking Z = "+pecking);
Engine.GCode("G90 G01 Z-"+pecking+" F"+ParmsPRI[2]);
block("MotionStill");
Engine.GCode("G90 G01 Z"+ParmsPRI[1]+" F"+ParmsPRI[2]);
block("MotionStill");
lastpos = pecking;
sleep(.5);
};
print("Finished pecking to the depth of "+lastpos);
Engine.StopProgram();
};
Thanks gary