- Posts: 3410
- Thank you received: 994
Save Variables
8 years 10 months ago #102788
by BigJohnT
Replied by BigJohnT on topic Save Variables
Pretty cool Todd, I assume you just wrote that off the top of your head and didn't get a chance to debug it. I took the liberty to debug and repost a working example. I need to add that to the docs. BTW, if you use %'s you don't need M2, if you use M2 you don't need the %'s because anything after M2 is ignored.
JT
Code:
(Use _count as your part count variable and create it if it doesn't already exist)
o10 if [EXISTS[#<_count>]]
(debug, _count exists and is #<_count>)
o10 else
(debug, _count does not exist setting to 0)
#<_count>=0
o10 endif
(insert the g-code to make your part here)
#<_count>=[#<_count>+1]
(debug, Part count is now #<_count>)
M2
JT
The following user(s) said Thank You: HalaszAttila
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
-
Less
More
- Posts: 4737
- Thank you received: 1480
8 years 10 months ago #102791
by Todd Zuercher
Replied by Todd Zuercher on topic Save Variables
Actually, most of that was lifted directly from the doccumentation, here
linuxcnc.org/docs/html/gcode/overview.html#gcode:functions
(Most of the time I don't bother with % signs, not sure why I stuck them in this time.)
linuxcnc.org/docs/html/gcode/overview.html#gcode:functions
(Most of the time I don't bother with % signs, not sure why I stuck them in this time.)
Please Log in or Create an account to join the conversation.
8 years 10 months ago #102795
by BigJohnT
Replied by BigJohnT on topic Save Variables
Please Log in or Create an account to join the conversation.
Time to create page: 0.178 seconds