question

Andres Pallaro avatar image
0 Likes"
Andres Pallaro asked Jason Lightfoot edited

opavailable problem on a send to port logic

Hello,

I am working on an special logic on the sent to port of a queue (Buffer1) where I modified the code to send specific product according to some fields.

I identified a problem where this Buffer1 does not send all the product it can to its outputs (M1, M2...). I tracked it down and foun out the command opavailable(Model.find("Buffer1"),1) is not workingas expected. For example on second 426 Queue M1 has still space but the command output is "0" istead of "1". This happens also in other cases and causes inefficiencies on the model logic.

Is there something wrong?

POC_Test stations entry logic and table_3.fsm1643696253352.png

Thanks!

@Julio R

FlexSim 22.0.1
sendtoportopavailable
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

·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Jason Lightfoot edited

Reevaluating the send to port code for each item every time an item exits a downstream queue (to allow for previously unreleased items to be transported) means that items that were already released are counted multiple times. This "clogs" up the internal logic of the port connections as they might then be expected to arrive at multiple objects, but only do so once (creating "ghost items", so to speak).

To prevent this I add a label "released" to an item if it is successfully released and terminate the code early if that label is present on an item when the logic gets reevaluated.

poc-test-stations-entry-logic-and-table-4.fsm


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

Jason Lightfoot avatar image Jason Lightfoot ♦ commented ·

You might also be able to test the item state instead of using a label.

getitemstate(item)==FRSTATE_READY

Here's an example showing the states:

1643717335147.png

FRState.fsm

3 Likes 3 ·
1643717335147.png (68.0 KiB)
frstate.fsm (41.6 KiB)

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.