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

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

ITAsset
Not applicable
12 Views
2 Replies
Message 1 of 3

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

ITAsset
Not applicable

[ FlexSim 20.1.3 ]

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

38548-picture2.png

0 Likes
Accepted solutions (1)
13 Views
2 Replies
Replies (2)
Message 2 of 3

moehlmann_fe
Observer
Observer
Accepted solution

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?

Message 3 of 3

ITAsset
Not applicable

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