Re: getting the 57cnc to work with G540

Discussions and file drops for Auggie
DanL
Old Timer
Posts: 362
Joined: Wed Sep 10, 2014 1:35 pm

Re: getting the 57cnc to work with G540

Post by DanL »

ta still no go
GlennD
Old Timer
Posts: 80
Joined: Tue Oct 18, 2011 4:19 pm

Re: getting the 57cnc to work with G540

Post by GlennD »

If that is a paste from your code I also missed that you had pinDia instead of pinDig
:)
Glenn
DanL
Old Timer
Posts: 362
Joined: Wed Sep 10, 2014 1:35 pm

Re: getting the 57cnc to work with G540

Post by DanL »

I will have to double check, it compiles.

another question where should I put the code.
DanL
Old Timer
Posts: 362
Joined: Wed Sep 10, 2014 1:35 pm

Re: getting the 57cnc to work with G540

Post by DanL »

this is what I have for spindle on off is this correct I have it in main Screen.

global SpindleOn = function()
{
    SpindleDevice.SetPinDig( 45, 1);  //turn on spindle
    //you want pin 45 to be digital on or off, sounds like 0 is on, so..

    print("Spindle was turned on with pin 45 = 0");
}; 

global SpindleOff = function()
{
    SpindleDevice.SetPinDig( 45, 1); //turn on spindle
    print("Spindle was turned off");
    print("using pin45 ");
}; 


the other thing I can think of doing is changing the laser box to a spindle box would this work or just be a waste of time. I am going to have a break for a few hours it giving me a headache
GlennD
Old Timer
Posts: 80
Joined: Tue Oct 18, 2011 4:19 pm

Re: getting the 57cnc to work with G540

Post by GlennD »

it should go in the scripts library under Gcode then SpindleLib-RelayOnly it should be checked and the Gcode should be checked.

I think the 45,1 in the SpindleOn function should be 45,0 from the notes.

Glenn
Attachments
spindleLib.PNG
DanL
Old Timer
Posts: 362
Joined: Wed Sep 10, 2014 1:35 pm

Re: getting the 57cnc to work with G540

Post by DanL »

thanks glen it's probable that is what is wrong going by art's not the code should be correct I just put it in the wrong place

thank you
DanL
Old Timer
Posts: 362
Joined: Wed Sep 10, 2014 1:35 pm

Re: getting the 57cnc to work with G540

Post by DanL »

Art I have run into a problem, with glens help and me not reading what you said as do in that library,my bad I have done another library for the superpid just using the code out of the spindle relay only, and putting the changes what you said to do in it, I compile it comes up with no issues then I run it no problem's then when I go to check it back in it comes up with, no cntr Selected to update.

here is what I did

Code: Select all

// Library SpindleLib-RelayOnly 
// Created  Friday, January 22, 2016 
// Author  Art       
  
// number of the OC "Open Collector output"
//on the pokeys that will trip a relay 
//for spindle ON/OFF 
global MySpindleOutput = 1;
global SpindleDevice = Motion();   
   
//this is a relay spindle control, 
//it will use only the OC output #1
//to control a relay to turn a simple
//on/off spindle, on or off.
 
global SpindleOn = function()
{
    SpindleDevice.SetPinDig( 45, 1);
    //SpindleDevice.SetOC( MySpindleOutput, 1); //turn on spindle
    print("Relay Spindle was turned on with OC#" + MySpindleOutput);
};   
 
//this is a relay spindle control, 
//it will use only the OC output #1
//to control a relay to turn a simple
//on/off spindle, on or off.
 
global SpindleOff = function()
{
    SpindleDevice.SetPinDig( 45, 0);
    //SpindleDevice.SetOC( MySpindleOutput, 0); //turn on spindle
    print("Relay Spindle was turned off");
    print("using OC #" + MySpindleOutput);
};  
 
//this is a relay spindle control, 
//it has no speed control but this dummy
//routine will stop any error, and maybe
//test for zero speed.
 
