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, 12:54:01 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
VB and the development of wizards
Using G-code files in Button Scripts
Pages:
1
2
3
4
5
»
Go Down
« previous
next »
Author
Topic: Using G-code files in Button Scripts (Read 2174 times)
0 Members and 1 Guest are viewing this topic.
CNCSarnia
Active Member
Offline
Posts: 14
Using G-code files in Button Scripts
«
on:
August 12, 2011, 01:06:16 PM »
I am just getting into screen customization and writing script for buttons. Looking at the Programmer's Reference Manual it should be possible to load and run G-code files using the LoadFile() then RunFile() commands so that hitting the button will cause that piece of code to be executed. The files given in the example are .TAP files and I see that the Wizard files stored in the GCode directory of Mach3 are in that format. The G-code files created normally (using Notepad) are in the .TXT format and although it is possible to load these files and they will run and do some things, the commands that should make the axes move do not function.
Should this approach work? do I need to generate .TAP files and if so how? or am I completely out to lunch with this approach?
Help would be appreciated
Logged
BR549
Active Member
Offline
Posts: 2,557
Re: Using G-code files in Button Scripts
«
Reply #1 on:
August 12, 2011, 03:03:22 PM »
The .tap/.txt extension will not make a diiference as long as MACH will except it. There is a list in the manual .
Are you refereing to the GCODE Programs or Macro programs. Gcode Programs can ONLY run Gcode commands. A macro program can be a mix of Gcode and MachCB.
Can you post an example ?
(;-) TP
Logged
Sargon
Active Member
Offline
Posts: 99
Re: Using G-code files in Button Scripts
«
Reply #2 on:
August 12, 2011, 04:17:12 PM »
I was surprised to find that none of the examples in the Programmers Reference actually work. They all fail on my machine! LoadRun(File) stalls on generating the toolpath. The LoadFile(Filename), RunFile() example does not work because it executes way too fast. RunFile() is executed while LoadFile is still working. The IsLoading() example doesn't work because IsLoading() goes false early, before LoadFile() is complete, or at least before Mach is ready for a Cycle Start. Here is an example that will work for sure. I'm running 3.043.022, but that shouldn't matter.
LoadFile("D:\Mach3\GCode\roadrunner.tap")
' Wait for Load to Complete
Do
Sleep 100
Loop While IsLoading() 'Wait until LoadFile reports that it is done.
Sleep(100) 'Extra sleep time to allow LoadFile to actually be complete
' Run the File
RunFile()
Logged
Sargon
Active Member
Offline
Posts: 99
Re: Using G-code files in Button Scripts
«
Reply #3 on:
August 12, 2011, 04:25:38 PM »
In regards to notepad, you may have to change the file type to "All Files (*.*)" for it to "Save As..." an extension other than .txt when writing from scratch. If it already has a different extension and you just hit "Save", it wouldn't change the extension, but otherwise it wants to make it .txt by default.
Give that a try.
Logged
BR549
Active Member
Offline
Posts: 2,557
Re: Using G-code files in Button Scripts
«
Reply #4 on:
August 12, 2011, 07:12:39 PM »
ALSO MAch does not CARE about the extention name It can be anything other than a control extention such as exe,dll,com,etc
As long as the content is Gcode it can read and run it.
(;-0 TP
Logged
Sargon
Active Member
Offline
Posts: 99
Re: Using G-code files in Button Scripts
«
Reply #5 on:
August 12, 2011, 07:18:05 PM »
Nice to know the exact extension limitations. Thanks.
Chris
Logged
BR549
Active Member
Offline
Posts: 2,557
Re: Using G-code files in Button Scripts
«
Reply #6 on:
August 12, 2011, 07:37:59 PM »
All of the programmers guide examples do work
LoadFile("D:\Mach3\GCode\roadrunner.tap")
While IsLoading() 'Wait until LoadFile is done.
Wend
RunFile()
OR JUST
LoadRun("D:\Mach3\GCode\roadrunner.tap")
(;-) TP
Logged
Sargon
Active Member
Offline
Posts: 99
Re: Using G-code files in Button Scripts
«
Reply #7 on:
August 12, 2011, 08:19:42 PM »
OK, I'll check on another machine. I only said I was surprised that they weren't working on my machine. This is a quad-core on Win7 64bit so that may be my problem. If that's it then it's the first script problem I've noticed on this configuration.
Thanks for confirming.
Chris
Logged
BR549
Active Member
Offline
Posts: 2,557
Re: Using G-code files in Button Scripts
«
Reply #8 on:
August 12, 2011, 08:42:22 PM »
32 bit is the standard.
(;-) TP
Logged
ger21
Global Moderator
Offline
Posts: 2,619
Re: Using G-code files in Button Scripts
«
Reply #9 on:
August 12, 2011, 08:58:32 PM »
A lot of things don't work properly without the PP driver installed, and it doesn't work on 64 bit.
I've found that just testing new screens without the driver installed resulted in a lot of things not working correctly.
Logged
Gerry
2010 Screenset
http://home.comcast.net/~cncwoodworker/2010.html
Pages:
1
2
3
4
5
»
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...