Hello Guest it is April 24, 2024, 08:46:12 PM

Author Topic: Passing Code to mach  (Read 6053 times)

0 Members and 1 Guest are viewing this topic.

Passing Code to mach
« on: August 20, 2011, 03: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.

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Passing Code to mach
« Reply #1 on: August 20, 2011, 09: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
Re: Passing Code to mach
« Reply #2 on: August 21, 2011, 04: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.

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Passing Code to mach
« Reply #3 on: August 21, 2011, 08: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".
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Passing Code to mach
« Reply #4 on: August 21, 2011, 08: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.

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: Passing Code to mach
« Reply #5 on: August 21, 2011, 08: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
Re: Passing Code to mach
« Reply #6 on: August 21, 2011, 09: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.

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Passing Code to mach
« Reply #7 on: August 21, 2011, 12:14:40 PM »
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, 12:16:18 PM by BR549 »
Re: Passing Code to mach
« Reply #8 on: August 21, 2011, 08: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