OK, maybe my first post was not specific enough.
I'm trying to create a set of buttons to emulate canned scenarios after prompting for a custom name.
To do this, I created 3 VB buttons and a UserLabel (Userlabel1) to display the name of the .tap file input by the user.
The first button's VB labeled "Teach Scenario 1"
Dim Prog1
Prog1 = InputBox ("What is the name of this scenario? Be sure to add '.tap' at the end of the file name. EX: MediaPlayer.tap")
SetUserLabel (1, Prog1)
OpenTeachFile Prog1
Code "G0 G49 G40 G17 G80 G50 G90"
Code "G82 X0.0 Y0.0 Z-.01000 P0 R-.001000 F150"
The second button's VB script labeled "End Teach 1"
Dim InfLoop
InfLoop = InputBox ("Do you want this scenario to loop continuously when ran? Y or N")
Code "G80"
Code "G28"
If InfLoop = "Y" Then
Code "M47"
ElseIf InfLoop = "y" Then
Code "M47"
End If
Code "M30"
CloseTeachFile
The Last button labeled "Run Scenario 1"
Dim Prog1_1
Prog1_1 = GetUserLabel1
ChDir "d:\mach3\gcode"
LoadRun (Prog1_1)
I want this last button to be able to be pressed during Teach mode for another .tap file and enter all of it's code into the current .tap file on the fly. I also want this button to run the tap file listed in UserLabel1 if the button is pressed while NOT in teach mode for another .tap file. Am I going about this the wrong way? I understand I probably will need to add an if/then statement in the last button to give it this duel capability, but to get started I need it to run the file listed in the UserLabel and not simply the last file taught. I don't see a way to call the string currently in UserLabel1. Prog1_1 = GetUserLabel1 is not working for this.
I hope this helps to clarify my question.
Thank you,
JJ