question

Joe N avatar image
0 Likes"
Joe N asked Joe N commented

Photo Eye Error

I am working on a simulation and would like to use the on clear function to send a message while also changing the clear time to a value other than 0. When I change the clear time I keep getting an error in my model.

I made a simple example model for reference of the error I am receiving. When you set the clear time to 0 the error goes away. Am I missing something or is this a bug?

photo-eye-error.fsm

FlexSim 17.2.5
error messagephoto eyeflexsim 17
photo-eye-error.fsm (26.9 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

·
Matthew Gillespie avatar image
1 Like"
Matthew Gillespie answered Joe N commented

I assume you're referring to this error?

time: 350.406016 exception: FlexScript exception: Invalid item in Conveyor.itemData[] call at MODEL:/PE1>variables/localType/clearTrigger

This is being caused by the 4th line in that OnClear trigger's header:

Conveyor.DecisionPoint current = param(1);
Object item = param(2);
Conveyor conveyor = param(3);
Conveyor.Item conveyorItem = conveyor.itemData[item];

When this trigger finally fires at time 350, the original item is now long gone and doesn't exist. So when the 4th line tries to use it it throws an exception.

You can just delete that 4th line and the error will go away. We'll look into a way of making that line in the header better handle cases like this.

· 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.

Joe N avatar image Joe N commented ·

Thank you Matthew!

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.