Call GCode from a shell Script
29 Sep 2019 13:47 #146561
by amiba
Call GCode from a shell Script was created by amiba
I am new here and interestet if it is possible to call GCode from a shell Script.
I think about two options. One is to use a M100-199 command to do something but in some situations the machine should do a lot more as the wished thing and it would be nice if this would be automated. Like that the script is doing a pre setup befor some other steps.
the other one is that for a security reason the system should so something automated and I would like to do it with some commands over the Network, but I don't know how to manage them to reach the machine as I do know how I may start a script but do not know how to move than the machine like I could do with GCode easy.
I think about two options. One is to use a M100-199 command to do something but in some situations the machine should do a lot more as the wished thing and it would be nice if this would be automated. Like that the script is doing a pre setup befor some other steps.
the other one is that for a security reason the system should so something automated and I would like to do it with some commands over the Network, but I don't know how to manage them to reach the machine as I do know how I may start a script but do not know how to move than the machine like I could do with GCode easy.
Please Log in or Create an account to join the conversation.
29 Sep 2019 13:52 #146563
by pl7i92
Replied by pl7i92 on topic Call GCode from a shell Script
hi
you can make your own HAL script with no GUI present
but this is not the way a CNC shoudt work
the USER needs somthing to interfear or see
what you try to do will get you in trouble and kill someone or at least the part
as a GUI is running Saying Axis
you can get the mashine moving on halcommand or a Button
even complex settings like ATC are working that way
you can make your own HAL script with no GUI present
but this is not the way a CNC shoudt work
the USER needs somthing to interfear or see
what you try to do will get you in trouble and kill someone or at least the part
as a GUI is running Saying Axis
you can get the mashine moving on halcommand or a Button
even complex settings like ATC are working that way
Please Log in or Create an account to join the conversation.
29 Sep 2019 14:25 #146574
by amiba
Replied by amiba on topic Call GCode from a shell Script
ok a quick function
M100 shall open the material holder and throw the material away.
That isn't a problem but if the machine is in a special position it is still not possible to throw it away, as the material will fall into the machine itself.
So the idea for example is that in this case it could only do nothing, what I get now working or more comfortable the machine drives the material to a place wher it is possible and does it.
So now I did not check how to move the machine with hal commands as I do not learn enough about it. For me would an example do it if I knew how to build the command to move one axis to a point x over hal commands I would use this way, as it doesn't matters how it works for me. I want only that it works proper and that there are no faults at all.
If it is possible to use Hal commands to move I would be able to create compensation of material size and be able to create commands that would be much more user friendly as only to move to a position. Because than it would be possible to create functions like to move an elyps or a circle or what ever with only giving one MXXX PX QX command.
But I do want to make it that the machine is working like it should so I am new I don't know how to manage some things as I got now all Motors well working and all switches working but now I want to complete that by user friendly functions. That work proper and save and maybe that does even something for savety - especially that it is safe and not the opposite way round. The command from far over network should make it possible to stop save. But in a way the machine is doing no harm to anybody and it self.
I got even all with a GCode working but I want to help someone to write more efficient GCode and that means I want to make functions that does there job well.
M100 shall open the material holder and throw the material away.
That isn't a problem but if the machine is in a special position it is still not possible to throw it away, as the material will fall into the machine itself.
So the idea for example is that in this case it could only do nothing, what I get now working or more comfortable the machine drives the material to a place wher it is possible and does it.
So now I did not check how to move the machine with hal commands as I do not learn enough about it. For me would an example do it if I knew how to build the command to move one axis to a point x over hal commands I would use this way, as it doesn't matters how it works for me. I want only that it works proper and that there are no faults at all.
If it is possible to use Hal commands to move I would be able to create compensation of material size and be able to create commands that would be much more user friendly as only to move to a position. Because than it would be possible to create functions like to move an elyps or a circle or what ever with only giving one MXXX PX QX command.
But I do want to make it that the machine is working like it should so I am new I don't know how to manage some things as I got now all Motors well working and all switches working but now I want to complete that by user friendly functions. That work proper and save and maybe that does even something for savety - especially that it is safe and not the opposite way round. The command from far over network should make it possible to stop save. But in a way the machine is doing no harm to anybody and it self.
I got even all with a GCode working but I want to help someone to write more efficient GCode and that means I want to make functions that does there job well.
Please Log in or Create an account to join the conversation.
29 Sep 2019 14:29 #146575
by pl7i92
Replied by pl7i92 on topic Call GCode from a shell Script
you know of the G30 /G31 positions to get paletts loaded = workpice thow off point
Please Log in or Create an account to join the conversation.
29 Sep 2019 14:37 #146576
by pl7i92
Replied by pl7i92 on topic Call GCode from a shell Script
like
(filename partoff.ngc)
o<partoff> sub
G30
m116 (open Clamp)
G4P2 (wait clamp open)
m118 (trow part out)
G4P1
M119 Hammer Back to
.....
o<partoff> endsub
M2
if you got a Input that sees the Opening or Closing you can do a M60 Manuell start or
a M66 autstart as the clamp loses
(filename partoff.ngc)
o<partoff> sub
G30
m116 (open Clamp)
G4P2 (wait clamp open)
m118 (trow part out)
G4P1
M119 Hammer Back to
.....
o<partoff> endsub
M2
if you got a Input that sees the Opening or Closing you can do a M60 Manuell start or
a M66 autstart as the clamp loses
Please Log in or Create an account to join the conversation.
29 Sep 2019 15:09 #146590
by amiba
Replied by amiba on topic Call GCode from a shell Script
I did not know but what is more worse I don't know how to make this code than to a short GCode Command that a user doesn't need to write that all himself.
Please Log in or Create an account to join the conversation.
03 Oct 2019 00:44 #146923
by andypugh
Replied by andypugh on topic Call GCode from a shell Script
Please Log in or Create an account to join the conversation.
03 Oct 2019 00:49 #146925
by andypugh
Replied by andypugh on topic Call GCode from a shell Script
Other things that might be useful:
linuxcnc.org/docs/2.7/html/config/ini-co....html#_halui_section
You can set up the system to run a line of G-code when a HAL pin changes state
That G-code line can be a subroutine call:
linuxcnc.org/docs/2.7/html/gcode/o-code.html#ocode:subroutines
G-code can have loops and conditional execution:
linuxcnc.org/docs/2.7/html/gcode/o-code.html#ocode:conditional
And G-code can read analogue and digital inputs from HAL and act on them:
linuxcnc.org/docs/2.7/html/gcode/m-code.html#mcode:m66
linuxcnc.org/docs/2.7/html/config/ini-co....html#_halui_section
You can set up the system to run a line of G-code when a HAL pin changes state
That G-code line can be a subroutine call:
linuxcnc.org/docs/2.7/html/gcode/o-code.html#ocode:subroutines
G-code can have loops and conditional execution:
linuxcnc.org/docs/2.7/html/gcode/o-code.html#ocode:conditional
And G-code can read analogue and digital inputs from HAL and act on them:
linuxcnc.org/docs/2.7/html/gcode/m-code.html#mcode:m66
Please Log in or Create an account to join the conversation.
Time to create page: 0.404 seconds