Add slot label manually

Add slot label manually

xucq
Not applicable
630 Views
5 Replies
Message 1 of 6

Add slot label manually

xucq
Not applicable

[ FlexSim 20.1.1 ]

Hi,

I want to add slot label to one rack manually. What I did is adding the "slotLabels" and "resetLabels" into the tree of rack2. Then I test if it works by using the "Matching Labels" strategy. But it didnot work.

Here is the test model, in the model I use the "slot label painter" to add slot label to rack1 which worked well, I added slot label manually as mentioned which worked badly.

I wonder if I missed any steps? Looking forward to your answer.

testV20.1.fsm

0 Likes
Accepted solutions (1)
631 Views
5 Replies
Replies (5)
Message 2 of 6

joerg_vogel_HsH
Mentor
Mentor
Accepted solution

The attached file sets some slotlabels in levels of 2nd rack to value 2 by source code in On Message trigger of the BasicFR Object. The activation source code is in a script window.

Model.find("BasicFR1").as(Object).message(0,NULL,1);

The source code function is

function_s(slots[indexSlot], "paintLabel", "myLabel", labelValue, 1);

The parsed Parameters are in following order:

  • slot
  • "paintLabel" the called function
  • "labelName" as a string
  • labelValue as the value of the label you want set
  • "1" I don't know but is maybe a default value.

set_slotLabel.fsm

0 Likes
Message 3 of 6

joerg_vogel_HsH
Mentor
Mentor

Comment to add Slot Labels by Tool Paint Slot Labels with an own Color Palette in Toolbox.

0 Likes
Message 4 of 6

xucq
Not applicable

Thank you very much.

When I reset the model, the label will disappear. Can this be solved?

0 Likes
Message 5 of 6

joerg_vogel_HsH
Mentor
Mentor

I have updated my answer and attached a changed model. But I still don't know how to erase slot labels now!

0 Likes
Message 6 of 6

xucq
Not applicable

Thank you a lot, it works well.

0 Likes