Fanuc 31i Spindle Tool Number Macro

Started by JakeL, March 17, 2025, 08:28 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JakeL

While I go searching through the manuals I figured I'd throw this question here.

I have an application where I need to access the number of the tool currently in the spindle. I'm hoping there's a macro that holds this information so it's easily accessible? If so, does anyone happen to know the macro number?

I'm on a Matsuura H.Plus-630, Fanuc 31i control. TIA for any help!

Brad St

Don't quote me but is #544 hold the value for the current tool # in the spindle?

JakeL

#2
Quote from: Brad St on March 17, 2025, 09:22 AMDon't quote me but is #544 hold the value for the current tool # in the spindle?

Doesn't look like it. Currently #544 = .024... However, #517 / #518 have the correct number in them, but not sure if that is just coincidence, more investigation needed.

I was originally looking for a system variable, I hadn't considered that the number could be held in a 500 variable.

I did find #4120, but this gives the modal T code. So if we prestage a tool, #4120 = the prestage tool number which is not desired.

Thanks for the reply!
Like Like x 1 View List

CNCAppsJames

Quote from: JakeL on March 17, 2025, 08:28 AM... I need to access the number of the tool currently in the spindle.
...
I'm on a Matsuura H.Plus-630, Fanuc 31i control. TIA for any help!
There's two possibilities. If the H/D are the same as the T then #517 and #518 hold this info... in Matsuura Machine Tools Only. If the tool in the spindle is using tool life management and it's not the 1st tool in the group, then #4120 (System Variable) holds the "T... HOWEVER... You MUST grab #4120 IMMEDIATELY after the M06 (usually in O9001 in SYSTEM). That variable will change when you stage the next tool.
Like Like x 1 Thank  You Thank You x 1 View List
"That bill for your 80's experience...yeah, it's coming due. Soon." Author Unknown

Inventor Pro 2026 - CAD
CAMplete TruePath 2026 - CAV and Post Processing
Fusion360 and Mastercam 2026 - CAM

JakeL

Quote from: CNCAppsJames on March 17, 2025, 12:42 PMThere's two possibilities. If the H/D are the same as the T then #517 and #518 hold this info... in Matsuura Machine Tools Only. If the tool in the spindle is using tool life management and it's not the 1st tool in the group, then #4120 (System Variable) holds the "T... HOWEVER... You MUST grab #4120 IMMEDIATELY after the M06 (usually in O9001 in SYSTEM). That variable will change when you stage the next tool.

#517 it is, thanks James!

Is the spindle tool number just not stored anywhere easily accessible? Seems like if #517=H and #518=D then why wouldn't they make #516=T?

Anyway I digress, thanks again!

CNCAppsJames

#5
Quote from: JakeL on March 17, 2025, 01:20 PM#517 it is, thanks James!

Is the spindle tool number just not stored anywhere easily accessible? Seems like if #517=H and #518=D then why wouldn't they make #516=T?

Anyway I digress, thanks again!

On Matsuura;
#514 = Pallet In Machine (Selway Default - Machine MUST support function, also must activate K48.0 = 1, must set D12420 = 514)
#515 = Speed Assigned in Tool Manager
#516 = Feed Assigned in Tool Manager
#517 = H Number Assigned in Tool Manager
#518 = H Number Assigned in Tool Manager
#519-#53x = Renishaw Tool Measurement Stuff

Oh, also, Active T = #4320 (or [#_ACTT] if you like names).

Hope that explains it.
Like Like x 1 Thank  You Thank You x 1 View List
"That bill for your 80's experience...yeah, it's coming due. Soon." Author Unknown

Inventor Pro 2026 - CAD
CAMplete TruePath 2026 - CAV and Post Processing
Fusion360 and Mastercam 2026 - CAM

MIL-TFP-41

From Fanuc's manual:

The current tool number is stored in system variable #3939.
The tool No. after tool change is stored from the block after the tool change command. This system
variable is read-only.

System variable No. System variable name Attribute Description
#3939 [#_ATCTOOL] R Current tool number


I have only seen this work on our newest Robodrill. Tho where they named it a system variable I have a feeling we will see it on all of their controls in the future. Hopefully anyways. Would open up possibilities for simplification across different machine tool builders using the same controller.

CNCAppsJames

I wonder if [#_ATCTOOL] is specific to RoboDrill? I'm not finding that variable in B-64724EN/01.
"That bill for your 80's experience...yeah, it's coming due. Soon." Author Unknown

Inventor Pro 2026 - CAD
CAMplete TruePath 2026 - CAV and Post Processing
Fusion360 and Mastercam 2026 - CAM

MIL-TFP-41

Quote from: CNCAppsJames on March 19, 2025, 12:09 PMI wonder if [#_ATCTOOL] is specific to RoboDrill? I'm not finding that variable in B-64724EN/01.

Possibly. Tho on a Robodrill prestaging tools isn't a thing, so #4120 is fair game anywhere. The [#_ATCTOOL] is me just having wishful thinking using that across multiple MTB's.
Like Like x 1 View List