question

Marco Baccalaro avatar image
0 Likes"
Marco Baccalaro asked Marco Baccalaro commented

Slot labels deleted at reset

In the release notes of the 23.0 is stated:

Fixed issue with slot labels not being remembered. If you set a slot label in FlexScript, and the script execution is not part of a simulation run (e.g. through a dashboard button, auto-build, executing script manually, etc.), then it will save that label value as its 'reset' label value, so that when you reset the model, it will stay at / go back to that value. Previously, labels that were set in script would be reset to nothing on reset.

But in the attached model (Slot labels deleted example.fsm), the labels are deleted at reset.

How should I avoid this deletion?

Thank you.

FlexSim 24.1.0
warehouseslot labels
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

Paula LG avatar image
1 Like"
Paula LG answered Marco Baccalaro commented

Hi Marco,

The problem here seems to be that the setSlotLabels command doesn't create the resetLabels node and, therefore, when the model is reset the label is removed. You should report that as a bug to have the development team add it to their to-do list for next version.

Meanwhile, you can use the code below instead:

Storage.Object wh = Model.find("Rack1");
int i = 0;
int j = 0;
int k = 0;

for (i=1;i<=wh.bays.length;i++){
for (j=1;j<=wh.bays[i].levels.length;j++){
for (k=1;k<=wh.bays[i].levels[j].slots.length;k++){
wh.bays[i].levels[j].slots[k].test = 1;
}
}
}

You'll immediately see that assigning the label this way creates the resetLabels node and keeps the label and its value on reset.

I hope it helps!

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

Marco Baccalaro avatar image Marco Baccalaro commented ·
Great, thank you.

Is what I suspected.

0 Likes 0 ·