Re: getting the 57cnc to work with G540

Discussions and file drops for Auggie
GlennD
Site Admin
Posts: 80
Joined: Wed Oct 19, 2011 3:19 am

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
You do not have the required permissions to view the files attached to this post.
DanL
Site Admin
Posts: 357
Joined: Thu Sep 11, 2014 12:35 am

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
Site Admin
Posts: 357
Joined: Thu Sep 11, 2014 12:35 am

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
Site Admin
Posts: 35
Joined: Wed Feb 27, 2013 3:28 pm

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
ArtF
Global Moderator
Global Moderator
Posts: 4557
Joined: Sun Sep 05, 2010 5:14 pm
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
Site Admin
Posts: 35
Joined: Wed Feb 27, 2013 3:28 pm

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. :)





You do not have the required permissions to view the files attached to this post.
Amazon [Bot]
Full Member
Full Member
Posts: 185
Joined: Tue Jan 06, 2026 4:56 pm

Re: getting the 57cnc to work with G540

Post by Amazon [Bot] »

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.
You do not have the required permissions to view the files attached to this post.
ArtF
Global Moderator
Global Moderator
Posts: 4557
Joined: Sun Sep 05, 2010 5:14 pm
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
Site Admin
Posts: 357
Joined: Thu Sep 11, 2014 12:35 am

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
Site Admin
Posts: 357
Joined: Thu Sep 11, 2014 12:35 am

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");
 // };
 
//};   
   
 
Post Reply