My laser engraver from 0 knowledge to 32.461% .... probably
-
ArtF
- Global Moderator

- Posts: 4556
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
Re: My laser engraver from 0 knowledge to 32.461% .... probably
Bobby:
Yes, to stop it form toggling, you'd have to modify your script to check to
see that the current level is on that pin. Ill try to get time to refresh my memory and
tell you the exact calls.. but its somethign like..
global MyRewindS ervice = function()
{
while(1)
{
print("Waiting for Pin6 to rewind");
block("MotionPin 6"); //this will wait for pin6 to toggle
if( Motion.GetPinDig( 6 ) == 1) //this would make the rewind only occur if the switch toggles to 1..could be zero..
{
//do a Gcode call here to do a rewind.. I thinks like..
print("Pin6 has been pressed");
GlobalSet( "Rewind" , 1);
}
}
};
I think the above will work.. You can also use GlobalSet with the name of any button
so to press the Rewind button on the screen, note the buttons variable name in the editor..
"Rewind" in this case, and in your script just use GlobalSet( "Rewind" , 1);
In this way any macro script or file can press buttons even in the Gcode.
If you add the line
{ GlobalSet( "Rewind", 1) }
to the end of a Gcode file, its the same as an M30, or pressing the rewind button.
You can put anything in a Gcode file in {} and it becomes a script.
Art
Yes, to stop it form toggling, you'd have to modify your script to check to
see that the current level is on that pin. Ill try to get time to refresh my memory and
tell you the exact calls.. but its somethign like..
global MyRewindS ervice = function()
{
while(1)
{
print("Waiting for Pin6 to rewind");
block("MotionPin 6"); //this will wait for pin6 to toggle
if( Motion.GetPinDig( 6 ) == 1) //this would make the rewind only occur if the switch toggles to 1..could be zero..
{
//do a Gcode call here to do a rewind.. I thinks like..
print("Pin6 has been pressed");
GlobalSet( "Rewind" , 1);
}
}
};
I think the above will work.. You can also use GlobalSet with the name of any button
so to press the Rewind button on the screen, note the buttons variable name in the editor..
"Rewind" in this case, and in your script just use GlobalSet( "Rewind" , 1);
In this way any macro script or file can press buttons even in the Gcode.
If you add the line
{ GlobalSet( "Rewind", 1) }
to the end of a Gcode file, its the same as an M30, or pressing the rewind button.
You can put anything in a Gcode file in {} and it becomes a script.
Art
-
BobbyW
- Site Admin
- Posts: 117
- Joined: Sun Sep 08, 2019 11:27 pm
Re: My laser engraver from 0 knowledge to 32.461% .... probably
Hi Art .ArtF wrote:
if( Motion.GetPinDig( 6 ) == 1) //this would make the rewind only occur if the switch toggles to 1..could be zero..
Art
Well the corect call was
Code: Select all
// if(IOPin8.GetState() == 1)
// if(MotionPin8.GetState() == 1)
if (Pokeys1.GetPinDig(8) == 1)
Code: Select all
if (Pokeys1.GetPinDig(8))
I look arown from Gary probing scripts to see how he get the pin state.
I seen all variables but where are located all functions ?
Like that i will know how to call them.
Delay , count , reg exist in Auggie or i need to create a function
to call after ?
Thanks
Bobby
-
gburk
- Site Admin
- Posts: 324
- Joined: Mon Nov 26, 2018 2:57 am
Re: My laser engraver from 0 knowledge to 32.461% .... probably
this is how i check the probe pin its in the library
Gary
Code: Select all
// Library PokeyPins
// Created Thursday, December 06, 2018
// Author Gary -- Do not edit above this line
// Enter Global vars below this line.
// the librarian no matter where they are, but its easier
// to find and edit them in one spot.
//The 6 lines previous to a function will appear as
//comments to help users to understand the parameters
//required for use by each function, so try to
//always add as clear a set of instructions in these
//lines as an aid to fellow travellers.
//myblock = block( "MotionPin19" , "IOPin9", "MotionPin11");
//if( myblock == "MotionPin9" ) { .......do whateer" };
global MonitorPin19 = function()
{
//Pokeys1.SetPinDig( 19 , 0 ); // turn off pin 19, ( assumed to be digital output)
while(1)
{
//print("Pin 19 Check");
GlobalSet("ProbeLED",0);
block( "MotionPin19"); //or you cold use IOPin9
//
// when you reach here, its because pin9 has changed..
pinstate = Pokeys1.GetPinDig(19);
//print("Pin 19 Changed");
GlobalSet("ProbeLED",1);
block( "MotionPin19");
//yield();
//do what you need to do. Take not that if you change pin9, youll get called again..
//so make sure you dont get into a loop where your change makes this gets called which then changes it..etc.. .
};
};
MonitorPin19();-
BobbyW
- Site Admin
- Posts: 117
- Joined: Sun Sep 08, 2019 11:27 pm
Re: My laser engraver from 0 knowledge to 32.461% .... probably
Hi.
Thanks Gary , i look on you library how you acces and create the functions.
I finish all my buttons , for start , stop , continue. rewind wasn't necesary
i program the extension to generate at the end the GCODE the rewind.
But now i run in other issue.
I want to put the buzzer allarm on X Y Z limit switches.
I mean , if the X will touch the limit switch , the alarm will toggle sound
until is released. That should not be hard but mess me up.
I saw in "Diags" pannel the LimitPArray and LimitMArray
and i saw is two variable for all + and - limit.
I want to send that signal " like the led blink in the Diags pannel, to OC1 as example :
Pokeys1.SetOC(1, LimitPArray);
That result in error , because call a non "int" type .
Assuming Limits have only 2 state , what it is and how to acces it .
I try to see if i understand wrong but i saw the script is not to much different than C .
I put below maybe i chose the wrong file.
Thanks
Bobby
Thanks Gary , i look on you library how you acces and create the functions.
I finish all my buttons , for start , stop , continue. rewind wasn't necesary
i program the extension to generate at the end the GCODE the rewind.
But now i run in other issue.
I want to put the buzzer allarm on X Y Z limit switches.
I mean , if the X will touch the limit switch , the alarm will toggle sound
until is released. That should not be hard but mess me up.
I saw in "Diags" pannel the LimitPArray and LimitMArray
and i saw is two variable for all + and - limit.
I want to send that signal " like the led blink in the Diags pannel, to OC1 as example :
Pokeys1.SetOC(1, LimitPArray);
That result in error , because call a non "int" type .
Assuming Limits have only 2 state , what it is and how to acces it .
I try to see if i understand wrong but i saw the script is not to much different than C .
I put below maybe i chose the wrong file.
Thanks
Bobby
You do not have the required permissions to view the files attached to this post.
-
BobbyW
- Site Admin
- Posts: 117
- Joined: Sun Sep 08, 2019 11:27 pm
Re: My laser engraver from 0 knowledge to 32.461% .... probably
I'm back 
Other important question . The scripts running in my system or in pokeys MCU .
Because today i mess up Auggie and all scripts was broken after "out of memory"
I have only 16G RAm but , i think i food the system with script trying to understand
all functions and variables here .
Single way to restart auggie was to edit manualy my last attempt
First one flood my system i think.
Thanks
Bobby
Other important question . The scripts running in my system or in pokeys MCU .
Because today i mess up Auggie and all scripts was broken after "out of memory"
I have only 16G RAm but , i think i food the system with script trying to understand
all functions and variables here .
Single way to restart auggie was to edit manualy my last attempt
Code: Select all
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
global limit_err = 0;
global My_limit_service = function()
{
while(1)
{
limit_err = Led("LimitMArray");
if(limit_err == 1)
{
print(" limit get touched");
Pokeys1.SetOC(2, 1);
sleep(2);
Pokeys1.SetOC(2, 0);
sleep(1);
}
}
};
// start the service
My_limit_service();
/*global limit_err = Led("LimitMArray");
// functie pentru alarma
global limit_err_buz = function()
{
// Pokeys1.SetOC(1, 0);
if (limit_err.GetState() == true)
{
Pokeys1.SetOC(1, 0);
// yield();
}
else
{
Pokeys1.SetOC(1, 1);
// yield();
}
return;
};
limit_err_buz();
*/
Thanks
Bobby
-
ArtF
- Global Moderator

