Home
Downloads
Mach3
Plugins
CAM Post Processors
Screensets
Purchase
Support
Forum
Tutorial Videos
Documentation
Yahoo Group
Mach Wiki
Resources
Contact Us
Links
CNCZone
German Forum
Italian Forum
Korean Forum
Portugese (Brazil) Forum
Russian Forum (RSK CNCROUTER)
Thai Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 28, 2012, 08:47:11 AM
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
Feature Requests
Parametric Programming
Pages:
1
2
»
Go Down
« previous
next »
Author
Topic: Parametric Programming (Read 4454 times)
0 Members and 1 Guest are viewing this topic.
Darc
Active Member
Offline
Posts: 177
Parametric Programming
«
on:
December 19, 2006, 01:55:54 PM »
Any chance of being able to use IF, THEN, GOTO, DOWHILE etc etc?
Does anyone else have any uses for these or is it just me??
Logged
Brian Barker
Administrator
Offline
Posts: 3,383
Re: Parametric Programming
«
Reply #1 on:
December 19, 2006, 11:28:05 PM »
That is a major job and will not happen... There is VB and I can help you with that
Logged
Fixing problems one post at a time
www.newfangledsolutions.com
www.machsupport.com
Darc
Active Member
Offline
Posts: 177
Re: Parametric Programming
«
Reply #2 on:
December 21, 2006, 12:00:08 AM »
Hi Brian,
Thanks for the reply, I'm really keen to be able to use parametric programming. Where should I start to be able to use it?
The main one I would use is as follows.
#100=4 (No. of Repetitions)
N10
IF[#100 EQ 0] GOTO10
PROGRAM
#100=[#100-1]
GOTO10
N20
And also DOWHILE as per below.
#100=4 (NO OF REPEPTITIONS)
WHILE [#100 GT 0] DO1
G01 X100. F1000
#100=[#100-1]
END1
Thanks.
Darc
Logged
Graham Waterworth
Administrator
Online
Posts: 1,665
West Yorkshire, England
Re: Parametric Programming
«
Reply #3 on:
December 21, 2006, 04:28:40 AM »
You can do that this way :-
O1000
(MAIN PROGRAM)
G00 X0 Y0 Z0
M98 P1001 L4 (JUMP TO SUB PROG 4 TIMES)
M30
O1001
(SUB PROGRAM)
G01 X100. F1000.
.... Etc
M99
Graham.
Logged
G-Code is on the cutting edge
Autovalues Engineering, CNC machining specialists, Bradford, England
Darc
Active Member
Offline
Posts: 177
Re: Parametric Programming
«
Reply #4 on:
December 22, 2006, 04:40:21 PM »
I was hoping to use the IF or the DOWHILE function, so I can have calculations inside the program, so it's smart enough to work out various things and jump backwards and forwards when neccesary with the GOTO command.
Logged
Brian Barker
Administrator
Offline
Posts: 3,383
Re: Parametric Programming
«
Reply #5 on:
December 22, 2006, 08:59:24 PM »
Use the Force! (VB)
It is not as bad as you think... For example
Code"X" & Xpos & " Y" & Ypos
This will output a line of Gcode with whatever you have Xpos and Ypos set to
Logged
Fixing problems one post at a time
www.newfangledsolutions.com
www.machsupport.com
Darc
Active Member
Offline
Posts: 177
Re: Parametric Programming
«
Reply #6 on:
January 15, 2007, 07:08:28 AM »
Sorry for the slow response, I've been away on holidays.
BTW, it would be used for a cut off machine.
I was thinking of having a program much like below, is it possible to have it attached to a button?
e.g when I push the button with 20mm on it, it will run the below program?
e.g when I push the button with 16mm on it, it will run the below program but with 16.0 in the variable #1?
;Y0.0 is always the centerline of the bar of steel
#1=20.0 ;Variable Bar Ø
#2=[#1/2]
G90 G55 G21
G00 Y[#2+1.0] ;Rapid into 1.0 away from job
G01 Y[#2-[#2*2]-1.0] F300 ;Cuts in to -11.0 (½Ø + 1.0 further)
G00 Y300.0 ;Pulls away from the job
M30
If the answer is no, please feel free to explain how I would go about using VB scripts instead.
Thanks.
Darc
Logged
fer_mayrl
Global Moderator
Offline
Posts: 452
Re: Parametric Programming
«
Reply #7 on:
January 15, 2007, 11:42:28 AM »
Darc,
You can do this, its simple.
I can think of two ways.
1. If you are always using the same diameters (for example 10 different diameters), do a screen (or wizard) with 10 buttons, each with the VB code for each diameter, so you will have a button for 20mm, a button for 16mm, and so on and so forth. You will have to use the sintax required to run a gcode in VB.
2. If you have a large number of diameters and it is prohibitive to have a button for each, make a screen (or wizard) , with a DRO in which you can input the diameter of the bar you want to cut. then Just have a button that reads that DRO and inserts it in the #1 variable you proposed.
Hope that gets you started.
Regards
Fernando
Logged
Darc
Active Member
Offline
Posts: 177
Re: Parametric Programming
«
Reply #8 on:
January 16, 2007, 06:56:10 PM »
Thanks fer mayrl, I just made up a quick screen, I placed multiple buttons on it, with different sizes on each of them.
Could you please give me an example of the syntax I would need to run an G code program from VB?
Thanks
Logged
fer_mayrl
Global Moderator
Offline
Posts: 452
Re: Parametric Programming
«
Reply #9 on:
January 16, 2007, 07:08:34 PM »
From the top of my head I beleive its like the following:
for a 20mm bar following the program you posted
CODE "G90 G55 G21"
CODE "G00 Y11" ;Rapid into 1.0 away from job
CODE "G01 Y-11 F300" ;Cuts in to -11.0 (½Ø + 1.0 further)
CODE "G00 Y300.0" ;Pulls away from the job
CODE "M30"
basically the syntax is the following:
CODE "whatever Gcode you want"
You can add variables to this syntax like this
#1=GetOEMDRO( DRO number) ;whatever DRO you put in the screen, lets say you put a 10 in that DRO
FEED=GetOEMDRO( DRO number); whatever DRO you pout on screen for inputing the feed rate, let say you put a 300 in that DRO
CODE "G01 y" & #1 "F" & FEED
this woudl simulate the following line
G01 y10 F300
Hope that gets you started
Fernando
Logged
Pages:
1
2
»
Go Up
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Mach Discussion
-----------------------------
=> General Mach Discussion
=> Mach3 under Vista
=> Quantum
=> 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
=> dspMC/IP Motion Controller
=> HiCON Motion Controller
=> Third party software and hardware support forums.
=> Galil
=> Newfangled Solutions Wizards
=> Mach3 and G-Rex
=> Mesa
=> Modbus
=> NC Pod
=> PoKeys
=> SmoothStepper USB
=> Sieg Machines
=> Promote and discuss your product
-----------------------------
Tangent Corner
-----------------------------
=> Tangent Corner
=> Competitions
=> Polls
=> Bargain Basement
-----------------------------
Support
-----------------------------
=> 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.
-----------------------------
Mach4
-----------------------------
=> Mach4 pre-Alpha Testing
Loading...