Hello Guest it is April 18, 2024, 01:15:04 PM

Author Topic: Using a Variable  (Read 9656 times)

0 Members and 1 Guest are viewing this topic.

Re: Using a Variable
« Reply #10 on: May 26, 2010, 01:27:38 PM »
Br549-

 I am starting to understanding of what I am trying to do.

I have a few questions:

1.  What is a Scam post?
2  What is a Macropump?

Is there are range of variables that I should use, or a range of variables I need to stay away from?

that is a good idea about pierce count.


thanks for all the help


Steve

about Scam post : in folder post in sheetcam ,there are many file that constructive Gcode with our custom settings.
about macropump: When we want something check constantly we can use this function.
**Even a clock that does not work is right twice a day**

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Using a Variable
« Reply #11 on: May 26, 2010, 04:12:07 PM »
The Scam(SheetCam) post is the part of Scam that actually writes the Gcode based on the drawing and other parameters. Less will handle the modifications of that part for you.

A Macropump is a piece of code that mach runs continuesly. I t can be used for uses such as this.

You can use any Gcode Var # and you will only use 1 AND you have to let LES know which one you choose.  I would use one in the range of 500-600 as those Vars are stored in MachsXML file when it shuts down and will always be there at startup. The other #Vars are not retained when Mach shuts down.

Also you can set the dro to be stored as well so you have double safe values on startup(;-)

Hope that helps, if not we will try again(;-)
Re: Using a Variable
« Reply #12 on: May 27, 2010, 12:08:04 AM »
BR549-

Thanks for the information.  It does not look like it should be that hard to accomplish what I am trying to do.  Now to find some extra time.  I don't think I am going to make it to the shop until this weekend.  Work has picked up, I guess that is a good thing.


Steve
Re: Using a Variable
« Reply #13 on: May 27, 2010, 04:41:12 PM »
i think this Thread is forgotten.
please describe a practical example.

Amir
**Even a clock that does not work is right twice a day**
Re: Using a Variable
« Reply #14 on: June 28, 2010, 12:37:51 PM »
OK-

I finally have time to work on this project again!!

Everything is kinda working, and I am trying to track down where the problem is.

The sheetcam POST has been modified so that it uses variable #500 to determine preheat time for the Oxy fuel torch.

The problem is that the only way I can change the variable is to edit the g-code. 

There is a line towards the top that sets the variable to what the tool setpoint is in sheetcam.

the line is

N********* P#500=20

so if i edit this line then I can change the preheat time through the g-code.

I tried to change the #500 variable using the MDI and it did not change anything.

I entered this in the MDI      VAR #500=10

the problem is that I am not sure if the variable changed.


So here is what I think I need for now

a small window that has the actual value of variable 500
and a up and a down arrow, that when clicked on will either add or subtract 1 sec to the variable #500
then display the new value of the Variable #500 in the window.


How would I go about this????


thanks for the help



Steve

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Using a Variable
« Reply #15 on: June 28, 2010, 07:32:36 PM »
from the MDI line type            #500=20       then press enter


To make it seemless you need to install a OEMDRO on the screen, then add an update button beside it.

Add code to the button to update the var based on the OemDro

SetVar(500,Getoemdro(*********))      where ********* is the OEMDRO# you used. This way whenever you want to update the preheat number just input the new value then press update.

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Using a Variable
« Reply #16 on: June 28, 2010, 08:12:58 PM »
OOPS message timed out,eating supper(;-)



Add an OemDro to the screen. Then add a Raise and Lower button to the side.


To the Macropump add the following code, This will update the OemDro with the Var500 value UNLESS it is a negative number then it sets Zero

If GetOemDro(***) < 0 Then SetOemDro(500,0)       ' Where *** is the OemDro Number
Else
SetOemdro(***,GetVar(500))
End If


Next add some button code to the up and down buttons

Up

SetVar(500,(GetVar(500)+1))

Down

SetVar(500,(Getvar(500) -1))



That should about do it, If you need more help just holler
Re: Using a Variable
« Reply #17 on: June 29, 2010, 12:08:38 AM »
BR549-

I will try that first thing in the morning.  It is too late to go to the shop tonight



Steve

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Using a Variable
« Reply #18 on: June 29, 2010, 08:59:36 PM »
Steve did you get your Scam post sorted out? I saw where you did not have the OnToolChange() included in the post so the Var value was never included in the output.
Re: Using a Variable
« Reply #19 on: June 29, 2010, 11:59:13 PM »
BR549-

My wife made me mow the fields.  :(  but there is always tomorrow :)

I should make it to the shop in the morning.  I should have 4-5 hours before I goto work, so I will let you know how it turns out.


Thanks again


Steve