reading Pokeys pins

C Scripting questions and answers
gburk
Site Admin
Posts: 324
Joined: Mon Nov 26, 2018 2:57 am

Re: reading Pokeys pins

Post by gburk »

Art

The G code seems to run fine now no problems when first loading G code with m6..

I'm not sure how exactly you setup the _close, doesn't seem to work it I use dialog._close(); or dialog("_close")  in some of my stuff OnCancel is setup like
CDialog::OnCancel();  so not totally sure how game monkey is handlining it...

Can it be closed in the function called by the dialog.button press?.

Thanks gary
ArtF
Global Moderator
Global Moderator
Posts: 4557
Joined: Sun Sep 05, 2010 5:14 pm
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

I used it in testing by simply renaming your Z touchoffbutton dialog handler
setting when you added the button to this..

WaitDialog.AddButton("Touch OFF Z_close","MyToolChange");

The button will still read "Touch Off Z" when displayed on the dialog,
and the script MyToolChange will be called, but the OnOK routine
which will close the dialog will be called when the MyToolChange Script
has completed its run.

  So if you change any buttons declaration to having _close added
to the buttons label, that buttons becomes an OK button with your label
and your script.

Art

gburk
Site Admin
Posts: 324
Joined: Mon Nov 26, 2018 2:57 am

Re: reading Pokeys pins

Post by gburk »

Art

I Get it now and tried it and it does work.. But Always a But

Now when I run the g code and I get the m6 the dialog pops up but the g code keeps running, so the g code isn't stopping and waiting for the button press the g code continues to run even with the dialog waiting for the button press, the dialog does close when I hit the button..

Sorry I guess I just make problems

Gary
ArtF
Global Moderator
Global Moderator
Posts: 4557
Joined: Sun Sep 05, 2010 5:14 pm
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

  Its likely due to some changes I made in the logic to keep things running unless told otherwise.
In your toolchange script, call StopProgram() and see if that fixes things. It should work like your
peck drilling does, it stops after its call due to the StopProgram() you put in the script. I
removed the toolchange autostop unless there is no tool change script, if none exists, it
stops on the M6, if a script exists, its up to the script to call StopProgram if it wishes the
program to stop. Unfortunately, a dialog opening is seen as the calling script terminating,
so its assuming your doing an auto tool change with no interaction, the calling script
is finished so it just continues. Add the StopProgram() call and it should stop.

  Downside is youll have to press run after your dialogs are complete. I will try to add a
continue() call, but its complex in there in its interactions so I'm trying not to hurt
scripts I or others have, so you may not have a continue real fast..Im still testing for
ramifications.

Art
gburk
Site Admin
Posts: 324
Joined: Mon Nov 26, 2018 2:57 am

Re: reading Pokeys pins

Post by gburk »

Art

Will check that out,

Would it just be easier just to add a way to read the OK and Cancel buttons and then call a function depending on the choice?.

I put a Engine.StopProgram(); in the tool change dialog function but didn't have any affect g code sill keeps running with the dialog screen just waiting for input

thank gary
Last edited by gburk on Sun Jun 23, 2019 1:51 pm, edited 1 time in total.
ArtF
Global Moderator
Global Moderator
Posts: 4557
Joined: Sun Sep 05, 2010 5:14 pm
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

For techincal reasons, as the system creates OK and cancel, they really cant be easily hooked.
This makes them kinda useless in my view, better to simply label a button as "OK_close"
and turn off system buttons. Works the same really.

Ill check why that stop doesnt occur..

Art
ArtF
Global Moderator
Global Moderator
Posts: 4557
Joined: Sun Sep 05, 2010 5:14 pm
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

For the life of me I cant repeat it. If I load all is fine, I press run and I can see internally
the program stop get set. Then a script tells the Z to G1 to 1.0, then another G1Z.125,
then the dialog appears and the program waits for a run command.

  Im not sure what script is telling it to go up, I just verified
its coming in from a script. It then immediately does a g1 to z.125 and stops for the run.

  So Im not sure exactly whats going on, Ill keep looking..

Art
gburk
Site Admin
Posts: 324
Joined: Mon Nov 26, 2018 2:57 am

Re: reading Pokeys pins

Post by gburk »

Art

DoManualToolChange is sending the script to 1" then calls the wait dialog for tool change..

I tested it again with the same g code I sent you.. I hit RUN the code start running the Z retracts to 1" then the code continues to Drill pecking and my dialog pops up
and sits there but g code is still running doing the pecking never stops and wait for a button press.

Gary
ArtF
Global Moderator
Global Moderator
Posts: 4557
Joined: Sun Sep 05, 2010 5:14 pm
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

Does it stop after each line of pecking the way mine does?

Art
gburk
Site Admin
Posts: 324
Joined: Mon Nov 26, 2018 2:57 am

Re: reading Pokeys pins

Post by gburk »

Art

Just keeps pecking the g code doesn't stop does the 4 pecking lines then continues to the cutting the recess the dialog pops up at the m6 lines but the g code keeps running.

it was working ok in the last version of auggie just had the problem when g code loaded running m6 and then g code being rewinded to first line.
That's fixed..

Gary
Post Reply