@@ -204,29 +204,40 @@ The io program provides HAL output pins to facilitate toolchanger management:
204204. *iocontrol.0.tool-prep-number*
205205. *iocontrol.0.tool-prep-index*
206206. *iocontrol.0.tool-prep-pocket*
207+ . *iocontrol.0.tool-from-pocket*
207208
208209==== IO for non-random toolchanger
209210
210211. Tool number n==0 indicates no tool
211- . The pocket number for a tool is fixed when tooldata is loaded
212+ . The pocket number for a tool is set when tooldata is loaded/reloaded
213+ from its data source ([EMCIO]TOOL_TABLE or [EMCIO]DB_PROGRAM).
212214. At G-code *Tn* (n != 0) command:
213215.. *iocontrol.0.tool-prep-index* = idx (index based on tooldata load sequence)
214216.. *iocontrol.0.tool-prep-number* = n
215- .. *iocontrol.0.tool-prep-pocket* = the fixed pocketno for n
217+ .. *iocontrol.0.tool-prep-pocket* = the pocketno for n
216218. At G-code *T0* (n == 0 remove) command:
217219.. *iocontrol.0.tool-prep-index* = 0
218220.. *iocontrol.0.tool-prep-number* = 0
219221.. *iocontrol.0.tool-prep-pocket* = 0
222+ . At M-code *M6* (following iocontrol.0.tool-changed pin 0-->1):
223+ .. *iocontrol.0.tool-from-pocket* = pocket number used to retrieve tool
220224
221225==== IO for random toolchanger
222226
223227. Tool number n==0 is *not special*.
224228. Pocket number 0 is *special* as it indicates the *spindle*.
225229. The *current* pocket number for tool N is the tooldata index (idx) for tool n.
226230. At G-code command *Tn*:
227- .. *iocontrol.0.tool-prep-index* = pocket number for tool n
231+ .. *iocontrol.0.tool-prep-index* = tooldata index (idx) for tool n
228232.. *iocontrol.0.tool-prep-number* = n
229233.. *iocontrol.0.tool-prep-pocket* = pocket number for tool n
234+ . At M-code *M6* (following iocontrol.0.tool-changed pin 0-->1):
235+ .. *iocontrol.0.tool-from-pocket* = pocket number used to retrieve tool
236+
237+ [NOTE]
238+ At startup, *iocontrol.0.tool-from-pocket* = 0.
239+ An M61Qn (n!=0) command does not change the *iocontrol.0.tool-from-pocket*.
240+ An M61Qn (n==0) command sets *iocontrol.0.tool-from-pocket* to 0.
230241
231242[[sub:tool-changers]]
232243=== Tool Changers(((Tool Changers)))
@@ -248,21 +259,33 @@ with INI statements:
248259HALFILE = axis_manualtoolchange.hal
249260----
250261
251- .Fixed Location Tool Changers
262+ .Fixed Location Tool Changers
252263Fixed location tool changers always return the tools to a
253264fixed position in the tool changer. This would also include
254265designs like lathe turrets. When LinuxCNC is configured for a fixed
255266location tool changer the 'P' number is not used internally (but read, preserved
256267and rewritten) by LinuxCNC, so you can use P for any bookkeeping number you
257268want.
258269
270+ [NOTE]
271+ When using [EMCIO]RANDOM_TOOLCHANGER = 0 (the default), the 'P'
272+ pocket number is a parameter of the tooldata that is retrieved from
273+ the tooldata source ([EMCIO]TOOL_TABLE or [EMCIO]DB_PROGRAM). In many
274+ applications it is fixed but it may be changed by edits to the
275+ [EMCIO]TOOL_TABLE or programatically when the [EMCIO]DB_PROGRAM is
276+ used. LinuxCNC pushes updates to the data source ([EMCIO]TOOL_TABLE
277+ or [EMCIO]DB_PROGRAM) for gcodes G10L1,G10L10,G10L11,M61. LinuxCNC
278+ can pull tooldata updates from the data source by UI (user-interface)
279+ commands (python example: linuxcnc.command().load_tool_table()) or by
280+ the gcode: G10L0.
281+
259282.Random Location Tool Changers
260- Random location tool changers swap the tool in the spindle with the
261- one in the changer. With this type of tool changer the tool will
262- always be in a different pocket after a tool change. When a tool is
263- changed LinuxCNC rewrites the pocket number to keep track of where the tools
264- are. T can be any number but P must be a number that makes sense for
265- the machine.
283+ Random location tool changers ([EMCIO]RANDOM_TOOLCHANGER = 1) swap the
284+ tool in the spindle with the one in the changer. With this type of
285+ tool changer the tool will always be in a different pocket after a
286+ tool change. When a tool is changed LinuxCNC rewrites the pocket
287+ number to keep track of where the tools are. T can be any number but P
288+ must be a number that makes sense for the machine.
266289
267290
268291== Tool Length Compensation(((Tool Length Compensation)))
0 commit comments