You are not logged in.
I need to be able to define a referenced variable in the .ctl file.
If it were in the NC code or a subroutine it would be
#(2000 + #4111)=5.0
I can't use a CallSubName or equivalent since CallSub type MACROS process at the end. I need to do it in sequence.
The following wont work since it makes a variable named #(2000+#4111).
VARIABLE "#(2000 + #4111)" {
OVERRIDE_VALUE 5
}
TIA
Offline
You don't have to define #(2000 + #4111) as a single word.
VERICUT will be able to process the value of 2000 added to the value of #4111 and it will become the variable name.
In a Fanuc control, I MDI:
#4111 = 5
#[2000 + #4111]=5.0
in the Variable panel, I get: #2005 = 5
Make sure you have the correct () or []
or that ( is defines as Left Precedence in the Word Format
Offline
MDI is not the answer. More explanation.
I need the function in the .ctl file, not the NC program or MDI.
Example. The NC Program has G43Z5.H5 one time and G43Z4.H6 the next and so on
Within the command sequence of processing the H word, Variable "4111" sets #4111 to 5 when H is 5.
Now I want to index to the correct Macro B variable based on the H word and set a value. In the case of H5 I need to set #10005 equal to a value, and with H6 #10006 equal and so on. H can be 1-999. Checking each condition of H to set the values is more code in the .ctl file than any of us want to maintain and debug.
The simplest way to do this is with a referenced #(10000 +#4111)= xxx
VARIABLE "10005" {OVERRIDE_EXP "#(11000 + #4111)} is a Valid .ctl file command.
What I need is the equivalent of
VARIABLE "(10000+ #4111)" {OVERRIDE_EXP xxxxxxx}
or
VARIABLE"(10000+ $)" {OVERRIDE_EXP xxxxxxx}
These Variable references for a name wont work currently in the .ctl file. VARIABLE only sees a string, not math, individual variables etc. in the name area.
Is there something that can be done within the .ctl file to set referenced or indexed variables, that processes in sequence, and with the commands for the H word. The CALLSUB utilities aren't effective since they process at the end of the commands, not in sequence.
Offline
ok, I got it.
under H *,
define a variable where the variable name is:
[$ + 10000]
The variable name expects a text string, to process the expression in a text field, surround the expression with [].
The $ represents the value defined with H.
So H5 will assign the variable #10005 (5+10000).
Offline
After Testing the following in .ctl file.
VARIABLE "[2001+ #4111]" {
OVERRIDE_EXP "5+3"
}
VARIABLE "[2002+ $]" {
OVERRIDE_EXP "5+4"
}
Do not make a 200x variable definition, they still make variables names [2001+ #4111] and [2002+ $] that show up in the variable list.
I don't think VARIABLE will take anything but the exact variable name currently.
Offline
Sorry, I used the Fanuc control that is already configured to process the variables in the 10000 series. So my test was tainted. :oops:
I am not exactly sure what is the final usage you want to do with this variable but here is something that might help:
Look in the Library Fanuc control, for H *
Macroname = AutosetToolLengthCompVars
Override Value = 10000
It reads the Tool Length Compensation and sets system variable values based on active values. This macro is passed the starting variable number.
For H42,
it will automatically create #10042 = active tool length
What do you want to achieve/check? there might be other ways to approach it.
Offline
I will submit an ER. Too long of an explanation for here.
Offline
Now I want to index to the correct Macro B variable based on the H word and set a value. In the case of H5 I need to set #10005 equal to a value, and with H6 #10006 equal and so on..
What is the value that you want to assign to #10005/#10006/etc...?
If it is to make sure that the T number and the H number are matching or correct, we implemented 2 new macros in 6.0 that could help you:
GageOffsetAttributes and GageOffsetDrivenPoint.
These macros work with Tool Library new ability to define multiple driven points for each tool.
With the macro GageOffsetAttributes, you can control how the tool offset is applied and what error message should be output if it is incorrect.
In Word/Address, select the macro and press F1 for detailled explanation.
just a last attempt ...
Offline
At the moment I'm looking into this exact problem and i don't see how to do it... I'm using 7.3.3, perhaps there is a new possibility now? a new macro to define variables names with other variable values?
Offline
7.3 this is no better. In fact it is worse. The workaround I had used since 2007 used AutosetTaleAxisVars to handle length and diacomp entries. Changes to AutosetTaleAxisVars in 7.3.x make it not wise to use as a workaround anymore.
Current enhancement request is for AutosetToolLengthCompVars and AutosetCutterCompVars to have the bidirectional variable capability and table range capabilities with subtables (wear vs geom) that AutosetTaleAxisVars does. Each pointing to their correct tables.
I have had to go backwards a little, using AutosetToolLengthCompVars and having a variable defined for EACH AND EVERY variable in the table. Essentially the following times 200. 10001, 10002 etc.
<Group Name="10001" Type="variable" Description="TL Value" Field="0">
<ConditionMacro>
<Macro Name="TableIndex" Scan="no" AfterMotion="no">
<Override Type="value" Value="1"/>
</Macro>
<Macro Name="TableValues" Scan="no" AfterMotion="no">
<Override Type="expression" Value="#10001"/>
</Macro>
<Macro Name="SetTableValues" Scan="no" AfterMotion="no">
<Override Type="text" Value="Tool Length Compensation"/>
</Macro>
</ConditionMacro>
</Group>
Offline
I am not certain if this is what you're looking for...
in your "H" register add...
SetGageOffsetVar
Text={10000+$}
This will take the H value, i.e. H6 and add 10000 to it to create a variable named 10006. When Vericut executes the SetGageOffsetVar command it will write the current tool offset into the new variable 10006.
Last edited by GregM (2015-05-14 15:57:45)
Offline