VERICUT Users' Forum

Due to relentless spammers, we are no longer automatically accepting new forum registrations. If you wish to register for this forum, please send an e-mail to: info@cgtech.com

You are not logged in.

#1 2007-08-10 21:28:01

vhubbard
Beta User
From: Dallas, TX
Registered: 2004-11-11
Posts: 222
Website

Defining a referenced variable in the control.

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

#2 2007-08-13 15:57:26

SergeV
Senior Member
From: Irvine, CA
Registered: 2004-10-08
Posts: 507
Website

Re: Defining a referenced variable in the control.

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

#3 2007-08-13 16:36:38

vhubbard
Beta User
From: Dallas, TX
Registered: 2004-11-11
Posts: 222
Website

Re: Defining a referenced variable in the control.

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

#4 2007-08-13 17:03:05

SergeV
Senior Member
From: Irvine, CA
Registered: 2004-10-08
Posts: 507
Website

Re: Defining a referenced variable in the control.

ok, I got it. big_smile

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

#5 2007-08-13 17:49:16

vhubbard
Beta User
From: Dallas, TX
Registered: 2004-11-11
Posts: 222
Website

Re: Defining a referenced variable in the control.

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

#6 2007-08-13 18:23:20

SergeV
Senior Member
From: Irvine, CA
Registered: 2004-10-08
Posts: 507
Website

Re: Defining a referenced variable in the control.

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

#7 2007-08-13 21:01:54

vhubbard
Beta User
From: Dallas, TX
Registered: 2004-11-11
Posts: 222
Website

Re: Defining a referenced variable in the control.

I will submit an ER.  Too long of an explanation for here.

Offline

#8 2007-08-13 21:22:46

SergeV
Senior Member
From: Irvine, CA
Registered: 2004-10-08
Posts: 507
Website

Re: Defining a referenced variable in the control.

vhubbard wrote:

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

#9 2014-12-17 16:49:22

anorec
Member
Registered: 2014-12-16
Posts: 18

Re: Defining a referenced variable in the control.

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

#10 2015-01-05 16:17:01

vhubbard
Beta User
From: Dallas, TX
Registered: 2004-11-11
Posts: 222
Website

Re: Defining a referenced variable in the control.

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

#11 2015-05-14 15:54:40

GregM
Member
From: Dallas/FtWorth, Texas
Registered: 2005-08-25
Posts: 19

Re: Defining a referenced variable in the control.

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

Board footer