Hello Guest it is January 24, 2021, 08:05:45 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - MachineMaster

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 »
131
VB and the development of wizards / Re: VB syntax
« on: March 20, 2009, 08:10:45 PM »
Well I tried

GetVar (550)
SetVar(551,(550/2))
Code "G90 G92 X0. Y0."
Code "G01 X[#551] Y[#551]"
Code "G03 X.0 Y[#550] I.0 J.0 G90"
Code "G03 X.0 Y[#550] I.0 J[-1*#550]G90"
Code "G03 X[-1*#551] Y[#551] I.0 J[-1*#551]G90"
Code "G01 G90 X.0 Y.0"
Code "G92.1"
End   

and var #551 equaled 275 so I tried

v = GetVar (550)
v = v/2
SetVar(551,v)
Code "G90 G92 X0. Y0."
Code "G01 X[#551] Y[#551]"
Code "G03 X.0 Y[#550] I.0 J.0 G90"
Code "G03 X.0 Y[#550] I.0 J[-1*#550]G90"
Code "G03 X[-1*#551] Y[#551] I.0 J[-1*#551]G90"
Code "G01 G90 X.0 Y.0"
Code "G92.1"
End   

 and got the zero radius arc error  even though the var monitor shows that #551 was properly set.

so I tried just doing the
  
v = GetVar (550)
v = v/2
SetVar(551,v)
 in the M code and the rest in a G-code file

