- Posts: 752
- Thank you received: 0
Repeat loop
11 years 5 months ago #59064
by mariusl
Regards
Marius
www.bluearccnc.com
Repeat loop was created by mariusl
Hi
Does the statement "repeat [5]" count from 0 to 5 or from 1 to 5?
Does the statement "repeat [5]" count from 0 to 5 or from 1 to 5?
Regards
Marius
www.bluearccnc.com
Please Log in to join the conversation.
11 years 5 months ago #59069
by ArcEye
Replied by ArcEye on topic Repeat loop
It does 5 iterations.
Whether it effectively does
for(x=0; x < 5; x++)
or
for(x=1; x <= 5; x++)
I don't know.
I would guess the former, as it is far more standard.
regards
Whether it effectively does
for(x=0; x < 5; x++)
or
for(x=1; x <= 5; x++)
I don't know.
I would guess the former, as it is far more standard.
regards
Please Log in to join the conversation.
11 years 5 months ago #59071
by mariusl
Regards
Marius
www.bluearccnc.com
Replied by mariusl on topic Repeat loop
I was actually wondering if it did 5 or 6 repeats.
Regards
Marius
www.bluearccnc.com
Please Log in to join the conversation.
11 years 5 months ago #59072
by ArcEye
Replied by ArcEye on topic Repeat loop
It should do 5
linuxcnc.org/docs/html/gcode/o-code.html#sec:repeat
Put a (debug, "comment") inside the example loop and see how many times it prints
I don't actually use it, it never used to exist and I just got used to using a parameter as a counter and incrementing it, so tend to do that automatically.
I don't think there is any option to use it in do{}while() fashion and effectively increase the number of loops by one.
regards
linuxcnc.org/docs/html/gcode/o-code.html#sec:repeat
Put a (debug, "comment") inside the example loop and see how many times it prints
I don't actually use it, it never used to exist and I just got used to using a parameter as a counter and incrementing it, so tend to do that automatically.
I don't think there is any option to use it in do{}while() fashion and effectively increase the number of loops by one.
regards
Please Log in to join the conversation.
- M4MazakUser
- Offline
- Premium Member
-
Less
More
- Posts: 149
- Thank you received: 0
1 year 11 months ago #313576
by M4MazakUser
Replied by M4MazakUser on topic Repeat loop
Hey, does anyone know if the number of repeats remaining is a readable parameter?
Please Log in to join the conversation.
1 year 11 months ago #313595
by Aciera
Replied by Aciera on topic Repeat loop
Not that I'm aware. But you could of course implement a counter using your own parameter value.
Please Log in to join the conversation.
- M4MazakUser
- Offline
- Premium Member
-
Less
More
- Posts: 149
- Thank you received: 0
1 year 11 months ago #313733
by M4MazakUser
Replied by M4MazakUser on topic Repeat loop
Yeah, I just wanted to read the value of "L" it would be great if I could display it in a pyvcp panel. This is on a barfeed machine.
Please Log in to join the conversation.
Time to create page: 0.088 seconds
