Skip to content

Instantly share code, notes, and snippets.

@themachinist
Last active April 4, 2016 18:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save themachinist/4d954b6d1c9f0531687d to your computer and use it in GitHub Desktop.
Save themachinist/4d954b6d1c9f0531687d to your computer and use it in GitHub Desktop.
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]
; ($TC_DP<n>[<tool#>,<edge#>])
$TC_DP3[_tno, 1] = 123.; changes tool _tno edge 1 length offset
$TC_DP12[_tno, 1] = -.9; changes tool _tno edge 1 length wear offset
MSG("offset: " << _val)
M00
@fieldsjj
Copy link

fieldsjj commented Apr 4, 2016

I had to determine the tool in the spindle with a customized Siemens 840d and discovered the GETT or GET T command. in this machine, tool labels were just integers and I didn't realize they are simply labels. Siemens help line was not helpful becausethey do not think like Fanuc or other controls. it is one of many things that could be made clearer.. the quotations in your example are required it is a label or string. oddly enough when you create a string variable you don't use quotes, only when you write

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment