Find Slot with Label Query not working

Find Slot with Label Query not working

NTC_Martin
Not applicable
181 Views
6 Replies
Message 1 of 7

Find Slot with Label Query not working

NTC_Martin
Not applicable

[ FlexSim 24.1.0 ]

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!

0 Likes
Accepted solutions (1)
182 Views
6 Replies
Replies (6)
Message 2 of 7

moehlmann_fe
Enthusiast
Enthusiast

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
Message 3 of 7

NTC_Martin
Not applicable
Hi Felix, yes I have tried that. I've added the model to the question. Thanks!


Martin

0 Likes
Message 4 of 7

guldbergdk
Not applicable

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
Message 5 of 7

jason_lightfootVL7B4
Autodesk
Autodesk
Accepted solution

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.

Message 6 of 7

moehlmann_fe
Enthusiast
Enthusiast

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.

Message 7 of 7

Jeanette_Fullmer
Community Manager
Community Manager

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