Change processor flowitem entry point

Change processor flowitem entry point

mike_mayer
Advocate Advocate
8 Views
2 Replies
Message 1 of 3

Change processor flowitem entry point

mike_mayer
Advocate
Advocate

[ FlexSim 20.0.2 ]

A processor accepts flowitems from the left (or, at the top in the attached screenshot).

As flowitems arrive, their front (leading) edges hang off the far left edge of the processor as the flowitem begins traversing across the processor during the cycle. The flowitems go to the next object as soon as their leading edges touch the right edge of the processor.

If I have a conveyor connected directly to the left (input) edge of the processor, and items are stacking-up on the conveyor (normal), the flowitems clash together as the flowitem entering the processor (from the conveyor) is intersected by the next item on the conveyor moving towards the end of that conveyor.

We see this in the attached image where we are making "froot loops". At the entrance to the processor (at top) we see a bright green and blue froot loop mashed together. The bright green one is moving to the end of the conveyor to fill the space just vacated by the blue one, which is now starting to enter the processor (and still hanging off the left or top edge of the processor). The dark green one is on the other side and is departing the processor, no problem there.

If I could change the linear "start" landing point for the flowitem, such that the flowitem starts fully on the surface of the processor and not hanging off the edge thus intersecting with the last froot loop on the conveyor, then I think I'd be OK since they would never coincide (they'd be kept apart).

I tried playing with the small blue cube and point locations "Select the point on the object where the location will be measured" but it did not seem to change the landing (entry) point for flowitems as they move off the conveyor and onto the processor.

Thanks for any ideas.

2020-02-25-14-24-19.png

0 Likes
Accepted solutions (1)
9 Views
2 Replies
Replies (2)
Message 2 of 3

Matthew_Gillespie
Autodesk
Autodesk
Accepted solution

The item's location is updated by the processor's OnPreDraw. So we can uncheck the Convey Items Across Processor Length checkbox and then write our own pre draw code using the processor's OnPreDraw trigger. I used this code:

for (int i = 1; i <= current.subnodes.length; i++) {
	Object item = current.subnodes;
	if (getitemstate(item) == FRSTATE_INQUEUE && getitemvar(item, 2) != 0) {
		double percentAlong = (Model.time - getitemvar(item, 1)) / max(.001, getitemvar(item, 2));
		double xLoc = percentAlong * (current.size.x - item.size.x);
		item.location.x = xLoc;
	}
}

Here's an example model:

conveyinbounds.fsm

The blue cube and point locations are something completely different. You can read about what that does here.



Matthew Gillespie
FlexSim Software Developer

Message 3 of 3

mike_mayer
Advocate
Advocate

Matthew, sorry for the late reply. Thanks for that clever bit of OnPreDraw code to do custom movement. I'm going to give that a try.

I also have a suggestion box item, which I'll submit as an Idea.

Mike

0 Likes