question

mikelmb avatar image
0 Likes"
mikelmb asked Jason Lightfoot edited

Error in condition doesn't close the port when needed

Hello,

We are trying to simulate a demand, and have defined a condition in the sink (on entry):

gettablenum(label(current,"ItemCounts"),item.Type,1)>=gettablenum("demand",CurrentHour+1,item.Type)

The values of both sides of the condition are going good but then the port is not closed as needed. The variables affecting the condition are also correct and we do not know why the port is closing when the "demand" table has not reach all the units.

I attach the model in case you can give me a hand: Warehouse.fsm

Thanks,

FlexSim 22.1.4
portssinkoutput portinput portcondition
warehouse.fsm (63.2 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

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot edited

The first time the condition evaluates true your item's Type is 2 and you are using the input port 2 of the sink to determine which object's port to close. The sink only has one input so the involved pointer is invalid. You may want to try replacing

  1. inobject(current, item.Type)

with

  1. current.inObjects[1].inObjects[item.Type]

which will refer to the object feeding the Queue on the specified port.

· 9
5 |100000

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