global SpindleSpeed = function( speed )
{
  //if an S000 is set, then turn the thing off
  if( speed == 0 )
  {
    SpindleDevice.SetPinDig( 45, 1);
    //SpindleDevice.SetOC( MySpindleOutput, 0); //turn on spindle
    print("Relay Spindle was turned off");
  };
 
};   
MaynardC
Old Timer
Posts: 35
Joined: Wed Feb 27, 2013 4:28 am

Re: getting the 57cnc to work with G540

Post by MaynardC »

Did you use the "Lib" dialog box to check the script back in with. If you check it out with the Lib, you need to check in back in with the "Lib" dialog. Same with the the debugger checkout.

Maynard
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4648
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: getting the 57cnc to work with G540

Post by ArtF »

Dan:

  You can check in a library only if its a complete library file, it must have the name header and such in it. So
create a new library first, then check it out. Modify it with your code, and then check it in .

  I cant find a message "no cntr Selected to update" in the program, can you check and see exactly what the message
is and Ill tell you why it occurs. It sounds as if your very close but are missing some syntax or routine, let
me know what youre getting and we'll trace it. Ill be away this morning, but this afternoon Ill write a description
of what may be happening..

Thx
Art


MaynardC
Old Timer
Posts: 35
Joined: Wed Feb 27, 2013 4:28 am

Re: getting the 57cnc to work with G540

Post by MaynardC »

It's what you get if you open a library in the scriptor, and try to check it back in via the check box on the scripting toolbar. :)





Attachments
Capture.PNG
Ya-Nvr-No
Old Timer
Posts: 188
Joined: Wed Sep 08, 2010 11:15 am

Re: getting the 57cnc to work with G540

Post by Ya-Nvr-No »

Yes I had noticed that too if I used one of the three buttons.
But the place to check them back in is under the Library button, same dialog screen you checked them out with.
Attachments
libfault.JPG
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4648
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: getting the 57cnc to work with G540

Post by ArtF »

Ahh yes, I see.

There are 2 classes of scripts. Screen Scripts, and Library scripts. You check in the library scripts by using the LIB
button only. Ill explain that better in a future video. :)

Art
DanL
Old Timer
Posts: 362
Joined: Wed Sep 10, 2014 1:35 pm

Re: getting the 57cnc to work with G540

Post by DanL »

that was the problem thank you gents, now to see if it works.
DanL
Old Timer
Posts: 362
Joined: Wed Sep 10, 2014 1:35 pm

Re: getting the 57cnc to work with G540

Post by DanL »

it's still not working it does not come up with any error.

Code: Select all

// Library SpindleLib-SuperPid 
// Created  Saturday, February 27, 2016 
// Author  Daniel       -- 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.   
 //                                              
  // ex: global mylibfunc = function(x,y,z);  
   
//for spindle ON/OFF 
global MySpindleOutput = 45;
global SpindleDevice = Motion();   
   
//this is a spindle control, 
//it will use only pin 45 output
//To turn A spindle on/off
 
global SpindleOn = function()
{
    SpindleDevice.SetPinDig(45,0);//turn on spindle
    print("Spindle was turned on" + MySpindleOutput);
};   
 
//this is a spindle control, 
//it will use only the output #45
//to control a on/off spindle.
 
global SpindleOff = function()
{
    SpindleDevice.SetPinDig( 45, 1); //turn on spindle
    print("Spindle was turned off");
    print("using pin 45" + MySpindleOutput);
};  
 
//this is a spindle control, 
//it has no speed control but this dummy
//routine will stop any error, and maybe
//test for zero speed.
 
//global SpindleSpeed = function( speed )
//{
  //if an S000 is set, then turn the thing off
 // if( speed == 0 )
 // {
   // SpindleDevice.SetPinDig( 45, 1);
    //SpindleDevice.SetOC( MySpindleOutput, 0); //turn on spindle
   // print("Spindle was turned off");
 // };
 
//};   
   
 
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4648
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: getting the 57cnc to work with G540

Post by ArtF »

Dan:

Does it say in the log and on the toolpath screen

"Spindle was Turned on"

and

"Spindle was turned off"  ??

  Lets go from there...

Art
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests