Machsupport Forum
Mach Discussion => VB and the development of wizards => Topic started by: oscbe112 on February 19, 2012, 05:36:25 AM
-
I have a difficult task for you ;)
I've built a screen that builds a cutting G-code program based of inputs from the user.
The program is simple and consist of [start parameters] -> [x number of cuts in a sequence] -> [End Parameters]
My question for you: Is it possible for the user to be able to rewind to the previous cutting sequence?
=> User is running cut number 2 -> User stops in the middle of the procedure -> Press "Rewind" button -> VB set next line to the start of Cut number 2 -> Press start
Program example:
->Parameters<-
Cut 1
.
.
Cut 2
.
.
And so on...
.
.
->End<-
-
It depends on HOW you are using the parameters. IF the values are just presets and never change then yes you can restart. BUT if the vlaues are calculated as you go then NO as the rewind and prestest of the Gcode cannot run the calculations and solve for all the unknowns.
It IS possible inside of CB to JUMP from CB to a point in a Gcode Program.
(;-) TP
-
The complete Gcode is calculated pre start based of the parameters that is collected from the user interface. Eg. the Gcode is static.
My first thought:
1. Program Start
2. Program STOP
3. User press "Rewind to last cut" [<]
4. CB check current Gcode line
5. CB opens file -> searches Gcode for keyword like "Cut"
6. CB determines which "cut" that is closest (backwards) to current line
7. CB set next line
8. User is happy, and press Start to try again!
Please tell me there is a better way :)
-
At each section of Gcode place the o word holder
o001
code
code
o002
From inside a CB macro, code" M98 P002" ,and it will take you to the o002 position. Press run or code the dooembutton() and off you go.
(;-) TP
-
Good one!
How to keep track of which was the latest cut (there can be several)?
-
Problem solved, M-macros within the G-code keep track of this parameters for me
Thanks for the input
-
Another easy way to track the cuts is to use a #var to assign it the latest cut#
#100 = 1
code
code
code
#100=2
Code
code
code
#100 = 3
That way when you need to rewind, the Value of #100 = the last cut you were on. Make the #100 the same as the oword.
Just a thought, (;-) TP