Hello Guest it is March 28, 2024, 04:32:25 PM

Author Topic: Using a Variable  (Read 9627 times)

0 Members and 1 Guest are viewing this topic.

Using a Variable
« on: May 24, 2010, 11:25:11 AM »
Hi everyone-

Now that I have the M code problems figured out (for now), time for a new twist.

I talked to LES at sheetcam, and he said what I am wanting to do is possible on the sheetcam end, now to figure out if Mach can do it.


Since I am using an Oxy/ propane torch, when  have multiple cuts on a sheet, or the cuts are close together, then I am needing a way to change the pre heat time.

Les Said that he can have sheetcam insert a varable into the G-code, so how could I change this on the fly?


If you need more information, let me know




Steve

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Using a Variable
« Reply #1 on: May 25, 2010, 12:05:33 PM »
There are several ways.

1. Simply type in the VAR and value at the MDI line    #1000=25  would set the #1000 var to 25

2. Set up a DRO on the main screen then ADD code to your macropump to update the VAR based on the DRO value
    
     SetVar(1000,GetOemDro(500))     That would set the GcodeVar #1000 to equal the OemDro#500

In either case you would HAVE to set the NEW VAR before the code ran that would use it otherwise nothing would change in the actual program

Hope that helps


**********NOTE:
I just saw you post on Scam. POST vars and Gcode Vars are two different critter and not interchangable.

SO you need to let me know WHICH approach you intend to use.
« Last Edit: May 25, 2010, 12:22:07 PM by BR549 »
Re: Using a Variable
« Reply #2 on: May 25, 2010, 01:34:31 PM »
BR549-

I would think that the second option would be the best.

When I talked to Less at Sheetcam, he said that the sheetcam portion would be easy.  He just could not remember how to make the changes in Mach.

For me this is the sequence that would work the best for me.

1.  run sheetcam the same as always.  Sheetcam loads the tool preheat settings into a variable
2.  If the DRO is not changed, then Mach loads the default variable into the g-code and the cut sequence runs the same as always
3.  If I choose to adjust the DRO (increase or decrease timer) then MACH loads this new variable into the next cut sequence
4  If the DRO is not changed, then the variable is loaded into the next cut sequence
5  this repeats thoughout the program


IS that clear as mud???


What do you think?


Steve
Re: Using a Variable
« Reply #3 on: May 25, 2010, 01:49:41 PM »
what version of MACH are you running?
**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 #4 on: May 25, 2010, 06:11:40 PM »
Perfectly clear(;-)  That should work well.

Re: Using a Variable
« Reply #5 on: May 26, 2010, 02:56:22 AM »
hi Steve
is it possible you more explain about this issue?
How should defined these steps in sheetcam ?

amir
**Even a clock that does not work is right twice a day**
Re: Using a Variable
« Reply #6 on: May 26, 2010, 08:38:45 AM »
Amir-

I am working with Les at sheetcam.  Right now, I dont have a clue.  But as soon as I figure it out, I will let everyone knw.


Steve

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Using a Variable
« Reply #7 on: May 26, 2010, 01:00:04 PM »
Basically what he is doing is allowing the Scam post to add a Variable to the Dwell so that he can change the dwell time on the fly as needed.

Gcode Dwell

G4 P1         would indicate a pause of 1 sec based on the P parameter of 1 (IF you set up config to do secs not Msecs)

The Scam post would input a VAR in place of the number

G4 P#100       Now the pause will be controled by the value of the VAR. All that is needed is a DRO on the program screen to set what dwell you    need for the NEXT section of code. You will also need a piece of code in the Macropump to update the VAR.

SetVar(100,Getoemdro(???))            With that in place with every loop of the macropump the var will be updated to the onscreen DRO value .

A VERY GOOD IDEA that I will add to my setup as well.

You might want to think about a Pierce count DRO as well . It makes it easier to keep track of the number of pierces you have completed.
Re: Using a Variable
« Reply #8 on: May 26, 2010, 01:15:58 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
Re: Using a Variable
« Reply #9 on: May 26, 2010, 01:20:14 PM »
is it possible that you talk about a practical example.
i never did not use the variable in sheetcam.
**Even a clock that does not work is right twice a day**