Check itemtype of downstream items

Check itemtype of downstream items

jeff_kaczmarczyk
Not applicable
15 Views
3 Replies
Message 1 of 4

Check itemtype of downstream items

jeff_kaczmarczyk
Not applicable

[ FlexSim (other) ]

I'm working on a basic simulation where boxes travel on a conveyor and get processed at either processor in the simulation. The baseline logic is to process every other box at each processor (top flow in model). Itemtype1 boxes get processed at "processor1" with a mean cycle time of 8 sec. Boxes that bypass to the 2nd processor have a cycle time of 1 sec. I think the baseline model is working properly.

For the 2nd model (bottom flow in model), I'm trying to implement better logic in order to achieve a higher output by looking downstream. The physical layout can not be changed.

My first thought was to do the following-set the item to itemtype2 On Exit of the source, then set it to itemtype1 before the item enters Processor 1b if there are 2 or more items with itemtype2 downstream (in queue3, queue4 or processor2b)

First, I'd like to know how to implement this logic. Second, is there a better way to do this?

Thanks, Jeff
0 Likes
Accepted solutions (1)
16 Views
3 Replies
Replies (3)
Message 2 of 4

adrian_haws
Not applicable
Accepted solution

Jeff,

You can implement this logic by using a tracked variable. When an item enters Queue3b, the tracked variable is incremented by one. It is then decremented in the On Exit of Processor2b. Then in the On Entry trigger of Processor1b I wrote a couple lines of code to check whether the tracked variable is set to 2 or greater, then to change the item type and color if that condition is true.

I've attached the updated model.

0 Likes
Message 3 of 4

jeff_kaczmarczyk
Not applicable

Im having problems opening the file, what version did you save the file?

I'm on version 7.3

0 Likes
Message 4 of 4

adrian_haws
Not applicable

@Jeff Kaczmarczyk I updated it in version 16.2.1. I could save it to a different version, but the implementation that I mentioned is as I've described. It just involves creating a tracked variable and using pick list options to modify it in the triggers. The only exception is the bit of code used in the On Entry of the processor or the On Exit of Queue2b, which I'll include here ("ChangeItemType" is the name of the Tracked Variable):

int condition = gettrackedvariable("ChangeItemtype");
if (condition >= 2) {
	setitemtype(item, 1);
	colorred(item);
}

0 Likes