reading Pokeys pins

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

Re: reading Pokeys pins

Post by gburk »

Art

Just to make sure it wasn't the script I wrote another one to probe the z its a short one not doing much just probing and returning..
and i called it twice for the x centering script..

got the same results probed great the first call, but crashes on the second, the second call to z probe the g31 z- moves the spindle down but doesn't stop on the probe being hit..

I tried yield(); and engine.programstop but no help..

It almost seems to me like if your still running in a function and make the second call to the z probe function something didn't get cleared out from the first call to z probe..

Making any sense?

tried a new approach
Put this in the script run window
This ran fine in the scripter.
probed good on both calls to Z_touch()

Z_touch(); // calls the global touch off function
Engine.GCode("G4 P4");
Z_touch();


then dropped a button on the screen and created a global lib script
and this also crashes the tool on the second call to Z_touch()

global TestP = function()
{
Z_touch(); // calls the global touch off function
Engine.GCode("G4 P4");
Z_touch();
};


Gary
Last edited by gburk on Mon Oct 07, 2019 11:30 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:

Hmm, before I go digging, can you list the Ztouch script here..
Does sound like somethings screwy.. Ill try dropping it in a button to see..

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:

On a side note, I checked your step calibration scripts, math looks right in reading.. :)

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

Re: reading Pokeys pins

Post by gburk »

Art

Thanks for checking the math..

Here is the Z probe script that has problems with being called twice from a function...

Gary
You do not have the required permissions to view the files attached to this post.
gburk
Site Admin
Posts: 324
Joined: Mon Nov 26, 2018 2:57 am

Re: reading Pokeys pins

Post by gburk »

Art

Not sure if you need the panel but here it is just in case.

Gary
You do not have the required permissions to view the files attached to this post.
gburk
Site Admin
Posts: 324
Joined: Mon Nov 26, 2018 2:57 am

Re: reading Pokeys pins

Post by gburk »

Art

Decided to try not calling the Z probe function from the X center function and just added some of the z probe code to the x centering function so it all was in one function..

I probed down hit the part top and retracted to .250. this worked good
Then I did a G01 X to move off the part but I used a small value so when I Z probed down now to see if I was off the part it would hit the part
and it did hit the part but same problem didn't stop crashed the part..

so not sure why it doesn't like to do a Z g31 correctly twice.. in a lib function..

works fine if I do a button press, it probes z and retracts then exits the function.
Hit the button again and it will Z probe fine tried the button press 10 times in a row and worked every time..

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

Re: reading Pokeys pins

Post by gburk »

Art

Last attempt.. for now

I loaded the lib function X centering into the script window
Then I rem // out the global function, and the start and end brackets.

I ran the script in the script window, it seemed to work there.
probed down hit probe retracted, then G01 over in the X axis no problem, now I probed down again in the Z hit part and retracted fine, the second probe on z would show as an error, "that you are not off the parts edge", then it would rapid back to X start position.. it all seemed to work fine..

I don't know of any other test to try..
But to me it all points to the lib function's not probing twice, but probes twice fine in the scripter and button presses... 

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

Re: reading Pokeys pins

Post by ArtF »

Thanks Gary..


Ill see what I can find..

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

Re: reading Pokeys pins

Post by gburk »

Art

Ok thanks,

One new question, how do you change the colors in the panel the background of the panel, other than loading a bitmap image?
Some how one of my panels got changed to a light grey, and i see no color option except to load a new image, and i can't duplicate the default colors if i create a new image..

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 »

Ill have to check Gary, Im not sure top of head. Ill post shortly.

Art
Post Reply