Save Variables

More
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.
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.

More
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.)

Please Log in or Create an account to join the conversation.

More
8 years 10 months ago #102795 by BigJohnT
Replied by BigJohnT on topic Save Variables
I'm thinking of adding that to this section
linuxcnc.org/docs/2.7/html/examples/gcode.html
JT

Please Log in or Create an account to join the conversation.

Time to create page: 0.178 seconds
Powered by Kunena Forum