Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
April 20, 2018, 10:55:46 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Select from and to languages
Chinese-simp to English
Chinese-trad to English
English to Chinese-simp
English to Chinese-trad
English to Dutch
English to French
English to German
English to Greek
English to Italian
English to Japanese
English to Korean
English to Portuguese
English to Russian
English to Spanish
Dutch to English
Dutch to French
French to English
French to German
French to Greek
French to Italian
French to Portuguese
French to Dutch
French to Spanish
German to English
German to French
Greek to English
Greek to French
Italian to English
Italian to French
Japanese to English
Korean to English
Portuguese to English
Portuguese to French
Russian to English
Spanish to English
Spanish to French
Machsupport Forum
Mach Discussion
VB and the development of wizards
VB syntax
Pages:
1
2
3
»
Go Down
« previous
next »
Author
Topic: VB syntax (Read 10327 times)
0 Members and 1 Guest are viewing this topic.
MachineMaster
Active Member
Offline
Posts: 150
VB syntax
«
on:
March 18, 2009, 12:28:18 PM »
OK, I'm new at this so I am askin for help. I printed out the Mach Script Language Reference, all 139 pages.
I now have a macro that I have written.
a = GetVar (500)
b = GetVar (501)
c = GetVar (502)
d = GetVar (503)
a= a+1
If a>9 Then b=b+1
If a>9 Then a=0
If b>9 Then c=c+1
If b>9 Then b=0
If c>9 Then d=d+1
If c>9 Then c=0
Print " " &d &c &b &a
SetVar 500, a
SetVar 501, b
SetVar 502, c
SetVar 503, d
End
I had help writing it. The reason I am writing is this macro does what I need but no where in the 139 pages do I find
GetVar, SetVar or a reference to variables in the 500 - 600 range being persistent.
That leads me to think that the 139 pages that I printed are not what I should be studying.
Where do I find the REAL language reference?
Darrell
Logged
ger21
Global Moderator
Offline
Posts: 5,766
Re: VB syntax
«
Reply #1 on:
March 18, 2009, 12:37:03 PM »
http://www.machsupport.com/MachCustomizeWiki/index.php?title=Mach_specific_Subroutines/Functions_grouped_by_purpose
Logged
Gerry
2010 Screenset
http://www.thecncwoodworker.com/2010.html
JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
poppabear
S S SYSTEMS, LLC
Global Moderator
Offline
Posts: 2,240
Briceville, TN, USA
Re: VB syntax
«
Reply #2 on:
March 18, 2009, 12:48:59 PM »
note you have to put a "End If" to follow your If statements. i.e.
if a<(a+1) then
your code here
end if
scott
Logged
Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
http://www.ss-systems-llc.com/
MachineMaster
Active Member
Offline
Posts: 150
Re: VB syntax
«
Reply #3 on:
March 18, 2009, 01:18:58 PM »
Scot,
Do you mean an End If after every If statement or an End If after the last If statement in my code?
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Offline
Posts: 2,240
Briceville, TN, USA
Re: VB syntax
«
Reply #4 on:
March 18, 2009, 01:28:00 PM »
after every if
Logged
Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
http://www.ss-systems-llc.com/
ger21
Global Moderator
Offline
Posts: 5,766
Re: VB syntax
«
Reply #5 on:
March 18, 2009, 02:29:15 PM »
If it's on one line, you shouldn't need an End If. At least you don't in regular VB.
Logged
Gerry
2010 Screenset
http://www.thecncwoodworker.com/2010.html
JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
MachineMaster
Active Member
Offline
Posts: 150
Re: VB syntax
«
Reply #6 on:
March 18, 2009, 06:55:52 PM »
Thanks for all the replies. I am still looking for a good language reference. The Wiki page mentioned does have information not in the Mach Script Language Reference but there still seems to be a lot missing. Most needed for me are actual examples.
I am still not sure if I am supposed to be looking for VB Scripting or VB Programming or is there a difference?
Is VB something I need to buy or is there a free version?
Programming Macros interests me a lot as I have been using AHHA software's built in macro language for years and this looks to have even more possibilities.
Logged
vmax549
Guest
Re: VB syntax
«
Reply #7 on:
March 19, 2009, 08:59:54 PM »
Darrel there is NOT alot published on the EXTRAS that were added in . THere is a little in the Customising Mach manual that gives the very basics.
You just have to ask if you need to know something and HOPEFULLY someone has already figured out a way. OR collectively we work on it to come up with a solution or two. (;-)
Hopefully someone creative willl come along and take ALL the post and sort through them and put them in a search engine type arrangement, then we may have a decent library of functions .
Just a thought, (;-) TP
Logged
MachineMaster
Active Member
Offline
Posts: 150
Re: VB syntax
«
Reply #8 on:
March 20, 2009, 02:11:31 PM »
I have been unable to find any where the syntax for using variables in G code in a Macro.
I can declare a variable
V= GetVar (550)
and Print V will print the value that I have stored in 550 but if I use
V= GetVar (550)
Code "G90 G00 XV YV" or
Code "G90 G00 X&V Y&V"
it runs ok in the script window but Mach gives the error
No digits found where real number should be
What am I doing wrong?
Logged
ger21
Global Moderator
Offline
Posts: 5,766
Re: VB syntax
«
Reply #9 on:
March 20, 2009, 02:26:47 PM »
Try this:
Code "G90 G00 X " &V & " Y " &V
Logged
Gerry
2010 Screenset
http://www.thecncwoodworker.com/2010.html
JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Pages:
1
2
3
»
Go Up
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Mach Discussion
-----------------------------
=> General Mach Discussion
=> Mach4 General Discussion
===> Mach4 Toolbox
===> Mach4 Videos
===> Mach4 Plugins
=> Mach3 under Vista
=> Mach SDK plugin questions and answers.
===> Finished Plugins for Download
=> VB and the development of wizards
=> Brains Development
=> Video P*r*o*b*i*n*g
=> Mach Screens
===> Screen designer tips and tutorials
===> Works in progress
===> Finished Screens
===> Flash Screens
===> JetCam screen designer
===> Machscreen Screen Designer
===> CVI MachStdMill (MSM)
=> Feature Requests
=> Non English Forums
===> Italian
===> French
===> Spanish
===> Chinese
===> German
===> Russian
===> Romanian
===> Japanese
===> Vietnamese
=> FAQs
-----------------------------
*****VIDEOS*****
-----------------------------
=> *****VIDEOS*****
-----------------------------
General CNC Chat
-----------------------------
=> Share Your GCode
=> Show"N"Tell ( What you have made with your CNC machine.)
=> Building or Buying a Wood routing table.. Beginnners guide..
=> Show"N"Tell ( Your Machines)
-----------------------------
G-Code, CAD, and CAM
-----------------------------
=> G-Code, CAD, and CAM discussions
=> LazyCam (Beta)
-----------------------------
Third party software and hardware support forums.
-----------------------------
=> LazyTurn
=> GearoticMotion Preliminary testing
=> Tempest Trajectory Planner
=> Contec
=> CS-Lab
=> dspMC/IP Motion Controller
=> HiCON Motion Controller
=> Third party software and hardware support forums.
=> Galil
=> Newfangled Solutions Mach3 Wizards
=> Newfangled Mill Wizard
=> Mach3 and G-Rex
=> Mesa
=> Modbus
=> NC Pod
=> PoKeys
=> SmoothStepper USB
=> Vistacnc Control Pendants
=> Sieg Machines
=> Promote and discuss your product
-----------------------------
Tangent Corner
-----------------------------
=> Tangent Corner
=> Competitions
=> Polls
=> Bargain Basement
-----------------------------
Support
-----------------------------
=> Members Docs
=> Downloads
===> XML files
===> Post Processors
===> Macros
===> Tutorials
===> Others
===> Beta Brains
===> Screen Sets
===> Documents
===> MACH TOOL BOX
=> One on one phone support.
=> Forum suggestions and report forum problems.
Loading...