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, 09:42:20 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
Mach SDK plugin questions and answers.
Plugin Access to GCode Window
Pages:
1
2
»
Go Down
« previous
next »
Author
Topic: Plugin Access to GCode Window (Read 615 times)
0 Members and 1 Guest are viewing this topic.
Monotoba
Active Member
Offline
Posts: 2
Plugin Access to GCode Window
«
on:
December 26, 2011, 06:10:11 AM »
Hi, I am new to writing plugins for Mach3 but I have written a few simple wizards. I am looking to move some of my wizards to plugins because debugging in MachScreen is difficult for large wizards. Most of my wizards simple write to the teach file when a user clicks the "Post GCode" button. My first attempt at using the OpenTeachFile() and CloseTeachFile() methods with the VS2008 Plugin wizard failed with unknown function calls. So what I need to know is:
1. Is there a way to write text (gcode) directly to the code window in the main Mach3 screen?
2. Are there functions that can be used to write and load the teach file from a C++ plugin?
3. I have been able to run my gcode right from my plugin but this gives no visual indication of the code execution... If there is no way to load a file into Mach from a plugin like you can from a wizard, then is my best approach simply add a textarea code window to my plugin?
Thanks for your input.
P.S. I have searched for similar post but found nothing and I do apologies if this has been answered before and I simply did not locate the post, or if I have posted this to the wrong area.
Logged
Steffen_Engel
Active Member
Offline
Posts: 29
Chattanooga, TN, USA
Re: Plugin Access to GCode Window
«
Reply #1 on:
January 12, 2012, 12:43:39 PM »
Hi,
I don't think there is a way to write code to the codebuffer of Mach3.
But you can write to a teachfile as you can do it with your wizards.
Generally spoken, you can do everything in a plugin what you do in a script, and something more
So I have moved some bigger VBA-Skripts to a plugin just by a VBA to C converter and a little handwork.
Code:
scripter.OpenTeachFile("teachtest.nc");
// some sample code for the teachfile
scripter.Code("G0X100Y100");
scripter.Code("G1Z-10");
scripter.Code("G1Z0");
scripter.Code("G0X0Y0");
// finish and load it
scripter.CloseTeachFile();
scripter.LoadTeachFile();
just tested this code, but I'm not working with the VS2008 wizard, I'm with VS 2003
regards,
Steffen
Logged
Monotoba
Active Member
Offline
Posts: 2
Re: Plugin Access to GCode Window
«
Reply #2 on:
January 12, 2012, 01:10:40 PM »
Thanks,
That is exactly what I needed since I can't go right to the buffer. What VB to C converter are you using?
Logged
Steffen_Engel
Active Member
Offline
Posts: 29
Chattanooga, TN, USA
Re: Plugin Access to GCode Window
«
Reply #3 on:
January 12, 2012, 02:01:17 PM »
I used
BCX
, this does the most stuff.
String concatenation had to be changed from VBA to C:
Quote
Code "G90G53G0Z" & PositionZ
to
Quote
Code(Format("G90G53G0Z%f", PositionZ));
then indent with my favorite settings:
Quote
indent -ts2 -npsl -bad -bap -bl -bli0 -di10 -bc -lp -l200 <filename>
Then of course the changes to better coding with the methods of C++
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Offline
Posts: 1,707
Briceville, TN, USA
Re: Plugin Access to GCode Window
«
Reply #4 on:
January 18, 2012, 06:55:50 PM »
not trying to argue,
but you can load and run g-code directly from within the plugin, as well as run VB scripts from within a plugin as well (i.e. Mach MAD does this).
Having said the above, though it is MUCH simple to just make "Macros" in VB then run those from within your plugin. You can have your Macros do those things
you want, and then the plugin call them.
scott
Logged
Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
Steffen_Engel
Active Member
Offline
Posts: 29
Chattanooga, TN, USA
Re: Plugin Access to GCode Window
«
Reply #5 on:
January 19, 2012, 10:06:58 AM »
You're right, but he wants to see the G-Code in the gcode window and the path preview.
This is only possible with loaded G-Code files, as far as I know.
Steffen
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Offline
Posts: 1,707
Briceville, TN, USA
Re: Plugin Access to GCode Window
«
Reply #6 on:
January 19, 2012, 08:01:50 PM »
I understand, but what I was saying was you can do just that.......
scott
Logged
Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
Steffen_Engel
Active Member
Offline
Posts: 29
Chattanooga, TN, USA
Re: Plugin Access to GCode Window
«
Reply #7 on:
January 19, 2012, 09:26:02 PM »
Also correct, you can do that.
But I have no idea, why you should use parts of your code back to this Basic-side, when you know how to code in Plugins.
Maybe to have user-changeable parts, but when there is no need for this, it is strange to go back into vba.
I also do not see, where VBA is simpler for people who already have plugins.
Steffen
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Offline
Posts: 1,707
Briceville, TN, USA
Re: Plugin Access to GCode Window
«
Reply #8 on:
January 20, 2012, 08:11:53 PM »
Steffen,
Yes it is a mystery why he would want to do it that way.........
Scott
Logged
Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
Steffen_Engel
Active Member
Offline
Posts: 29
Chattanooga, TN, USA
Re: Plugin Access to GCode Window
«
Reply #9 on:
January 21, 2012, 10:15:38 AM »
Huh? I do not understand?
He didn't want anything like that...
Steffen
Logged
Pages:
1
2
»
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...