Triggering external program upon g code command
30 Dec 2013 03:54 #42175
by maxthekat
Triggering external program upon g code command was created by maxthekat
Hello,
If this is in the wrong forum, please let me know which is correct. This is my first post-- yay!-- on linuxcnc
I'd like to kick off an external program when I encounter a tool change code in LinuxCNC. Is it possible to do this? If so, where can I look for the documentation and/or examples?
Here's why I'd like to do this:
My CNC is setup in the garage, and it's a bit of a PITA to go check on it constantly. I don't have the machine networked into my wifi or wired networks, and I'd like to keep it that way. So, I'm going to take a couple of Arduinos with XBee radio transmitters. One setup will be hooked up to the CNC, the other to a "remote" I keep around the house. When the gcode tool change command is reached, it will trigger a program, which will use the setup to send a signal to my "remote", which will ding, light up, or shock me to let me know I need to waddle down to the machine and change its tool
Thanks!
Max
If this is in the wrong forum, please let me know which is correct. This is my first post-- yay!-- on linuxcnc
I'd like to kick off an external program when I encounter a tool change code in LinuxCNC. Is it possible to do this? If so, where can I look for the documentation and/or examples?
Here's why I'd like to do this:
My CNC is setup in the garage, and it's a bit of a PITA to go check on it constantly. I don't have the machine networked into my wifi or wired networks, and I'd like to keep it that way. So, I'm going to take a couple of Arduinos with XBee radio transmitters. One setup will be hooked up to the CNC, the other to a "remote" I keep around the house. When the gcode tool change command is reached, it will trigger a program, which will use the setup to send a signal to my "remote", which will ding, light up, or shock me to let me know I need to waddle down to the machine and change its tool
Thanks!
Max
Please Log in or Create an account to join the conversation.
30 Dec 2013 04:13 #42176
by BigJohnT
Replied by BigJohnT on topic Triggering external program upon g code command
I did move this to G code... seemed to fit better here.
You can do this several ways.
Use a digital output pin with the manual tool change. www.linuxcnc.org/docs/html/gcode/m-code.html#sec:M62-M65
Use Classicladder to control the manual tool change. gnipsel.com/files/linuxcnc/configs/cl-turret-sim.zip
Use M1xx. www.linuxcnc.org/docs/html/gcode/m-code.html#sec:M100-to-M199
The digital output pin would be the easiest to set up and use.
JT
You can do this several ways.
Use a digital output pin with the manual tool change. www.linuxcnc.org/docs/html/gcode/m-code.html#sec:M62-M65
Use Classicladder to control the manual tool change. gnipsel.com/files/linuxcnc/configs/cl-turret-sim.zip
Use M1xx. www.linuxcnc.org/docs/html/gcode/m-code.html#sec:M100-to-M199
The digital output pin would be the easiest to set up and use.
JT
Please Log in or Create an account to join the conversation.
17 Jan 2014 04:40 #42891
by clunc
Replied by clunc on topic Triggering external program upon g code command
Here's the necessary G-code reference: I didn't use any.
I rigged up a cheapo webcam so I could look in on mine down in the basement. (I happened to have run network down, but I could have used a wireless adapter too.)
After much tweaking, I found out that I still have to phone home to get someone to go back down there and turn the light back on, and then they might as well just look at the machine and tell me how far it's gotten...
I rigged up a cheapo webcam so I could look in on mine down in the basement. (I happened to have run network down, but I could have used a wireless adapter too.)
After much tweaking, I found out that I still have to phone home to get someone to go back down there and turn the light back on, and then they might as well just look at the machine and tell me how far it's gotten...
Please Log in or Create an account to join the conversation.
17 Jan 2014 21:12 #42915
by andypugh
Replied by andypugh on topic Triggering external program upon g code command
No need for webcams, just use desktop sharing.
As a bonus you can (probably) VNC into your LinuxCNC machine from your smartphone
(but not in the case of the original poster who seems to have chosen to limit his choices by not networking the CNC machine)
I am amused by the idea I just had of having a cheap mobile phone taped to the milling machine bed with a quick-dial button that the milling tool can prod when a toolchange is needed
As a bonus you can (probably) VNC into your LinuxCNC machine from your smartphone
(but not in the case of the original poster who seems to have chosen to limit his choices by not networking the CNC machine)
I am amused by the idea I just had of having a cheap mobile phone taped to the milling machine bed with a quick-dial button that the milling tool can prod when a toolchange is needed
Please Log in or Create an account to join the conversation.
17 Jan 2014 23:42 #42926
by maxthekat
Replied by maxthekat on topic Triggering external program upon g code command
I realize LinuxCNC is a real time OS (RTOS), but couldn't running a program such as VNC cause problems with the milling job? If the process running it has issues, is it possible that the LinuxCNC stepper controllers might get pre-empted in the scheduler, causing the motors to behave incorrectly?
Or, can we run a billion other processes and still be fine simply because it is a RTOS?
Or, can we run a billion other processes and still be fine simply because it is a RTOS?
Please Log in or Create an account to join the conversation.
Time to create page: 0.070 seconds