- Posts: 4556
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
Re: My laser engraver from 0 knowledge to 32.461% .... probably
Hi Bobby:
Scripts run in Auggie. So its important not to slow down your system too much.
This script syntax...
while(1)
{
limit_err = Led("LimitMArray");
if(limit_err == 1)
{
print(" limit get touched");
Pokeys1.SetOC(2, 1);
sleep(2);
Pokeys1.SetOC(2, 0);
sleep(1);
}
}
is not a good way to do something. Sleep(1) I think is 1ms of sleep,
so this repeats a lot.. You should always use block to make a thread sleep
until its needed. Auggie can lock up your system as it grows in memory
due to script execution. Restarting will fix it of course.
I think as I recall that LimitPArray is an array of int, so LimitPArray[0]
would be x..etc..
Art
Scripts run in Auggie. So its important not to slow down your system too much.
This script syntax...
while(1)
{
limit_err = Led("LimitMArray");
if(limit_err == 1)
{
print(" limit get touched");
Pokeys1.SetOC(2, 1);
sleep(2);
Pokeys1.SetOC(2, 0);
sleep(1);
}
}
is not a good way to do something. Sleep(1) I think is 1ms of sleep,
so this repeats a lot.. You should always use block to make a thread sleep
until its needed. Auggie can lock up your system as it grows in memory
due to script execution. Restarting will fix it of course.
I think as I recall that LimitPArray is an array of int, so LimitPArray[0]
would be x..etc..
Art
-
gburk
- Site Admin
- Posts: 324
- Joined: Mon Nov 26, 2018 2:57 am
Re: My laser engraver from 0 knowledge to 32.461% .... probably
hi art
Not sure if its me or what's up i upgraded Auggie to the newest one on the home page, and seems like my probing is broken..
I do a probe and then get the message, get current com invalid, after a G move, and probing scripts do not work correct... i went back to Auggie ver 3.65 and all works again..
thanks gary
Not sure if its me or what's up i upgraded Auggie to the newest one on the home page, and seems like my probing is broken..
I do a probe and then get the message, get current com invalid, after a G move, and probing scripts do not work correct... i went back to Auggie ver 3.65 and all works again..
thanks gary
-
ArtF
- Global Moderator

