question

IT Asset avatar image
0 Likes"
IT Asset asked IT Asset commented

Model crashing after specific code debug point but I'm not sure why

I have a debug point in a custom code block of my model. When I run the model I can run up to the second time this debug point stops it. After the second stop, if I step to the next line the model stops responding and appears to increase it's memory use until it eventually closes. I am not sure if my computer is forcing it to close or if something in the program closes it.

I am hoping you can help me better understand the actual source of this crashing so I can correct it. The line of code that appears to trip it up is assigning a token label to an integer variable in the custom code block. From what I can see at a surface level, I can not understand why this would make the model crash as the token has a value assigned to that label. Older files I have run past this point with no issue and the latest changes I made (adding another Process Flow and some 3D objects) have no interaction with this point. In fact I assign a macro value that I use to turn the new additions "off" so there is nothing running from that process flow at the time of the crash.

20.1 Model 4.14.2021 Add Press Area_NewData_noDrawing.fsm

FlexSim 20.1.3
flexsim 20.1.3flexsim crashing
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

Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered IT Asset commented

The line where the breakpoint is set is not the problem. It lies in the "ItemTransferIn" activity that follows in the next block after the one where you set the breakpoint and caused by the second first token to go through the activity. There you declare the following variable:

string vsItemInstanceId = token.item.liUniqueID + "-" + token.item.lsCellName;

The item referenced is being destroyed at the end of the "Flow for Layouts" after the token that goes through this activity is created. (Depending how the timing works out, it might still exist as both activities happen "at the same time".) But as far as I could tell, that item doesn't hold the labels referenced here anyway. Did you mean to take the values from the token itself?

· 1
5 |100000

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

IT Asset avatar image IT Asset commented ·

Oh jeez, I intended to reference a different item but it isn't even created yet. Moved that code block to the correct location.

Thank you so much!

0 Likes 0 ·