question

Jimmy jang avatar image
0 Likes"
Jimmy jang asked Jimmy jang answered

Flexsscript exception:Invalid down cast

Good day i am getting 2 types of exceptions while running the simulation.

the exception message are
1.
exception : Flexscript exception : Invaild down cast. Object is not an instance of the target type. at MODEL:/Tools/ProcessFlow/Stop
2.

exception : Flexscript exception : Invaild down cast. Object is not an instance of the target type. at MODEL:/Tools/ProcessFlow/ Resume

Both Stop and Resume are used Custom Code -> Stop/Resume Item on Conveyor

Please help solve the problem.

sorry that i can not upload my model.
if you need more information please let me know.


FlexSim 24.1.1
exception
5 |100000

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

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Felix Möhlmann commented

Most likely the item you are trying to stop/resume is not on a conveyor when the code is executed. Inside the code the object that the item is currently in is cast as a conveyor class object. This will fail and prompt the error message if the object does not belong to that class.

· 4
5 |100000

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

Jimmy jang avatar image Jimmy jang commented ·
Thank you for the answer.

currently i am trying to send and stop the tote on the straight conveyor.
i have put multiple decision point
and mapped the decision point to a token.
i have used Wait for Event to wait until the tote has arrive on the decision point on the straigh conveyor.
Then i use Custom code to Stop and Resume. (Stop/Resume Item on
Conveyor)

I have realized that as you already gave tip about. the tote stops after it pass the decision point. when limited totes are on the conveyor there is no exception. but if the Qty goes up it has error

is there any tips for this?

Thank you

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Jimmy jang commented ·
Does the stop occur immediately after the Wait for Event activity. Because then there shouldn't be an issue. Can you share a screenshot of the relevant Process Flow section? And are there any trigger functions defined on the decision points?
0 Likes 0 ·
Jimmy jang avatar image Jimmy jang Felix Möhlmann commented ·

스크린샷 2024-10-17 오후 10.46.21.png

Sorry for the inconvenience

this screenshot is the best that I can share.

there are 26 decision points on a 60 meter straight conveyor

and I am tracking the location to stop by using mapping a tote call destination and

Model.find("DP" + token.Tote.first.labels["DP"].value)


Also I am using Wait for Event tab

to wait for On Arrival of Model.find("DP" + token.Tote.first.labels["DP"].value)


please let me know if there are any way to solve the error message


For you information. there are no trigger function on decision point

0 Likes 0 ·
Show more comments
Jimmy jang avatar image
0 Likes"
Jimmy jang answered

Thank you the problem has been solved. It has been a great help!!

Thank you again for your prompt reply

5 |100000

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