Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: matrix on June 13, 2017, 07:12:18 AM

Title: do user button
Post by: matrix on June 13, 2017, 07:12:18 AM


I set on screen a button with a vb script, this is a user button, I need call this button from macropump,I already tried calling as  ex: "douserbutton(1500) but dont work, Does anyone know how I can do this?


tanks
Title: Re: do user button
Post by: Tweakie.CNC on June 13, 2017, 08:39:08 AM
I think the correct syntax is DoButton(1500) however...

Quote:

The use of DoButton is no longer recommended practice and this function exists only to support preexisting legacy scripts. This function is deprecated, and its use is strongly discouraged.   
 
Legacy script note: Over time, there have been two different Button numbering schemes used with Mach; the “Button number” series and the “OEMButton number” series. This function uses the “Button number” series.   
 
Within the “Button number” range, valid ButtonNums were from 0 to 31, which, at one time, corresponded to OEM LED numbers 1000 10 1031. 
 
The numerical correspondence between the numbering series is not guaranteed for future releases of Mach.
 
Use the DoOEMButton function instead of this function.

Tweakie.
Title: Re: do user button
Post by: matrix on June 13, 2017, 08:52:25 AM


thanks for the answer,


I also tested with the dobutton(1500) and it does not work, Is a button with a VB script, it is set to like function "User defined:1500", so, this is a user button right??

I know there is some silliness between DoButton and DoOemButton.

I do not know if I can call this button directly from a VB script like macropump ou M.m1s macros??

Title: Re: do user button
Post by: TPS on June 21, 2017, 08:29:33 AM
hi,
i am not 100% sure, but i think you can not run a oembutton from vb script.

a Workaround would be to use doOEMButton(301) witch runs the macro witch is set by SetTRiggerMacro,
and then you can run the macro from different "places".
Thomas