Repeat loop
- mariusl
- Topic Author
- Offline
- Platinum Member
26 May 2015 15:39 #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 or Create an account to join the conversation.
- ArcEye
- Offline
- Junior Member
Less
More
- Posts: 25
- Thank you received: 761
26 May 2015 17:35 #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 or Create an account to join the conversation.
- mariusl
- Topic Author
- Offline
- Platinum Member
26 May 2015 17:49 #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 or Create an account to join the conversation.
- ArcEye
- Offline
- Junior Member
Less
More
- Posts: 25
- Thank you received: 761
26 May 2015 17:59 - 26 May 2015 18:01 #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
Last edit: 26 May 2015 18:01 by ArcEye.
Please Log in or Create an account to join the conversation.
- M4MazakUser
- Offline
- Elite Member
Less
More
- Posts: 187
- Thank you received: 5
01 Nov 2024 06:59 #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 or Create an account to join the conversation.
- Aciera
- Offline
- Administrator
Less
More
- Posts: 3946
- Thank you received: 1705
01 Nov 2024 09:44 #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 or Create an account to join the conversation.
- M4MazakUser
- Offline
- Elite Member
Less
More
- Posts: 187
- Thank you received: 5
03 Nov 2024 23:48 - 03 Nov 2024 23:48 #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.
Last edit: 03 Nov 2024 23:48 by M4MazakUser. Reason: Extra stuff
Please Log in or Create an account to join the conversation.
Time to create page: 0.080 seconds