Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: M250cnc on December 22, 2009, 09:59:34 AM

Title: PLease Help with code
Post by: M250cnc on December 22, 2009, 09:59:34 AM
This is the code on a button to zero machine co ordinates

What would be the code to set the dro to another dro

SetMachZero(2)
call SetDRO( 2, 0 )

So that dro 2 is the same as dro 20 as an example

I am sorry but i don't want to learn another app  ;D

Thanks
Title: Re: PLease Help with code
Post by: melee on December 22, 2009, 11:32:34 AM
Hi

You could do it this way

SetOEMDRO( 2, GetOEMDRO(20) )

(NB. SetDRO and GetDRO are deprecated from v2.6*********)

regards

Melee
Title: Re: PLease Help with code
Post by: M250cnc on December 23, 2009, 01:03:41 AM
Melee

Thanks for the reply, unfortunately it did not do what i wanted it too.

Phil
Title: Re: PLease Help with code
Post by: melee on December 23, 2009, 04:39:12 AM
Hi

You will need to be specific as to the exact code you used, where you put it and how it is activated.

SetOEMDRO( 800, GetOEMDRO(801) ) for instance, WILL set the X axis main DRO to the contents of the main Y axis DRO.

regards

Melee
Title: Re: PLease Help with code
Post by: M250cnc on December 23, 2009, 05:29:08 AM
Hi & thanks

I want to set X machine Co Ord OEM83 dro to X Ref POs Offset OEM33 Dro

I set it as to the format you said would work but it doesn't.

What i am trying to achieve with the press of a button is to set machine co ordinates (X=83) to that  axis offset dro (X=33)

Thanks
Title: Re: PLease Help with code
Post by: melee on December 23, 2009, 09:52:11 AM
Ahhh I see,

Unfortunately I suspect you will be unable to set the Machine Axis Co-ordinates to anything, except 0 when referencing to Home.

The machine co-ordinates are absolute and physical.
If you could change them to another figure ( even an offset of themselves ), the controller would be unable to tell where the machine axes were and would happily crash at speed through the home positions.

I actually  tried changing the values through MachMad and whilst you can see it change, it is immediately returned to its original value.

regards

Melee
Title: Re: PLease Help with code
Post by: M250cnc on December 23, 2009, 11:55:42 PM
Melee,

Thanks for your help on this, but a bit of a shame really.

Any machine owners who do not use homing switches and hard limits, "and there seem to be lots", makes life is harder.

Phil
Title: Re: PLease Help with code
Post by: Graham Waterworth on December 26, 2009, 06:09:26 AM
If you look in Config..Homing/Limits you can specify a home offset for each axis there. You can not change it on the fly but if the offset is static it will work, I use it for my tool changer.

Graham
Title: Re: PLease Help with code
Post by: M250cnc on January 01, 2010, 07:57:05 AM
Thanks Graham