question

Thao B avatar image
0 Likes"
Thao B asked Thao B commented

Material does not flow in lane 1

panel-line-updated.fsm

Hi,

I have a model here that shows 2 lanes processing materials. However lane 1 material flow stops halfway while lane 2 continues, why is this happening? Appreciate any help.

FlexSim 18.1.2
material flow
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

Joseph Gillespie avatar image
1 Like"
Joseph Gillespie answered Thao B commented

@Thao B

The problem you were encountering was due to the timing of the execution of some of your custom code:

if (current.Qty == 0) {
	current.rowno = current.rowno + 1;
    int rowno = current.rowno;
    
	if (rowno <= Table("Batch").numRows) {
         int qty = Table("Batch")[rowno][1];
         model().find("Queue3>variables/maxcontent").value = qty;
         model().find("Queue3>variables/batchsize").value = qty;
         current.Grade =  Table("Batch")[rowno][3];
         current.Type =  Table("Batch")[rowno]["Type"];
         current.Qty =  Table("Batch")[rowno][1];
   }
}

You had this code within the OnEntry trigger of Queue3. What would happen is after the last item of Batch 3 entered, the queue max size and batch size would update to 5 (based on Batch 4). This would cause an extra item to be able to enter before Batch 3 left, leading Queue3 to send out 5 items instead of 4. Since Queue4 was expecting only 4 items (its batch size set to 4 from the item.batch label), this caused a series of problems that led to the lane jamming up.

One solution is to move this code to an "On Exit" trigger in Queue3, so that the change in labels doesn't affect the items currently in the queue. I did this in this updated model and it works fine: panellineanswer.fsm


panellineanswer.fsm (124.9 KiB)
· 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.

Thao B avatar image Thao B commented ·

@Joseph Gillespie

Hi, thank you for the explanation. The model works now.

0 Likes 0 ·