Flow statements, while and if

Hi,

I can’t wrap my head around for the reason why my simulation runs wildly when using a while loop to create bunch of pallets for a conveyor loop. But when the exact same thing is done with an if flow statement, it works as it should? Am I wrongly using the while-loop, or is it a bug?

Here’s an example what I mean.

Regards,
Joonas

whileandiftest.vcmx (605.2 KB)

You should reset your variable “ProductIn” in your while-loop:

grafik

3 Likes

Hi,

Thanks! This solves it. And it kinda makes sense! :smiley:

Regards,
Joonas