Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Roberto Ramírez on July 25, 2018, 02:28:00 AM

Title: doubt Macros VBScript
Post by: Roberto Ramírez on July 25, 2018, 02:28:00 AM
Hello goodnight. I am writing to you because I want to learn to do macros in VBScript mainly to be able to do AutoToolZero.

I've been reading and researching programming using Cypress Basic (CB). What I've been reading about is that it has Dros functions, Button Commands and Leds functions. I was also reading the manual of Macro Programmers Reference Manual 2010 but I do not understand it very well.

Noce how to use this type of commands to program, I would greatly appreciate if someone could explain how it works, or put an example explained, a manual or book explaining all this.

This is an example that comes in the manual Mach3 Version 3.x Macro Programmers Reference Manual :

‘ Define the axes C
Const XaxisMultiFunctionOEMDRONum = 800
Const YaxisMultiFunctionOEMDRONum = 801
Const ZaxisMultiFunctionOEMDRONum = 802
‘ Write 1.2345 to Z axis DRO using SetOEMDRO
SetOEMDRO(ZaxisMultiFunctionDRONum, 1.2345) 
‘ Show the user the Z Axis DRO value, using
GetOEMDRO()
MsgBox “After using SetOEMDRO() the Z Axis DRO reads: “ & GetOEMDRO(ZaxisMultiFunctionDRONum)

I have no idea that it is stating with the constants and that it is equal to 800,801 and 802. I hope that someone can help me to understand how these commands work.

I attach the manual that I am using to learn
Title: Re: doubt Macros VBScript
Post by: Tweakie.CNC on July 25, 2018, 03:38:16 AM
Perhaps check out the video tutorials;

http://www.machsupport.com/help-learning/videos-tutorials/

Other download links you may find of interest;

http://www.machsupport.com/forum/index.php?action=dlattach;topic=11061.0;attach=14193
http://www.machsupport.com/forum/index.php?action=dlattach;topic=11056.0;attach=14194
http://www.machsupport.com/forum/index.php?action=dlattach;topic=9312.0;attach=6986
http://www.machsupport.com/forum/index.php?action=dlattach;topic=7922.0;attach=6167
http://www.machsupport.com/forum/index.php?action=dlattach;topic=18062.0;attach=26020

Tweakie.
Title: Re: doubt Macros VBScript
Post by: Roberto Ramírez on July 26, 2018, 01:33:49 AM
Thank you very much Tweakie.CNC for the links that you passed me, I understood a little more when I was reading the second link, I was already practicing with the GetScale and SetScale to get familiar with this type of programming.

But I still do not understand very well what it means OEM DROs, OEM Buttons, SetOEMDRO and GetOEMDRO. How can they be used in a program made in a VBScript?
Title: Re: doubt Macros VBScript
Post by: Tweakie.CNC on July 26, 2018, 01:54:43 AM
There is explanation and working examples in the Customising Mach2 manual;  http://www.machsupport.com/wp-content/uploads/2013/02/Mach2_6.11_Custom.pdf

Tweakie.
Title: Re: doubt Macros VBScript
Post by: Roberto Ramírez on July 27, 2018, 02:11:55 AM
Thank you very much Tweakie.CNC, what I have read from the last manual that you had very well explained to me, I already had a lot of time looking for books, manuals on that subject but I had not found anything, now I'm just going to study and read that manual to be able to understand you more to the macros and again thanks for the information