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 27, 2012, 08:19:31 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
Executing Macros during GCode-Runtime
Pages:
1
Go Down
« previous
next »
Author
Topic: Executing Macros during GCode-Runtime (Read 639 times)
0 Members and 2 Guests are viewing this topic.
GlennDanzig
Active Member
Offline
Posts: 4
Executing Macros during GCode-Runtime
«
on:
December 14, 2010, 11:02:52 AM »
Hello Everybody,
iam new to Mach3 and iīve some simple questions, ok?
1. Is a complete overview or something like that available for the visual elements of the mach3 screens? Or what is the trick to adress(read and write values) fields which are not available via OEM-Code?
2. I need the possibility to execute a macro on every line (or even better a predefined string in a Codeline) of a GCODE(Because we do not want to manipulate the Code before adding it to Mach3). How will i do that? My Idea is to analyse the execution of the gcode via the macropump script. IF GCODE-Line >X the execute my macro. How can i call a seperate macro through the macropump or must be the whole within the macropump-script?
- How will i best do some certain tasks like moving on the Zaxis ->mechanical press action(is this the right term, donīt know it in english)? ---- via "executing new Gcode-Commands" - if so, how will i do that? Can i use the mdi for that? Or is it better to create my own button and press this via macro/macropump?
- How will i do a "break" after each step of the gcode, before executing my task/code? First press Stop-Button, then execute my code, wait for response of machine and the press start button?
- Is it to dangerous to execute external macros via macropump?
- What are the alternatives?
..... iam confused......
Thanks for your help!
Glenn
Logged
BR549
Active Member
Offline
Posts: 2,555
Re: Executing Macros during GCode-Runtime
«
Reply #1 on:
December 14, 2010, 05:54:27 PM »
1. In the VB macro enviroment IF it is not an oem/user element as defined in the manual then you cannot access that element.
2. You can run a macro on every line if you like. It is a bad idea to call a macro from inside another macro. To run a predifined Gcode segment use the subprogram approach.
axis motion is controlled via Gcode
You cannot break after each line of code easily. Remember MACH is a Gcode CNC motion controller . It does not always make a good general purpose motion controller.
Yes it can be dangerous to execute an external macro from inside the macro pump. Depends on the machine. The macro called from the macro does not have time sync and the results can be irratic and unpredictable at times.
Sound like you need a general purpose motion controller.
Just a thought, (;-) TP
Logged
GlennDanzig
Active Member
Offline
Posts: 4
Re: Executing Macros during GCode-Runtime
«
Reply #2 on:
December 15, 2010, 08:54:27 AM »
Hello TP,
first of all - thanks for your answer! But iīve some further question - can you please help me with that?
1. Manual - ok, what document exactly did you mean? Do you have a link?
2. How can i access(read) the element "Line" in the 1024.set- Screen? It shows the actual gcodeline, but when i open it with the screendesigner, it shows nothing how to access this element (oem: 0, ScanCode:0) only the button "Current G-Codeline" is active -->but how to access that without any ID? Via internal Mach3-functions? But how are their names?
3. What are the differences between elements with oemnumbers and scancodes?
4. Why canīt i break after every gcode-line easily? Via macropump? I think there must be an event or something like that, when a codeline is ended or a new line begins, or not? Or how recognises the above mentioned "Currentline"-Element the lineswitches? Then i can manually stop that gcode from further processing and can execute my code(macro or sub), wait for an answer or signal or something like that, end my sub/macro and start the original gcode-execution - or is there something missing. Isnīt is possible to start an interrupted gcode from the last position?
5. how exactly is a macro called from within the macropump? I think you are right to do it with subs, but it can be interesting generally.
6. General Purpose Controller - no i think Mach3 can do it!
7. do you know a free cam-software(which you prefer), which can be used to extend gcode with some extra lines(After every line, there must be inserted a extra Gcodeline(Axismovment)). I donīt want to write my own VB/C#-Programm to add these lines in a second process. This is my second approach to solve my problems:-)
Thanks in advance!
Glenn
Logged
BR549
Active Member
Offline
Posts: 2,555
Re: Executing Macros during GCode-Runtime
«
Reply #3 on:
December 15, 2010, 10:08:11 AM »
1 the mach3 manual look at teh documentation on the main page
2 you need to look in the Mach VB programmers manual and the Mach customizing manual for details
3 you need to use the OEM/user codes as they are the only ones accessable from VB
4 Breakinbg after each line is NOT easy as mach calculates the line then SENDS it to the buffer. there can be many lines of data in the buffer and once there YOU Have little to no control of the process. LIKE I said mach is a GCODE CNC controller and is designed with that exact process in mind. NOT general motion control. MACH is not a realtime motion controller so there ARE things that cannot be synced properly like a normal realtime motion controller can do.
5 Check the manual
6 Anything is possible to a point BUT is it effective and does it work well (;-) Been there many times just to say it could be done but was not effective in the real world.
7 No, Most cams were dwesigned to interput a drawing into Gcode not solve motion control problems(;-) Even then you would need to develope a custom POST to do the insertion of your additional gcode.
Hope it helps, (;-) TP
«
Last Edit: December 15, 2010, 10:11:52 AM by BR549
»
Logged
GlennDanzig
Active Member
Offline
Posts: 4
Re: Executing Macros during GCode-Runtime
«
Reply #4 on:
December 15, 2010, 10:43:00 AM »
Hello TP,
ok.ok.ok.ok....... understand that and keep your words in mind! Thanks!
Two last questions before i read the whole mentoined documentation;-)
1. Even in the Mach3_V3.x_Macro_Prog_Ref.pdf is no reference to the function, how to get the active, processed line from the gcode -->Field "Line" in 1024.set -->how can i read values from it?
2. You said "Mach is not a realtime motion controller" - what does that exactly mean? If i break the processing of the gcode at the end of the e.g. line6 - via macropump(10 times per second, right?) - then process is stopped, right? Or is the process further than i think, because of the buffer etc.? -->will it be better to run in singlestep-mode? Is there a possbility to check via macropump, that gcode-execution is in singlestep-mode and one step is over? Is there a dro that i can use for that? And what will it be?
Thanks in advance
Glenn
Logged
BR549
Active Member
Offline
Posts: 2,555
Re: Executing Macros during GCode-Runtime
«
Reply #5 on:
December 15, 2010, 11:15:50 AM »
Glen as far as I know you cannot get the processed " line " that is an internal function and we don't have access to it.
To make sure I understand you , you want the current Gcode line of code? before it is processed into moves and loaded into the buffer?
Note:starting and stopping and starting and stopping the Gcode process can be loaded with problems. Mach is not as good at the restarting midprogram thing as it could be. I does work but "I "would NOT trust it as an automated process controlled by VB. For it to work correctly a lot of things need to be recycled as to modal values and such to be successfull.
(;-) TP
Logged
BR549
Active Member
Offline
Posts: 2,555
Re: Executing Macros during GCode-Runtime
«
Reply #6 on:
December 15, 2010, 11:51:24 AM »
Perhaps a better way to do this would be to create a WIZARD that could compile what you need into a Gcode program then run it.
Wizards are covered in the Mach2 customising manual (;-)
Just a thought, (;-) TP
Logged
Pages:
1
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...