question

Kirk W avatar image
0 Likes"
Kirk W asked Joshua S answered

Wait for Event with Photo Eye

I am having trouble using a Wait for Event in process flow where I am using an OnClear event for a photo eye. It seems that if this photo eye is already clear (on model reset) the token is not released from this wait for event. There is no such option such as on conveyor content change where you can "fire if initial value meets rule". I would think there would be something similar where if the photo eye is already clear it would release the token.

What is the wait for event looking for in regards to the photo eye? Is it looking at stat states such as 1 for clearing, 2 for clear, 3 for blocking and 4 for blocked?

If this wait for event is looking at the states, what state does a photo eye start out as on model reset? How could I code an initialization of the state = 2 for clear (I have a whole block of code that runs on model reset that I could add this to)?

Thanks!

FlexSim 18.1.1
wait for eventphoto eye
· 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.

tannerp avatar image tannerp commented ·

@Kirk W Did this help answer your question?

0 Likes 0 ·

1 Answer

Joshua S avatar image
0 Likes"
Joshua S answered

The clear state on reset is 1, here is a block of code to read the current state of the photo eye

(Your_Photo_Eye_Object).attrs.state_current.value
5 |100000

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