question

Jeff Kaczmarczyk avatar image
0 Likes"
Jeff Kaczmarczyk asked Adrian Haws edited

Check itemtype of downstream items

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
FlexSim (other)
FlexSim (other - please specify)
itemtypetracked variabledownstreamtracked
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

·
Adrian Haws avatar image
0 Likes"
Adrian Haws answered Adrian Haws edited

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.


· 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.

Jeff Kaczmarczyk avatar image Jeff Kaczmarczyk commented ·

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

I'm on version 7.3

0 Likes 0 ·
Adrian Haws avatar image Adrian Haws Jeff Kaczmarczyk commented ·

@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 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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