loop with several parts and conditions
- christian99x
- Offline
- New Member
Less
More
- Posts: 14
- Thank you received: 0
19 Jul 2020 17:39 #175169
by christian99x
loop with several parts and conditions was created by christian99x
Please take a look at the attached program. The intention is, that you can configure how many pieces of part_a and part_b you want to mill (up to total 9).
Unfortunately if count_part_b is 0, part_b is milled though. In this case I would actually expect elseif in line #53 not to be true and the operations below being skipped, but that's not the case.
Can somebody explain why?! Thanks!
Unfortunately if count_part_b is 0, part_b is milled though. In this case I would actually expect elseif in line #53 not to be true and the operations below being skipped, but that's not the case.
Can somebody explain why?! Thanks!
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19200
- Thank you received: 6436
19 Jul 2020 17:56 #175172
by tommylight
Replied by tommylight on topic loop with several parts and conditions
Attachments:
Please Log in or Create an account to join the conversation.
19 Jul 2020 19:49 #175190
by MaHa
Replied by MaHa on topic loop with several parts and conditions
The while loop is cycling trough, until #<position> reached 9. To avoid that, after countdown a+b reached 0, insert this after the position counter. ' #<position> = [#<position> + 1] '
o115 if [[#<count_part_a> EQ 0] and [#<count_part_b> EQ 0]]
o100 break
o115 endif
Please Log in or Create an account to join the conversation.
- christian99x
- Offline
- New Member
Less
More
- Posts: 14
- Thank you received: 0
21 Jul 2020 16:59 #175352
by christian99x
Replied by christian99x on topic loop with several parts and conditions
Thanks for your feedback!
In the meantime I found the (a) solution by myself: if I create a new "if" instead of using "elseif" it's working like expected. Still I don't understand why "elseif" is not working. I thought "elseif" and a new "if" has the same effect?!
@tommylight:
Try it with 2 part a and 2 part b! ...and yes, I know that M2 etc is still missing. I wanted to get the loop working first and camotics (which I use for visualising the gcode) is not complaining about it !
@MaHa
Did you try it with a mixture of parts? I don't think it helps....
In the meantime I found the (a) solution by myself: if I create a new "if" instead of using "elseif" it's working like expected. Still I don't understand why "elseif" is not working. I thought "elseif" and a new "if" has the same effect?!
@tommylight:
Try it with 2 part a and 2 part b! ...and yes, I know that M2 etc is still missing. I wanted to get the loop working first and camotics (which I use for visualising the gcode) is not complaining about it !
@MaHa
Did you try it with a mixture of parts? I don't think it helps....
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19200
- Thank you received: 6436
21 Jul 2020 17:47 #175354
by tommylight
Replied by tommylight on topic loop with several parts and conditions
Attachments:
Please Log in or Create an account to join the conversation.
21 Jul 2020 18:18 - 22 Jul 2020 16:47 #175356
by MaHa
Replied by MaHa on topic loop with several parts and conditions
Warning: Spoiler!
Last edit: 22 Jul 2020 16:47 by MaHa.
Please Log in or Create an account to join the conversation.
Time to create page: 0.167 seconds