question

Brad Champeau avatar image
0 Likes"
Brad Champeau asked Sam Stubbs answered

What does this photo eye error mean?

I am using a photoeye to control a motor. When blocked for two seconds it should shut the motor off, when cleared for 1 second it should turn the motor back on. The photoeye indicates its blocked but the conveyor does not stop. I am getting the following message from the system console "time: 1205.277804 exception: FlexScript exception: MODEL:/PE1>variables/localType/blockTrigger". What's going on?

FlexSim 17.1.0
photo eye type
· 2
5 |100000

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

Sam Stubbs avatar image Sam Stubbs ♦ commented ·

Do you mind posting a model so that we can see the full context of the error?

0 Likes 0 ·
Brad Champeau avatar image Brad Champeau commented ·

conveyor-play.fsm @Sam Stubbs Here's the model.

0 Likes 0 ·
conveyor-play.fsm (21.9 KiB)

1 Answer

·
Sam Stubbs avatar image
0 Likes"
Sam Stubbs answered

The exception is being thrown because you are calling the stop motor on conveyor.motor. conveyor.motor looks for the motor connected to the current conveyor segment on which the trigger fires. And in your model the motor is not connected to that current segment. So instead of using the default conveyor.motor, use the center port connection that you made and call the stop motor on current.centerObjects[1], That should work.

5 |100000

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

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.