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, 09:27:46 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
speed of execution of macro
Pages:
1
2
»
Go Down
« previous
next »
Author
Topic: speed of execution of macro (Read 845 times)
0 Members and 1 Guest are viewing this topic.
moorea21
Active Member
Offline
Posts: 88
speed of execution of macro
«
on:
December 24, 2010, 11:40:31 AM »
Hi,
As part of what I'm doing, it looks like I need to write a macro that I will call from Gcode quite often. maybe 40 times a second... ie one call on each line.
My question is, how long (in microseconds I guess) does it take to call, execute and exit from a macro? The macro will only be about 5 lines long.
Any ideas?
Thanks, Richard B
Logged
moorea21
Active Member
Offline
Posts: 88
Re: speed of execution of macro
«
Reply #1 on:
December 24, 2010, 11:50:21 AM »
The macro will move an axis to 3 different positions in sequence, at full speed.
Logged
BR549
Active Member
Offline
Posts: 2,555
Re: speed of execution of macro
«
Reply #2 on:
December 24, 2010, 12:48:29 PM »
It all depends on how busy the CPU is as each macro is called. Also NOTE using a macro there is NO garranty that all the calls will stay in synced. The basic VB loop only cycles at 10 cycles per sec IF it has time to get it all done in one loop then maybe ,maybe not.
Rememeber Mach is a GCODE machine motion controller it processes basic machine GCODE very well. Using it ouside of those parameters and you are pretty much in unknown territory.
From what I see you have pretty extreme paramaters to follow machine wise. MOve an axis to 3 sequential positions up to 40 times per sec at full speed AND process the macro up to 40 times per sec when the basic macro loop is 10 cycles per sec.
HECK give it a whirl and let us know if it works, (;-) TP
«
Last Edit: December 24, 2010, 12:51:33 PM by BR549
»
Logged
moorea21
Active Member
Offline
Posts: 88
Re: speed of execution of macro
«
Reply #3 on:
December 24, 2010, 03:48:22 PM »
At the moment, the gcode runs at about that speed, with one command for the axis in question on each line. But there are god reasons to use a macro, related to file size... it's a bit more involved than that. The other alternative would be to use a supplementary output pin on my controller to trigger a picaxe microcontroller to perform the 3 positions thing.
I didn't know that macros might not be executed in the order they are written in.
Does anyone know a way around that?
Logged
moorea21
Active Member
Offline
Posts: 88
Re: speed of execution of macro
«
Reply #4 on:
December 24, 2010, 03:57:30 PM »
Re my last post : - I'm assuming when you say 'NOTE using a macro there is NO garranty that all the calls will stay in synced" you mean that they could be executed in the wrong order? Could the problem be solved by adding
While IsMoving()
Sleep 10
Wend
into the macro, so that the cpu is likely to be free, and no other axes would move at the same time, so no sych problems?
Logged
moorea21
Active Member
Offline
Posts: 88
Re: speed of execution of macro
«
Reply #5 on:
December 24, 2010, 04:03:27 PM »
Re "The basic VB loop only cycles at 10 cycles per sec"... does that mean you only have 1/10th of a second to execute the whole macro?
Logged
rrc1962
Active Member
Offline
Posts: 434
Re: speed of execution of macro
«
Reply #6 on:
December 24, 2010, 04:04:28 PM »
You don't need "Sleep 10" inside the loop. an empty IsMoving() while loop will just loop until IsMoving() = false.
Logged
rrc1962
Active Member
Offline
Posts: 434
Re: speed of execution of macro
«
Reply #7 on:
December 24, 2010, 04:08:00 PM »
Quote from: moorea21 on December 24, 2010, 04:03:27 PM
Re "The basic VB loop only cycles at 10 cycles per sec"... does that mean you only have 1/10th of a second to execute the whole macro?
Basically, yes. The number of cycles depends on the macro. A slow running macro may only be able to execute 5 times per second. As long as the macro can finish in less than 1/10 of a second, the best you can hope for if 10 cycles per second. Brains are much faster, but I don't think you can do what you want to do in brains.
Logged
moorea21
Active Member
Offline
Posts: 88
Re: speed of execution of macro
«
Reply #8 on:
December 24, 2010, 04:16:34 PM »
Not familiar with brains... I like the idea of something much faster than a macro, though.
The macro would be basically:-
While IsMoving()
Wend
Code G01 A2.5
Code G01 A0
Code G01 A1.7
That's all...
Logged
BR549
Active Member
Offline
Posts: 2,555
Re: speed of execution of macro
«
Reply #9 on:
December 24, 2010, 04:20:11 PM »
each time a macro is called it is opened in its own thread. It is also known that mach can skip over open threads that take too long and the results fall out of exact sync. I have also seen where a data loop was skipped over but showed up several cycles later.
Mach VB macro system is not perfect BUT works ok inside of what it was designed for.
CAN you design the system to RUN from straight Gcode? Mach does that part very well and fast.
Brains last I heard scanned at 10hz as well. the internals are much faster but IF you have to gather/scan data it will be at 10 cycles per sec as well.
OK looking at you last message IF you are just doing basic Gcode WHY wash it through a macro??? Could Gcode SubProgram work in place of the macro call?
Just a thought, (;-) TP
«
Last Edit: December 24, 2010, 04:22:50 PM by BR549
»
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...