question

Michał M4 avatar image
0 Likes"
Michał M4 asked Michał M4 answered

How to connect conveyors to queues?

Model_1.fsmHi,

I would like to prepare a model that is shown above/below.

The main point is that products should go from source to a specific processsors. The sequence of the operations is placed at the table "operacje_kolejnosc".

The column IDs show the order of the operation numbers, and the row IDs show the individual products. There is the number of the machine on which the detail is processed at the intersection of the column with the row.

Could you help me how I should set the decisions points? What code should I write? 

I have no idea.


Regards,

MM

FlexSim 20.2.0
queueflexsim 20.2.0customcodecustomcustom objects
1.png (37.0 KiB)
2.png (123.9 KiB)
model-1.fsm (61.7 KiB)
5 |100000

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

Patryk avatar image
0 Likes"
Patryk answered

You can try use function "moveobject" On decision point trigger "On Arrival"


You should assign the label "Operation" to decision points and connect the decision point with the queue.

At processors, you have only two output ports (upper conveyor and bottom conveyor). If the next operation has a bigger value sent an item to the bottom conveyor otherwise sent an item to the upper conveyor.

If operation value equal 0 sent an item to the bottom conveyor.


In attached sent you a model.

Model_1_2.fsm


1618986839878.png (34.6 KiB)
1618986956003.png (71.4 KiB)
model-1-2.fsm (63.0 KiB)
model-1-2.fsm (63.0 KiB)
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
1 Like"
Felix Möhlmann answered

Hi,

to get the decision points to send the items to the correct processors, you could create a label on each of them referencing the number of the processor they are connected to. Let's call this label "Station" for now. Then, you'd add an OnArrival trigger choosing the "Send Item By Case" option. The case function should be a reference to the table cell containing the next machine number.

Table("operacje_kolejnosc")[item.ItemType][item.nr_operacji]

Below, you add the case

current.Station

meaning that, if the next machine number is equal to the "Station" label on the decision point, the item will be send to the connected queue.

In the OnProcessFinish trigger of the processors you already increment the step counter. The code in the "Send To Port" field is also a great start. All you have to do here, is check whether the next machine number is higher or lower than the current one to decide whether to send the item to port 1 (higher) or port 2 (lower). That could look like the following:

int row = item.ItemType;
int column = item.nr_operacji;
int next_step_number = Table("operacje_kolejnosc")[row][column];
int last_step_number = Table("operacje_kolejnosc")[row][column-1];

if (next_step_number == 0 || next_step_number > last_step_number)
    return 1;
else
    return 2;

Also I just noticed the step counter is incremented twice on machine 4. That is probably not correct (?)

Hope I could help.

Kind regards



dp-sendbycase.png (24.4 KiB)
5 |100000

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

Michał M4 avatar image
0 Likes"
Michał M4 answered

Thanks guys! That's what I really wanted!

5 |100000

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