question

Ryan_Wei avatar image
0 Likes"
Ryan_Wei asked Ryan_Wei commented

Why is my"if statement" not working

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

FlexSim 22.2.2
flexscriptcodingusing code
1665995428237.png (22.8 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

·
Jason Lightfoot avatar image
1 Like"
Jason Lightfoot answered Ryan_Wei commented

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.

· 3
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Ryan_Wei avatar image Ryan_Wei commented ·

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

1666237879900.png

0 Likes 0 ·
1666237879900.png (9.5 KiB)
Jason Lightfoot avatar image Jason Lightfoot ♦ Ryan_Wei commented ·

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

0 Likes 0 ·
Ryan_Wei avatar image Ryan_Wei Jason Lightfoot ♦ commented ·

It worked!!! I really appreciate your help.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.