- Posts: 4556
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
Re: My laser engraver from 0 knowledge to 32.461% .... probably
Gary:
Cant recall any changes.. I will try to get an update out this week as I do have a new version
with larger image aug screens ready to go. If that screws up the same way Ill see if I can trace
down thats up..
Thx
art
Cant recall any changes.. I will try to get an update out this week as I do have a new version
with larger image aug screens ready to go. If that screws up the same way Ill see if I can trace
down thats up..
Thx
art
-
ArtF
- Global Moderator

- Posts: 4556
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
Re: My laser engraver from 0 knowledge to 32.461% .... probably
Hi guys:
Auggie is updated and online. It has a larger aug's image display, ( and a smaller loaded image display..)
Im not sure why the latest versions would screw up the probe routines.. Im not sure what bug fix or change
would have made that happen, but let me know if it still does it.
Note:
Always keep a backup of your favorite version of Auggie as there is no way for me to backtrack most of the
changes I make over time unless I find it early. The best I can do is help troubleshoot the why of a bug
that gets introduced.
Thx
Art
Auggie is updated and online. It has a larger aug's image display, ( and a smaller loaded image display..)
Im not sure why the latest versions would screw up the probe routines.. Im not sure what bug fix or change
would have made that happen, but let me know if it still does it.
Note:
Always keep a backup of your favorite version of Auggie as there is no way for me to backtrack most of the
changes I make over time unless I find it early. The best I can do is help troubleshoot the why of a bug
that gets introduced.
Thx
Art
-
BobbyW
- Site Admin
- Posts: 117
- Joined: Sun Sep 08, 2019 11:27 pm
Re: My laser engraver from 0 knowledge to 32.461% .... probably
Hi.ArtF wrote: Hi guys:
Auggie is updated and online. It has a larger aug's image display, ( and a smaller loaded image display..)
Thx
Art
What i can say , man .... i love you
I didn't download yet , i hury up to say THANK YOU
And during time i observed , in AUGS screen when you input any data
like image dimensions , step...... after you write the number if you
press enter , will exit . I always press enter after any input , of course can be avoided that.
I go to download ;D ;D ;D.
Thanks again
Bobby