Skip to content

Instantly share code, notes, and snippets.

@themachinist
themachinist / gist:8402c14b117fceffec2f
Created October 3, 2015 17:48 — forked from a1phanumeric/gist:5346170
Grep exclusions. Demonstrates how to exclude multiple directories, and files.
grep -r --color --exclude-dir={custom,lib,scripts} --exclude={*.xml,error_log} "beta" .
@themachinist
themachinist / shift_tool_offset.mpf
Last active April 4, 2016 18:11
Siemens 840d Modify tool offset from NC program
; Programmatically shift tool offsets from NC program
; Siemens 840d (Tested on DMU50)
DEF INT _tno
DEF INT _dno
DEF REAL _val
_tno = GETT("CUTTER 16", 1)
_dno = GETDNO(_tno, 1) ; (not necessary)
_val = $TC_DP12[_tno,1]
@themachinist
themachinist / setup_tools.mpf
Last active December 11, 2023 10:28
Siemens 840d Automated Tool Length Setting
; Automated tool length measurement
; Siemens 840d (Tested on DMU50)
; This program will call every tool into the main spindle and run a blum
; laser measuring cycle designed to record the tool length offset of the tool
; I've included citations of the manual pages I referenced to find the pieces
; of data used in the program
; See the manual SINUMERIK 840D sl / 828D Job Planning for information on the
; high-level nc language