How to update tool offsets from the program on a Siemens 840d

One of the things I like best about the Siemens controller for our Mori/DMG DMU50 (with Siemens 840D controller) is the ability to use some functions of the machine using a higher-level language (which I believe Siemens calls Structured Control Language – someone correct me!).

The 840 controller makes most of the information you could want to know about the state of the machine available through various data structures (and functions!) called machine data.

You can find more information through Siemen’s DOConWEB¬†website, where they list all of their manuals in searchable form. Don’t forget, you can search through multiple manuals at once (very useful!).

Now sometimes reading through Siemen’s manuals can test your sanity a little bit so I like to post little tips like this one.

I feel like I need a can of wine.

This sample program will update the tool offsets for the specified tool name. Feel free to fork or contribute to the Gist:

Update tool offsets:

; 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[<tool#>,<edge#>])
$TC_DP3[_tno, 1] = 123.; changes tool _tno edge 1 length offset
$TC_DP12[_tno, _dno] = -.9; changes tool _tno edge 1 length wear offset
MSG("offset: " << _val)

Leave a Reply

Your email address will not be published. Required fields are marked *