question

Tomi Kosunen avatar image
1 Like"
Tomi Kosunen asked Mischa Spelt commented

Unknown type Slot in declaration of variable

I'd like to write a code to get a storage slot for a Item. I can't get the syntax right. Why the following gives me an error:

Slot MySlot; // This gives an error: "Unknown type Slot in declaration of variable MySlot"

Slot = getSlot("1--01-1-1");



FlexSim 20.2.3
flexsim 20.2.3slot
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

Mischa Spelt avatar image
1 Like"
Mischa Spelt answered Mischa Spelt commented

Hi Tomi,

The class name is actually Storage.Slot. Unfortunately FlexSim highlights Slot so it seems like valid code but it should actually be

Storage.Slot MySlot = getSlot("1--01-1-1");


· 2
5 |100000

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

Tomi Kosunen avatar image Tomi Kosunen commented ·

Hi @Mischa Spelt

Thanks for the answer. I was able to get the syntax right but still i can't get the model right. I'd like to route all Items to certain slot thru ProcessFlow. How do I do that? I don't know what there should be in the Unload-Station field.

Pls see the attached model


asrs_test.fsm

0 Likes 0 ·
asrs-test.fsm (43.7 KiB)
Mischa Spelt avatar image Mischa Spelt Tomi Kosunen commented ·

For the unload station, you should use the rack that the slot belongs to. Since the slot is a reference to a variable in the Rack's attribute tree, you can simply use

ownerobject( token.Slot )

as the station:

However, just calling getSlot doesn't assign the item to the slot. It's better if you use the Find Slot activity from the Warehousing section of the library, as that will make a reservation:

As in this updated model: asrs-test-MS.fsm

0 Likes 0 ·
1606731911624.png (10.0 KiB)
1606732152230.png (20.3 KiB)
asrs-test-ms.fsm (48.1 KiB)