#550 = .5
G0G90X.25Y-.25
M79
G90 G92 X0. Y0."
G01 X[#551] Y[#551]"
G03 X.0 Y[#550] I.0 J.0 G90"
G03 X.0 Y[#550] I.0 J[-1*#550]G90"
G03 X[-1*#551] Y[#551] I.0 J[-1*#551]G90"
G01 G90 X.0 Y.0"
G92.1"

and still got the error. This code works

V = GetVar (550)
V1 = V/2.
Code "G90 G92 X0. Y0."
Code "G01 X"&V1 & "Y"&V1
Code "G03 X.0 Y"&V & "I-"&V1 & "J.0 G90"
Code "G03 X.0 Y"&V & "I.0 J-"&V & "G90"
Code "G03 X-"&V1 & "Y"&V1 & "I.0 J-"&V1 & "G90"
Code "G01 G90 X.0 Y.0"
Code "G92.1"
End 

and you call it from the G-code like this

#550 = .5
G0 G90 X.25 Y-.25
M79

It runs and does a nice hole milling cycle. #550 is set to the radius of the hole minus the radius of the tool.



132
General Mach Discussion / Re: screen
« on: March 20, 2009, 07:03:05 PM »
When using Screen4 to modify some of my screens to use more hot-keys I have run into some strange key codes.
Screen4 tells me that the hot-key code for the reset button is 192 and the key code for the G-code button is 65535.
Mach Customize Wiki that the Cntrl key is 32768 so to get 65535 looks to be impossible.
Is there a list of hot-keys and their key codes?

133
VB and the development of wizards / Re: VB and variables in G code
« on: March 20, 2009, 04:03:49 PM »
I finally figured it out by just using one variable in one line of code until I got that to work and then added a second variable and worked at it until I got it to work. This is the result

V = GetVar (550)
V1 = V/2.
Code "G90 G92 X0. Y0."
Code "G01 X"&V1 & "Y"&V1
Code "G03 X.0 Y"&V & "I-"&V1 & "J.0 G90"
Code "G03 X.0 Y"&V & "I.0 J-"&V & "G90"
Code "G03 X-"&V1 & "Y"&V1 & "I.0 J-"&V1 & "G90"
Code "G01 G90 X.0 Y.0"
Code "G92.1"
End         

I had to get all of the quotes and &s in the right place.
The way it works is you put "&variable where the number would go and if there is more G code to follow on the same line it looks like this

Code "G01 X"&variable &"Y"&variable &"Z-.25"

There needs to be a space between variable and &"

134
VB and the development of wizards / Re: VB syntax
« on: March 20, 2009, 03:56:41 PM »
Looks like I was typing while you were posting. Your answer is exactly what I figured out.

135
VB and the development of wizards / Re: VB syntax
« on: March 20, 2009, 03:54:43 PM »
I finally figured it out by just using one variable in one line of code until I got that to work and then added a second variable and worked at it until I got it to work. This is the result

V = GetVar (550)
V1 = V/2.
Code "G90 G92 X0. Y0."
Code "G01 X"&V1 & "Y"&V1
Code "G03 X.0 Y"&V & "I-"&V1 & "J.0 G90"
Code "G03 X.0 Y"&V & "I.0 J-"&V & "G90"
Code "G03 X-"&V1 & "Y"&V1 & "I.0 J-"&V1 & "G90"
Code "G01 G90 X.0 Y.0"
Code "G92.1"
End          

I had to get all of the quotes and &s in the right place.
The way it works is you put "&variable where the number would go and if there is more G code to follow on the same line it looks like this

Code "G01 X"&variable &"Y"&variable &"Z-.25"

There needs to be a space between variable and &"

136
VB and the development of wizards / Re: VB syntax
« on: March 20, 2009, 03:11:31 PM »
I have been unable to find any where the syntax for using variables in G code in a Macro.
I can declare a variable
V= GetVar (550)
and Print V will print the value that I have stored in 550 but if I use

V= GetVar (550)
Code "G90 G00 XV YV" or
Code "G90 G00 X&V Y&V"

it runs ok in the script window but Mach gives the error

No digits found where real number should be

What am I doing wrong?

137
VB and the development of wizards / Re: VB and variables in G code
« on: March 19, 2009, 11:12:29 PM »
Still not getting it. I got my first macro working so I started on another one.

'M79.m1s
V = GetVar (550)
V1 = (V/2.0)
Code "G90 G92 X0. Y0."
Code "G01 X&V1 Y&V1"
Code "G03 X.0 Y&V I-&V1 J.0 G90"
Code "G03 X.0 Y&V I.0 J-&V G90"
Code "G03 X-&V1 Y&V1 I.0 J-&V1 G90"
Code "G01 G90 X.0 Y.0"
Code "G92.1"
End
   
Var 550 is set at .5 and if I put a Print statement in like
Print V1 the out put is the expected .25 but when I try to run M79 in my G code I get

No digits found where real number should be

The G code calling the M79 is

G49G80G90G00
X1.Y-1.F3.
M79
X0Y0
M30

If I modify the Macro to

'M78.m1s
V = GetVar (550)
V1 = (V/2.0)
Code " G90 G92 X0. Y0. "
Code "G01 X.25 Y.25"
Code "G03 X.0 Y.5 I-.25 J.0 G90"
Code "G03 X.0 Y.5 I.0 J-.5 G90"
Code "G03 X-.25 Y.25 I.0 J-.25 G90"
Code "G01 G90 X.0 Y.0"
Code "G92.1"
End
   
with real numbers it works the way I want it to. What am I doing wrong when I am trying to use variables in the G code in the macro?

138
VB and the development of wizards / Re: VB syntax
« on: March 18, 2009, 07:55:52 PM »
Thanks for all the replies. I am still looking for a good language reference. The Wiki page mentioned does have information not in the Mach Script Language Reference but there still seems to be a lot missing. Most needed for me are actual examples.
I am still not sure if I am supposed to be looking for VB Scripting or VB Programming or is there a difference?
Is VB something I need to buy or is there a free version?
Programming Macros interests me a lot as I have been using AHHA software's built in macro language for years and this looks to have even more possibilities.

139
VB and the development of wizards / Re: VB syntax
« on: March 18, 2009, 02:18:58 PM »
Scot,
Do you mean an End If after every If statement or an End If after the last If statement in my code?

140
VB and the development of wizards / VB syntax
« on: March 18, 2009, 01:28:18 PM »
OK, I'm new at this so I am askin for help. I printed out the Mach Script Language Reference, all 139 pages.
I now have a macro that I have written.

a = GetVar (500)
b = GetVar (501)
c = GetVar (502)
d = GetVar (503)

a= a+1
If a>9 Then b=b+1
If a>9 Then a=0

If b>9 Then c=c+1
If b>9 Then b=0

If c>9 Then d=d+1
If c>9 Then c=0   

Print " " &d &c &b &a
SetVar 500, a
SetVar 501, b
SetVar 502, c
SetVar 503, d
End

I had help writing it. The reason I am writing is this macro does what I need but no where in the 139 pages do I find
GetVar, SetVar or a reference to variables in the 500 - 600 range being persistent.
That leads me to think that the 139 pages that I printed are not what I should be studying.
Where do I find the REAL language reference?

Darrell

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 »