Hello Guest it is April 19, 2024, 11:42:58 PM

Author Topic: I need someone to varify my code please.........  (Read 4638 times)

0 Members and 1 Guest are viewing this topic.

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
I need someone to varify my code please.........
« on: November 04, 2008, 04:29:28 PM »
Greetings,

    I think I am having a "Brain Fart", can you look over my code below and tell me if it works right on your machine.........??

I am trying to do one of those solid Aluminum Touch off plates for a router and I am not sure if I am doing it right.
I am taking tool #1, and Zeroing it on the Table itself, then I am putting the metal plate as the tool length setter plate.
The probe down macro I have works fine for getting the Plate thickness which it sets in UDRO2202.

I then fill in the Feed rate and the Probing distance in the below user dros...

So, can some one look to see if it will set properly the Tool Hiegth Offset into the Tool Table library??

Once I have the Tool Ht. guadge setter ht., done, I again reprobe with my longest tool as tool#1, then move on to tool#2 etc.

Using this scenerio here, could you check my code and see if it is doing Tool hiegth offsets properly into the Tool library?

'===========Start Tool Plate hiegth touch off code===============

ToolNum = GetDRO (24)
SetVar(2002,0)

If ToolNum <>0 Then
Feed = GetUserDRO(2200)
ProbeDepth = GetUserDRO(2201)
Code "G31 Z-" & ProbeDepth & " F" & Feed
ZShift = GetOEMDRO (2202) 'guage ht.
ZOffset = GetVar(2002) 'Z Probe var
AxisPos = GetOEMDRO(85) 'Machine Z
ToolOffset = (AxisPos - ZOffset)  -ZShift
Call setOEMDRO(42, ToolOffset) 'set Tool offset
End if 

'===========End Tool Plate hiegth touch off code===============

'Scott
fun times

Offline zarzul

*
  •  232 232
  • Wyoming, USA
    • View Profile
Re: I need someone to varify my code please.........
« Reply #1 on: November 05, 2008, 01:13:09 PM »
Scott,

If nobody has, I will give it a try tonight.

Arnie

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: I need someone to varify my code please.........
« Reply #2 on: November 05, 2008, 02:04:43 PM »
Thank you for your time Zarzul,

  Graham discussed it with me via skype last night, BUT, I would LOVE for your to test it on your machine!!

Please let me know what you get.

scott
« Last Edit: December 15, 2008, 02:59:04 PM by Graham Waterworth »
fun times

vmax549

*
Re: I need someone to varify my code please.........
« Reply #3 on: December 14, 2008, 08:14:14 PM »
Scott what is is NOT doing correct? I see several things that will cause a problem using the g31 in a macro.

(;-) TP
« Last Edit: December 14, 2008, 08:17:12 PM by vmax549 »

Offline Graham Waterworth

*
  • *
  •  2,672 2,672
  • Yorkshire Dales, England
    • View Profile
Re: I need someone to varify my code please.........
« Reply #4 on: December 15, 2008, 02:58:42 PM »
I think I have him sorted, thanks for looking though.

Graham
Without engineers the world stops

vmax549

*
Re: I need someone to varify my code please.........
« Reply #5 on: December 15, 2008, 04:59:20 PM »
GUYS beware(;-) the G31 is acting  really squirrelly with V.020  IT does not play well with the While Ismoving()  Wend

THe g31 without the Whle Ismoving AND updating parameters on the fly has problems also. Mach seems to run out of time to get it all done and will skip code on you. (does here ) I had to resort to using, after the G31, a G04 P0 to make mach pause and do all the math before resuming(art's trick)

Also using Variables  G1 Z-(#100) will not work , Mach does not recognise the - as a directional indicator with a variable. You have to solve the var to a negative number. (;-(

Just a thought, (;-) TP
« Last Edit: December 15, 2008, 05:06:05 PM by vmax549 »