question

Martin K6 avatar image
0 Likes"
Martin K6 asked Martin K6 commented

How to detect if specific resource is aqcuired by code?

Hi,

I would like to ask how can I detect if specific resource is already acquired by code or in another way in decide block? There is a situation in my model that I try to acquire a resource that is already acquired by that object and it stays in this position and the token is not released until it acquires it once again which is impossible.

Thank you.

FlexSim 22.2.0
codeacquire resourcedecide
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

Ralf Gruber avatar image
2 Likes"
Ralf Gruber answered Martin K6 commented

Martin,

rather than a decide activity, just try another acquire with a max wait timer of zero and a destination 2, when timer is fired:

acquirewaittimer.png

With these settings, if the resource can be acquired successfully, the token will proceed through connector 1, but if the resource cannot be acquired immidiately (meaning it is acquired somewhere else), the token leaves through connector 2.

Is this what you were looking for?



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

Martin K6 avatar image Martin K6 commented ·

Hi,

yes, this is what I was looking for.


Thank you

0 Likes 0 ·