question

Rykou avatar image
0 Likes"
Rykou asked Rykou commented

Use round robin transport to rack

Hi Team,

@Felix Möhlmann

I'm trying to use the round robin method sending object to Rack base on GlobalTable("Specific").

First object will be sent to Rack(Bay=2,Level=3,Slot=1)

Second object will be sent to Rack(Bay=1,Level=2,Slot=1)

Third object will be sent to Rack(Bay=2,Level=1,Slot=1)

Fourth object will be sent to Rack(Bay=2,Level=3,Slot=1)

etc...

I had refered to the previous post (https://answers.flexsim.com/questions/153099/how-to-set-output-of-a-queue-by-round-robin-but-in.html),and tried it.1713219358103.png

But it can't work. Can you help me with it ?

Tha attachment is as follows.Thanks alot.

input_byglobaltable.fsm

FlexSim 24.0.1
globaltableround robinsendtoport
· 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.

Joerg Vogel avatar image Joerg Vogel commented ·

a table row number starts with 1. If you declare a label, without a value, a default value of 0 or non existing is assigned.

0 Likes 0 ·
Rykou avatar image Rykou Joerg Vogel commented ·
Thanks.
0 Likes 0 ·

1 Answer

Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered Rykou commented

In the post you linked the "counter" label is not directly used as the output port. Its value varies between 0-2 and a 1 is added to get the port number.

int outPort = Math.floor(counter.value/batchSize) + 1;    // <--- outPort at least 1

As such, the modulo operation in that model is set up so the counter value is reset back to 0.

In your model you use the value as a row number, so it must be between 1 and the number of rows in the table. To achieve this, just move the "+1" to the end of the expression, so it happens after the modulo operation.

Then also either move the line that increments the counter in front of the rest of the code or initialize the label value to be 1.

You also have to assign the slot (=), not compare it to the currently assinged one (==).

And lastly, since you put this code into the transport reference field, you still have to return the task executer that should move the item (ASRS).

treenode counter = current.labels.assert("f_sendcounter", 1);

// Increment counter label
counter.value = (counter.value)%(gettablerows("Specific")) + 1;

// Get next output port
int Bayval = Table("Specific")[counter.value][1];
int Levelval = Table("Specific")[counter.value][2]; 
int Slotval = Table("Specific")[counter.value][3];

// assignslot
Storage.Item(item).as(Storage.Item).assignedSlot = current.outObjects[1].as(Storage.Object).getSlot(Bayval, Levelval, Slotval);

return current.centerObjects[1];
· 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.

Rykou avatar image Rykou commented ·

I see. I learned the meaning of the "counter" label of the model in the link.It seems that returning the task executer in this way is necessary.Thank you for taking time to reply. It is very helpful.

0 Likes 0 ·