Machsupport Forum

Mach Discussion => Mach Screens => Topic started by: hitchhiker on February 20, 2022, 10:12:23 AM

Title: machscreen .. adding dro and script from button??
Post by: hitchhiker on February 20, 2022, 10:12:23 AM
hi!
2 questions :)

i playing with my mach3 and machscreen..

1.
i have add a button to my screen.
i wrote a vbscript and save them.in the macro folder.

name of the script is HomeTurret.

now i want to load this script as file when i hit the button.
if i change something on the script i dont want to add the script again with machscreen.

is this possible??? can someone help me?


2.

when i do a toolchange my turret jogs to x5 z55.
this values are named wzwx and wzwz
i add 2 dro to my screen.
i wish that the dros show me wzwx (5) and wzwz (55).
and i want.. if i change the value in the dro.. that is set wzwx and wzwz to this.

example : in the dro i put in 10 and 60.
then the machine jogs to x10 and z60.

its to set a toolchange position.

is this possible?!
thanks
Title: Re: machscreen .. adding dro and script from button??
Post by: Graham Waterworth on February 20, 2022, 12:23:07 PM
You add the following line to the execute script section of the button property

Filepath = "\mach3\macros\Mach3Mill\YOUR_MACRO"
RunScript(Filepath)

Use G53 values for the tool change position.  To get these click the machine DRO button, these do not change when you reset the fixture offsets.

Title: Re: machscreen .. adding dro and script from button??
Post by: hitchhiker on February 20, 2022, 12:25:00 PM
nice!

works.. perfect... and what about the dro??? is this possible????


thanks!!
Title: Re: machscreen .. adding dro and script from button??
Post by: TPS on April 22, 2022, 01:17:42 PM
for example your OEMDro's are:

wzwx = OEMDro(1200) and wzwz = OEMDro(1201)

the VBCode would be:
Code: [Select]
  Code ("G1 X" &GetOEMDro(1200) &" Z" &GetOEMDro(1201) &" F123")

btw.

https://www.machsupport.com/wp-content/uploads/2013/02/Mach3_V3.x_Macro_Prog_Ref.pdf

is allways good to have
Title: Re: machscreen .. adding dro and script from button??
Post by: hitchhiker on April 23, 2022, 07:16:31 AM
thanks!
but why g1?!

if i am at home i would check it.
Title: Re: machscreen .. adding dro and script from button??
Post by: TPS on April 23, 2022, 07:21:10 AM
you can also use a G0
Title: Re: machscreen .. adding dro and script from button??
Post by: hitchhiker on April 23, 2022, 07:27:55 AM
wzwx and wzwz is to set the position.
not to go to the position.

i want to use the dro wzwx and wzwz to set the position which is used when g53 is entered.. or better... when i call t0101 or something what make a toolchange.

hope you understand?
thanks
Title: Re: machscreen .. adding dro and script from button??
Post by: TPS on April 24, 2022, 03:56:48 AM
for toolchange normaly M6Start.M1S and depending on the way you do your toolchange M6End.M1S
are used.

do at the begin of M6Start a

Code: [Select]
  Code ("G53 G1 X" &GetOEMDro(1200) &" Z" &GetOEMDro(1201) &" F123")

will allways bring the machine first to a tool change position.