Why is my"if statement" not working

Why is my"if statement" not working

ting_wei_h
Not applicable
39 Views
4 Replies
Message 1 of 5

Why is my"if statement" not working

ting_wei_h
Not applicable

[ FlexSim 22.2.2 ]

I'm recently learning how to code in Flexsim. I'm trying to make the color of the first 1000 products blue and the label value are 3, the other are red and the label value are 1. But when the output of the product exceeds 1000, it does not turn into red but is always blue, and the label value didn't change either . Please can someone tell me where is my problem.

1665995428237.png

0 Likes
Accepted solutions (1)
40 Views
4 Replies
Replies (4)
Message 2 of 5

jason_lightfootVL7B4
Autodesk
Autodesk
Accepted solution

Are you creating more than 1000 in one event? If so the output statistic will not be updated when the creation trigger fires.

Place a breakpoint in your code to debug what is happening.

Message 3 of 5

ting_wei_h
Not applicable

Yes, I tried to create 31500 boxes in "Arrival Sehedule", So the output statistic cannot be used in this simulation?

1666237879900.png

0 Likes
Message 4 of 5

jason_lightfootVL7B4
Autodesk
Autodesk

It can if you use the exit trigger instead of creation. At the time of creation none have exited.

0 Likes
Message 5 of 5

ting_wei_h
Not applicable

It worked!!! I really appreciate your help.

0 Likes