question

Martin avatar image
0 Likes"
Martin asked Jeanette F commented

Find Slot with Label Query not working

warehouse.fsm

Hi,

I've set slot labels on a bay using my model's "On Model Reset" event like so:

Storage.Object rack = Model.find("Rack25");
  Storage.Bay bay = rack.bays[1];
  bay.setSlotLabels("Material", "MT55");

I've been able to verify it applied the labels by printing the label value of the slots in the bay to the output console.

But, I have a FindSlot process in a process flow which uses the following query:

WHERE slot.hasSpace($1.item) AND Material == $1.Material

It fails to find the slots that have the label. If I remove the where clause, it will find the slots and unload flow items to it. Any ideas?

Thanks!

FlexSim 24.1.0
labelfind slot
warehouse.fsm (2.4 MiB)
· 4
5 |100000

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

Felix Möhlmann avatar image Felix Möhlmann commented ·

Have you checked that its not the "hasSpace()" check that's the problem? Especially when using a Floor Storage its easy to forget that the height of the storage object is taken into account.

If it's not that we'd probably need to see the model to investigate further.

0 Likes 0 ·
Martin avatar image Martin Felix Möhlmann commented ·
Hi Felix, yes I have tried that. I've added the model to the question. Thanks!


Martin

0 Likes 0 ·
Guldberg avatar image Guldberg Martin commented ·

Your process flow work just fine, but your slot painting doesnt. You can try and manually paint some slots with the label.


I think its a timing issue. If I put the code in On Simulation Start on a rack it seems to work just fine


1717679773432.png

0 Likes 0 ·
1717679773432.png (931.9 KiB)
Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Martin, was Jason Lightfoot's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes 0 ·

1 Answer

Jason Lightfoot avatar image
1 Like"
Jason Lightfoot answered Felix Möhlmann commented

Paint the labels at time zero when you run the model rather than on reset - I think the rack's own reset is clearing out the labels during the reset.

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

Felix Möhlmann avatar image Felix Möhlmann commented ·

I also just realized that this is probably the issue. "setSlotLabels()" does not set a reset value for the label, it is lost on model reset.

You can use the command below instead. It is what is run when you 'paint' the slot labels and will set reset values.

function_s(slot.as(treenode), "paintLabel", "labelName", value, 1);

The last parameter I believe controls if only the slot or the whole level, bay, rack is painted. Disclaimer: function_s commands are not documented and do not have guaranteed compatability to other versions.

1 Like 1 ·