Auto Start Vacuum
- toddgrundman
- Offline
- New Member
-
Less
More
- Posts: 8
- Thank you received: 0
21 Dec 2016 16:19 #84496
by toddgrundman
Auto Start Vacuum was created by toddgrundman
I have been using makercam.com for some simple gcode generating. I have not found a way to have it insert an M8 into the beginning of the code to turn on the vacuum table.
So, I am looking for some help on writing a script to insert M8 using the FILTERS, or just a way to have the vacuum start with every job that LinuxCNC runs.
Thanks for any help you can provide!
So, I am looking for some help on writing a script to insert M8 using the FILTERS, or just a way to have the vacuum start with every job that LinuxCNC runs.
Thanks for any help you can provide!
Please Log in or Create an account to join the conversation.
- Todd Zuercher
-
- Away
- Platinum Member
-
Less
More
- Posts: 5000
- Thank you received: 1414
21 Dec 2016 17:58 - 21 Dec 2016 18:03 #84507
by Todd Zuercher
Replied by Todd Zuercher on topic Auto Start Vacuum
I have a simple script filter that I use on some machines to insert the pre/post-ambles to allow some generic g-code to work on several machines.
The echo lines will be inserted at the beginning and end.Just save the script as something.sh (like pre-post.sh), move it someplace such as your config dir. Change the files permission to make it executable. Then in your ini file under the [FILTER] section add the line ngc = /(path to file loacation)/something.sh
You can also do find and replaces and what ever else you can dream up. A script that just finds one line that you always have at the beginning of the file and adds your M8 code might be even simpler (just a single sed line.)
The echo lines will be inserted at the beginning and end.
#!/bin/bash
echo "%"
echo "G92.1 G54 G49 G17"
echo "M111"
echo "G53 G0 Z0"
echo "G90"
echo "G64 P0.005"
echo "F80"
echo "M3 S18000"
echo
# The main part
sed -n 'p' "$1"
echo
echo "G0 Z1"
echo "M123"
echo "G53 G0 Z0 W0"
echo "G53 G0 X0 Y65"
echo "G49 G92.1"
echo "M5"
echo "M30"
echo "%"
You can also do find and replaces and what ever else you can dream up. A script that just finds one line that you always have at the beginning of the file and adds your M8 code might be even simpler (just a single sed line.)
Last edit: 21 Dec 2016 18:03 by Todd Zuercher.
Please Log in or Create an account to join the conversation.
- toddgrundman
- Offline
- New Member
-
Less
More
- Posts: 8
- Thank you received: 0
21 Dec 2016 20:23 #84518
by toddgrundman
Replied by toddgrundman on topic Auto Start Vacuum
Thanks. That does exactly what I needed.
Please Log in or Create an account to join the conversation.
22 Dec 2016 10:47 #84547
by andypugh
Replied by andypugh on topic Auto Start Vacuum
You could probably simply wire the vacuum relay control to a HAL pin. For example halui.program.is-running goes true when a program is running.
Please Log in or Create an account to join the conversation.
Time to create page: 0.074 seconds