On a SINUMERIK 840D sl Operate system, read $TC_MAP8[n] when the macro needs the magazine's current position relative to the change position. Do not derive that state from $A_MYMLN[$P_TOOLNO]: that expression depends on the active tool and fails when T0 is active. Set n to the applicable magazine number.
Symptom interpretation
The reported application is a macro on a CTX 510 eco, not an operator request to display the pocket table. That distinction determines which data is needed. A table can show magazine assignments, but a macro requires a readable system variable with semantics that match the control decision.
The term current magazine position here means the magazine's position relative to its change position. It does not mean the pocket containing the active tool, the pocket containing a named tool, or the active tool number. Those values may coincide during part of a tool-change sequence, but they describe different states.
| Macro question | Data path | Primary dependency | Behavior with T0
|
|---|---|---|---|
| Where is the magazine relative to its change position? | $TC_MAP8[n] |
Magazine number n
|
Does not require an active tool-number lookup |
| Which magazine location is associated with the active tool? | $A_MYMLN[$P_TOOLNO] |
Valid active tool reference | Reported not to work when T0 is active |
| Where is a particular named tool stored? | Search the magazine by tool designation and return its location | Tool designation and magazine assignment | Independent of the active tool only when the search key is supplied separately |
Magazine-position mechanism
$TC_MAP8[n] is indexed by magazine number. The documented meaning is the current magazine position referenced to the change position, with n identifying magazine numbers beginning at 1. This makes the variable suitable for a macro that must evaluate magazine orientation even when no cutting tool is active.
$A_MYMLN[$P_TOOLNO] follows a different chain. The macro first reads the active tool through $P_TOOLNO, then uses that result to request a magazine-related location. When T0 is active, there is no active cutting-tool reference from which that lookup can obtain the required location. The failed result is therefore a data-model mismatch, not proof that the magazine position is unavailable.
A tool search is also different from a position read. Searching by tool designation answers which assigned pocket contains that tool. Reading $TC_MAP8[n] answers where the indexed magazine currently stands relative to the exchange location. Choose the expression from the state the macro actually needs.
Diagnostic checks
-
Classify the requested value. Decide whether the macro needs magazine orientation, a tool's assigned pocket, or the active tool's magazine location. For turret or magazine orientation, expect the requirement to remain valid while
T0is active. -
Identify the magazine index. Read the machine's tool-management configuration and determine which magazine number represents the turret or magazine being monitored. Expect a configured index beginning at
1; do not substitute a pocket number forn. -
Observe the existing expression with a tool active. Record
$P_TOOLNOand the result of$A_MYMLN[$P_TOOLNO]. Expect the result to follow the active-tool lookup rather than directly report independent magazine motion. -
Repeat with
T0active. Expect the tool-dependent expression to stop providing the needed position, matching the reported failure mode. This check isolates the active-tool dependency. -
Monitor
$TC_MAP8[n]. Read the correct magazine element before and after a commanded magazine movement performed through the normal machine sequence. Expect a stable value while stationary and a position-related change after the magazine reaches another indexed state.
If the reading does not change, first test the selected magazine index. A constant value from the wrong magazine element can look like a bad variable. If the value changes but does not equal the pocket label expected by the macro, treat it according to its documented reference-to-change-position meaning rather than relabeling it as an absolute pocket number.
Macro procedure
- Define the macro requirement as “current position of magazine
nrelative to the change position.” If the actual requirement is to find a named tool, use a tool-designation search instead. - Obtain the correct magazine number from the machine's tool-management configuration. On machines with more than one magazine, keep this selection explicit rather than assuming the first element.
- Replace the position decision based on
$A_MYMLN[$P_TOOLNO]with a read of$TC_MAP8[n]. The core expression is$TC_MAP8[n]; substitute only the verified magazine number forn. - Keep active-tool logic separate. Use
$P_TOOLNOonly in branches that genuinely need the active tool. Do not make magazine-position validity conditional on a non-T0tool state. - Compare the returned value only with positions defined by the machine's magazine configuration and macro design. Read the Tool Management manual's magazine-description data in section
5.4.2before assigning physical pocket labels or motion meaning to particular returned values. - Review the related empty-location search strategy in section
3.5.2and distance-to-change-position information in section5.4.7if the macro also selects empty pockets or evaluates exchange proximity.
Keep the position read, tool search, and tool assignment as separate operations. Combining them into one implicit lookup recreates the T0 dependency and makes fault isolation harder.
Verification sequence
-
Check 1: Known stationary position. Stop at a normally indexed magazine position and read
$TC_MAP8[n]. Expect the value to remain unchanged across repeated macro evaluations. - Check 2: Controlled index movement. Move the magazine through the machine's normal control sequence to another known position, then read the variable again. Expect the returned position to change in accordance with the configured magazine description.
-
Check 3: Active-tool independence. Repeat the read once with a valid tool active and once with
T0active. Expect$TC_MAP8[n]to continue reporting magazine position in both states. -
Check 4: Index discrimination. Where multiple magazines are configured, read each applicable
$TC_MAP8[n]element while moving only the target magazine. Expect the selected element to track the target and unrelated elements not to imitate that movement. -
Check 5: Macro decision. Exercise every branch that uses the returned position, including the
T0path. Expect identical position decisions for the same physical magazine state regardless of which tool is active.
Recurring implementation pitfalls
The most common error is treating active-tool location as magazine position. $A_MYMLN[$P_TOOLNO] may appear adequate while production tools are active, then fail during startup, recovery, unloading, or another state that activates T0.
A second error is confusing a relative magazine position with an absolute pocket label. The reference point is the change position. Interpret returned values through the configured magazine-description data; otherwise an apparently plausible comparison can select the wrong macro branch.
A third error is using the wrong index domain. In $TC_MAP8[n], n is the magazine number, beginning at 1, not a tool number or pocket number. Hard-coding an unverified index is particularly hazardous on configurations containing more than one magazine.
Finally, do not use a magazine-position read to locate a named tool. Search the magazine by tool designation when the requirement is tool location. A positional variable and a tool-assignment search solve separate problems and should remain separate in the macro.
Frequently asked questions
Can I read the current SINUMERIK magazine position with T0 active?
Yes. Read $TC_MAP8[n] with n set to the configured magazine number; the lookup does not depend on $P_TOOLNO.
Does $A_MYMLN[$P_TOOLNO] return the turret position?
It follows the active-tool lookup and was reported to fail when T0 is active. Use it only when the macro requires a location associated with a valid active tool, not independent magazine orientation.
Can I use $TC_MAP8[n] to find a tool by name?
No. Search the magazine by tool designation when the target is a particular tool; $TC_MAP8[n] reports the indexed magazine's current position relative to the change position.
Does the $TC_MAP8 index identify a turret pocket?
No. The index n identifies the magazine number, beginning at 1. As the final verification, index the target magazine through its normal sequence and expect only the correctly selected $TC_MAP8[n] element to track its position change.