The "value" you push to the list is the item. To get from there to the Storage.Slot it is currently in, you first have to contruct the respective Storage.Item class object. From there you can access the slot with "Storage.Item.currentSlot".
Storage.Slot slot = Storage.Item(value).as(Storage.Item).currentSlot;
int SlotContent = slot.slotItems.length;
// This returns all items currently assigned to the slot
return SlotContent;
However, not all items "assigned" to the slot, and thus part of the slotItems array, have to be in the slot. In your case, since you call the Slot Assignment Strategy in the separator entry trigger, the items are already part of the array, as soon as that trigger is evaluated.
To get the actual number of items currently in the slot, you have to check the Storage.Items current state (Unassigned, Inbound, Stored, Outbound).
https://docs.flexsim.com/en/20.2/Reference/CodingInFlexSim/FlexScriptAPIReference/Warehousing/Storag...
Storage.Slot slot = Storage.Item(value).as(Storage.Item).currentSlot;
// To get the number of items actually in the slot, we go through
// the slotItems and see if their current status is 'stored'
int SlotContent = 0;
for(int index = 1; index <= slot.slotItems.length; index++)
{
if(slot.slotItems[index].storageItem.state == 3)
{
SlotContent++;
}
}
return SlotContent;The calculation in the separators entry trigger is also off by one, meaning one more item gets assigned to the slot than actually unpacked.
Finally, the queue is simply set to have a maximum content of one, thus blocking any further input.
findslot-storagesystem-2.fsm
Edit: More about the transport:
As Jordan mentioned, since you move the item with the "moveobject" command, the queue still expects another item to enter. As a result without further changes it will only have half of the set capacity. You can choose the "Conditional Transport" option in "Use Transport" to use the operator only if item exits through port 2. If you look at the code this generates you can also see the commands that are used to reset the output/input state of the separator and queue.
