Hello Guest it is April 21, 2019, 12:51:27 PM

Author Topic: Bad VB code on a button  (Read 2750 times)

0 Members and 1 Guest are viewing this topic.

Bad VB code on a button
« on: February 16, 2010, 06:12:10 PM »
Tool_Num = GetDRO (24)= PWM Base DRO


If Tool_Num <>0 then
Z_Shift = GetOEMDRO (1002)= next to set tool offset
Z_Offset = GetOEMDRO ( 49 )= Part Z Offset DRO
Axis_Pos = GetOEMDRO(85)= Z Machine Coord DRO
Tool_Offset = Axis_Pos - Z_Offset  -Z_Shift
Call setOEMDRO(42, Tool_Offset)= Tool Z Offset DRO
End if

This is what is on the SET TOOL OFFSET BUTTON on page 5 of the standard screen for mill

It's in the Gage Block Height section

I am trying to understand it and i have looked up the dro codes in the XLS file Hood posted

The OEMdro for number 24 is clearly wrong  for in the context its being used for

Can anyone shed any light please.

Phil
The Good Thing About Mach3, Is It's very Configurable

The Bad Thing About Mach3, Is It's Too Configurable
Re: Bad VB code on a button
« Reply #1 on: February 16, 2010, 06:36:31 PM »
Phil,
 Do you mean 42 ... instead of 24 ?
« Last Edit: February 16, 2010, 06:38:34 PM by Overloaded »
Re: Bad VB code on a button
« Reply #2 on: February 17, 2010, 02:43:41 AM »
Thanks

Definitely 24 it was late last night and i have just noticed the syntax seems to be wrong as well

Tool_Num = GetDRO (24)= PWM Base DRO

This is the first line of code on the button should it not be GetOEMDRO

The number 24 = PWM Base DRO

Phil
The Good Thing About Mach3, Is It's very Configurable

The Bad Thing About Mach3, Is It's Too Configurable

Offline Hood

*
  •  25,779 25,779
  • Carnoustie, Scotland
    • View Profile
Re: Bad VB code on a button
« Reply #3 on: February 17, 2010, 03:29:06 AM »
GetDRO (24) is the same as GetOemDRO(824)
Some DRO's and Buttons etc are what is called Standard DROs/Buttons and can be written either way, think of the Ref All button, it calls DoButton(23) but could also be written DoOemButton(1023)

Hood
Re: Bad VB code on a button
« Reply #4 on: February 17, 2010, 05:23:23 AM »
Thanks Hood

I knew about adding 1000 but not 800 to the numbers

Phil
The Good Thing About Mach3, Is It's very Configurable

The Bad Thing About Mach3, Is It's Too Configurable
Re: Bad VB code on a button
« Reply #5 on: February 17, 2010, 06:49:27 AM »
Oh..I see it now at the top of your post phil,,,,totally missed that line.
gotcha now,
Russ