Hello
Guest
it is
April 24, 2024, 09:12:43 PM
Guest
Login
Register
Menu
Home
Help
Search
Calendar
Members
Members
View the memberlist
Search For Members
Login
Register
YouTube
Machsupport Forum
/
G-Code, CAD, and CAM
/
G-Code, CAD, and CAM discussions
/
G-Code access to Variables
« previous
next »
Print
Pages:
1
Go Down
Author
Topic: G-Code access to Variables (Read 2740 times)
0 Members and 1 Guest are viewing this topic.
cherokee140d
7
G-Code access to Variables
«
on:
August 11, 2012, 12:28:47 AM »
Does any one know a way of accessing Mach3 (not user) variables from within a G-code program.
e.g. get current x,y,z,a axis position or G52 offests or current speed,feed etc.
Fingers crossed
Thanks, John
Logged
ger21
6,295
Re: G-Code access to Variables
«
Reply #1 on:
August 11, 2012, 06:44:04 AM »
You can write M code macros to do it.
Logged
Gerry
2010 Screenset
http://www.thecncwoodworker.com/2010.html
JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
cherokee140d
7
Re: G-Code access to Variables
«
Reply #2 on:
August 11, 2012, 08:49:07 AM »
ger21
Thanks for the reply.
Will pursue.
John
Logged
Jmsandstrom
1
Re: G-Code access to Variables
«
Reply #3 on:
August 12, 2012, 07:18:05 PM »
I have some additional questions to this thread. I now know we can use the variables such as #1, #2, etc... instead of numerical constants. I have used some very simple expressions, but I am interested to use equality expressions to perform some housekeeping function while in a subroutine. Can something like #1=[#1-.25*[#2>0]] work (I know this doesn't) to perform conditional calculations? The equation #1=[#1-.25] works fine. I presume there is more capability to this....I just need a sample or a good reference document to go by.
Can anyone help with reference manuals or good examples?
Thanks,
John
Logged
ger21
6,295
Re: G-Code access to Variables
«
Reply #4 on:
August 12, 2012, 08:17:39 PM »
The manual lists the valid operations.
Logged
Gerry
2010 Screenset
http://www.thecncwoodworker.com/2010.html
JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Print
Pages:
1
Go Up
« previous
next »