Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 01:14:24 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  VB and the development of wizards
| | |-+  Passing Code to mach
Pages: 1   Go Down
Print
Author Topic: Passing Code to mach  (Read 717 times)
0 Members and 1 Guest are viewing this topic.
stevehuck
Active Member

Offline Offline

Posts: 275


View Profile
« on: August 20, 2011, 02:43:03 PM »

When posting code in LazyCam somehow the code is passed to Mach if it is running on the computer. Anybody know how it is done? I have a custom application written in VB that creates code. I would like to pass the code to mach if it available. This is not a wizard but a stand alone app in VB.
Logged
BR549
Active Member

Offline Offline

Posts: 2,557


View Profile
« Reply #1 on: August 20, 2011, 08:54:00 PM »

HIYA Steve have the script write the Gcode as a text file then in the same script  LOAD the file into MACH and run.

OR do you mean run each individual line from inside the script 1 line at a time?

I should have examples of both ways here if you need them.

(;-) TP
Logged
stevehuck
Active Member

Offline Offline

Posts: 275


View Profile
« Reply #2 on: August 21, 2011, 03:59:57 AM »

HIYA Steve have the script write the Gcode as a text file then in the same script  LOAD the file into MACH and run.

OR do you mean run each individual line from inside the script 1 line at a time?

I should have examples of both ways here if you need them.

(;-) TP

The program writes a Gcode file to "C:\program1.tap" but it would be alot easier if I could auto load the program into mach if Mach is already running.
Logged
ger21
Global Moderator
*
Offline Offline

Posts: 2,619



View Profile WWW
« Reply #3 on: August 21, 2011, 07:02:57 AM »

Ask Brian on the Yahoo group.
Vectric's products (and others I believe) can also export code directly to Mach3. In Aspire there's a checkbox to  "Output direct to machine".
Logged

stevehuck
Active Member

Offline Offline

Posts: 275


View Profile
« Reply #4 on: August 21, 2011, 07:19:35 AM »

Ask Brian on the Yahoo group.
Vectric's products (and others I believe) can also export code directly to Mach3. In Aspire there's a checkbox to  "Output direct to machine".

Thanks ger21

I had absolutely no trouble writing the code in VB to output to a file. I have been screwing around for 3 days trying to get it to work as a wizard. I can't find docs for the VB commands and can't figure out how VB works in Mach directly. Specifically the "code" command. I'm guessing the code command has something to do with loading commands into the code window.
Logged
stirling
Global Moderator
*
Offline Offline

Posts: 1,190

UK


View Profile WWW
« Reply #5 on: August 21, 2011, 07:48:32 AM »

With regard to doing this WITHIN Mach from a wizard or a macro take a look at Support/Mach Wiki at the top of this page.

In particular look at

http://www.machsupport.com/MachCustomizeWiki/pdfs/VB-Script-Commands.pdf

and

http://www.machsupport.com/MachCustomizeWiki/index.php?title=Mach_specific_Subroutines/Functions_grouped_by_purpose

and look at "openTeachFile" in conjunction with "code".

With regard to sending code to Mach from an EXTERNAL app, SheetCAM amongst others do this - might be worth asking Les on the SheetCAM yahoo group.

Hope this helps.

Ian
Logged
stevehuck
Active Member

Offline Offline

Posts: 275


View Profile
« Reply #6 on: August 21, 2011, 08:21:56 AM »

So from what im reading I need to write the code into the teach file and then read it into the code window.
Logged
BR549
Active Member

Offline Offline

Posts: 2,557


View Profile
« Reply #7 on: August 21, 2011, 11:14:40 AM »

Steve another way ( simple to me) in your script

LoadFile("C:\program1.tap")
While Isloading()
Sleep(100)
Wend
RunFile()

OR the all in one method, but not always dependable to actually run on some puters

LoadRun("C:\program1.tap")

Just a thought(;-) TP
« Last Edit: August 21, 2011, 11:16:18 AM by BR549 » Logged
stevehuck
Active Member

Offline Offline

Posts: 275


View Profile
« Reply #8 on: August 21, 2011, 07:40:48 PM »

Thanks.  I decided to go the wizard route so i'm up to my a$$ in that whole thing. I have the wiz producing code and running it. I just need to do small things like figure out how to turn on the jogging from the keyboard. I'm reading everything I can find on the web and in the wiki.

Thanks for all the help thus far.

Steve
Logged
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!