Re: getting the 57cnc to work with G540
Re: getting the 57cnc to work with G540
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
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.
Re: getting the 57cnc to work with G540
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
thank you
Re: getting the 57cnc to work with G540
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
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");
};
}; Re: getting the 57cnc to work with G540
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
Maynard
Re: getting the 57cnc to work with G540
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
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
Re: getting the 57cnc to work with G540
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

- Posts: 185
- Joined: Tue Jan 06, 2026 4:56 pm
Re: getting the 57cnc to work with G540
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.
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.
Re: getting the 57cnc to work with G540
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
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
Re: getting the 57cnc to work with G540
that was the problem thank you gents, now to see if it works.
Re: getting the 57cnc to work with G540
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");
// };
//};
