RE: EMC Variable Programming



I'm not sure I completely understand this but I'll fool with it until I do.

I'll try my best to document it too.

Thanks.

Ethan


-----Original Message-----
From:	Ray [SMTP:rehenry-at-up.net]
Sent:	Thursday, September 06, 2001 11:59 AM
To:	Multiple recipients of list
Subject:	Re: EMC Variable Programming



Ethan

<hint>We never did write that page on computation and operators for the
programming section of the handbook.</hint>

I found just a little problem with line 6 in your part program.  To send
values to a function or operator like cos[] you need brackets enclosing
what you wish to send.  The cos#1002 should be cos[#1002].  A working line
might be

n60     G00 X[#1009*[cos[#1002]]] Z[#1009*[sin[#1002]]]

With that small revision, your program seems to work here.

Now to the question that you asked about parameters.  If you want a
parameter to be saved when the EMC quits you will need to place it in the
var file before you start the emc.  You can also add it during a session by
inserting it into the var file (menu view -> offsets and variables) make
your change and press the "Load Parameter File" button.  So along with 

> 1000 3.000
> 1001 0.020
> 1002 60
> 1003 125

add 

1009  0.0000

Now when the emc shuts down, you should have a value of

1009	1.510000

I tried, perhaps unsuccessfully to describe this difference as implicit vs
explicit variables in the handbook section on them.  You can use a variable
during a session by simply referring to it as you did in line 5.  If you
want to return to it in subsequent sessions you will need to add that var
number to the var file itself.

Furthermore, a variable's value will not be automatically updated in
the var file simply by referring to it in a part program.  The interpreter
does not work that way.  It would be possible to write a small Tcl/Tk script
that will read the var file when the program ends and update all of the
variables and load them into the interpreter.

HTH

Ray


On Thu, 06 Sep 2001, Ethan wrote:
> Good morning all.
> 
> Having a little trouble with variables.
> 
> First I went into the emc.var table and added parameters:
> 
> 1000 3.000
> 1001 0.020
> 1002 60
> 1003 125
> 
> Here is my program:
> 
> G18
> G20
> M3S1
> M8
> #1009 = [[#1000 + #1001]/2]
> G00X[#1009[cos#1002]]Z[#1009[sin#1002]]
> G00Z1.00
> M5
> M9
> M2
> 
> I ran the program numerous times and could not see the #1009 being updated 
> so I gave up. A while later I happened to look at the emc.var again and saw 
> the #1009, so it did update at some point.
> 
> I had the emc.var open as a text file. Is there a way to refresh the view a 
> la f5 in Windows? I kept closing and opening it to make sure what I was 
> seeing (or not seeing) was real.
> 
> What am I doing wrong? Is my syntax correct?
> 
> Thanks.
> 
> Ethan





Date Index | Thread Index | Back to archive index | Back to Mailing List Page

Problems or questions? Contact