Page 1 of 5

print where

Posted: Tue Dec 20, 2016 11:42 am
by DanL
global MCode6 = function()
{
  print("A M6 was just executed.");
 
};

Hi art starting to work on a M6 script when I run the code above where does the print print.

Re: print where

Posted: Tue Dec 20, 2016 1:53 pm
by Ya-Nvr-No
should see it on both the screen and in the log file

global MCode6 = function( tool )
{
    print("A M6 was just executed.");
    print("Change now to Tool " + tool + "requested");
    Engine.StopProgram();
};

Re: print where

Posted: Tue Dec 20, 2016 3:42 pm
by DanL
I must be doing something wrong.

If I have what you posted in the script window on screen it does not print, If I have it in the scripter window nothing in the G code library nothing.

I will watch arts vids again see if I can find where I am going wrong

Re: print where

Posted: Tue Dec 20, 2016 4:24 pm
by DanL
Auggie is not working properly running it in sim, I will have to try it on the computer with a pokeys attached

Re: print where

Posted: Wed Dec 21, 2016 1:32 am
by Ya-Nvr-No
the image above was from the Single MDI tab

this image is from the MultiLine MDI tab shows me calling it twice in the SIM mode

make sure you have the yellow highlighted line on the start line and use the run button

Re: print where

Posted: Wed Dec 21, 2016 9:22 am
by ArtF
Dan:

We did find an error in the M6 today, it wasnt remembering the tool properly. When interpreted, the M6 calls the macro "ToolChange( tool )" but you'll need an updated version which I haven't put out yet for the fix. Ill be updating within a few days.

Thx
Art

Re: print where

Posted: Wed Dec 21, 2016 10:10 am
by DanL
Art the version of gearotic on my inside laptop was corrupted, most things in Auggie where not working and gearotic was doing strange shit.

I had to strip gearotic and Auggie from the computer, I tried a overwrite first and thing were still bonkers so had to run a cleaning program, onces it was all cleaned out I did a reinstall and now it is fine.

That will explain why some bits are not working the code Ya-Nvr_No posted works fine sort of (it's safe to use).

It was close too what I was trying to use, What is a good sign that I was close to a correct code I just had a bit more info there.

Is there a code call for moving a axis to its home position I tried to find it yesterday. (engine.rapidto (x,y,10) works for moveing Z above the work zero) I would rather have the Z goto machine Z zero.

Re: print where

Posted: Wed Dec 21, 2016 11:20 am
by ArtF
Hi Dan:

Many of the commands I roughed in even though I didnt need them for laser. In theory a G28Z0 should work,
but Id test it carefully. Let me know if it doesnt and Ill investigate a solution. Many commands are like that , unused, so untested or fixed up. My laser runs well under Auggie, but I don't use many codes other than standard calls for motion..and homing.

Art

Re: print where

Posted: Wed Dec 21, 2016 11:41 am
by DanL
G28 does not work

Re: print where

Posted: Wed Dec 21, 2016 12:00 pm
by ArtF
Dan:

Just checked, A g28X0 will call a macro CallHome( x,y,z,a ); Youll have to modify that macro ( or add it) to
make it then command a G1 or G0..or whatever type of homing sequence you'd like. This allows you to specify
a Z to home first if required...or any special considerations you may want. A G28 or G30 will do the same thing.

  I believe the x,y,z, a, coordinates are the offset distance to home in current coordinates . So you may want to
also massage them to stop .1" before ..or as you like.  Again, all untested by me, but Ive traced the call and it all
seems to work.

Art


Re: print where

Posted: Wed Dec 21, 2016 12:44 pm
by DanL
I think it's corrupted again Auggie does not like me very much I give it ago on my machine computer

Re: print where

Posted: Wed Dec 21, 2016 1:17 pm
by ArtF
Is this XP Dan? We've discover XP doesnt like the librarian, Ive made soem fixes for it, theyll be in the next version as
well..


Art

Re: print where

Posted: Wed Dec 21, 2016 1:54 pm
by DanL
Na win10, just playing to learn I did a M10 what is just.

global MCode11 = function()
{
  //debug();
  Engine.RapidTo(x,y,10);
  Engine.StopProgram();
}; 

it does what is meant to do plus I added other stuff to it and it works as well.

but in M6 I have this

global MCode6 = function()
{
  debug();
  print("A M6 was just executed.");
  print("Change now to Tool " " " + tool + " " "requested");
  sleep(10);
  Engine.RapidTo(x,y,10);
  Engine.StopProgram();
}; 


it does everything in it other than the Engine.RapidTo(x,y,10); and debug it does not matter where it is it just does not do those lines.

Having just this it's fine and does what I need.

global MCode6 = function()
{
  print("A M6 was just executed.");
  print("Change now to Tool " " " + tool + " " "requested");
  Engine.StopProgram();
}; 

Re: print where

Posted: Wed Dec 21, 2016 3:19 pm
by ArtF
Dan:

I think youll find MCode6 isnt being called, its calling ToolChange( tool )..which has the same messages..

M3,M5,M4, M6 are all special and call special macros, SpindleOn SpindleOff, ToolChange..etc..

Any nonstandard MCode or unrecognised MCode will call a script named MCodeX .. so modify ToolChange and it will work.. after the next release anyway. Thx for the tests..

I just fixed G28 as well for next release. It will call CallHome(x,y,z,a ) with values of how far the user wants each axis to go .. so if your zeroed 10 inches from Xhome and enter G28X2 , youll get CallHome( -8,0,0,0 ); You can use the distance
information any way youd like. Standard would be to first move to the X position, then home.. as I recall..

Art

Re: print where

Posted: Wed Dec 21, 2016 4:43 pm
by DanL
Cool, it's not doing a lot with M6 debug is doing nothing so yer she broke, for fun I can change M6 to M11 in the fusion post or whatever M is free.

It's fun when stuff works going over your vids is helping.

I have to add a dwel to the fusion post before and after a tool change it moves too fast, pucker factor 1000%.