Instantly share code, notes, and snippets.

What would you like to do?
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
_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)

This comment has been minimized.

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