question

Robert Hambright avatar image
0 Likes"
Robert Hambright asked Regan Blackett edited

How do I reset the racks when new items arrive?

I have a model that creates items based on a schedule (every 50 seconds). I want to have the racks completely cleared when the new items arrive. I have tried different messages being sent from the source, but I can't figure out how to clear the racks and then have the new items arrive and stay in the racks.

The last thing I tried was sending a message from the source (on-creation with a delay of 49.99999) to the racks. This cause my forklift to stop and the model crashes every time I hit reset :)

Also, the cones for adjusting 3D object size have disappeared. How do I fix this?

Thanks for the help.

resetting-racks-autosave.fsm

FlexSim 16.2.0
racksmessage
wnue7.png (181.5 KiB)
· 3
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 Nordgren avatar image Jeff Nordgren commented ·

@Robert Hambright

Robert,

I'm not quite sure what you mean by you want the rack cleared before the new batch of items arrive. Cleared how? With a faster fork truck? Just disappear? To where? I'm not sure what you are trying to accomplish. If you could explain more what you are trying to get accomplished, that would certainly help.

1 Like 1 ·
Robert Hambright avatar image Robert Hambright Jeff Nordgren commented ·

By cleared I mean have all the items destroyed/disappear. It is going to represent a new shipment of items each day. But the old inventory needs to disappear first. Does that make sense?

0 Likes 0 ·
Robert Hambright avatar image Robert Hambright Jeff Nordgren commented ·

For example, when the green items appear, there should be no red items. Whatever the forklift didn't transport needs to disappear.

0 Likes 0 ·
Regan Blackett avatar image
3 Likes"
Regan Blackett answered Regan Blackett edited

Robert,

I opted to take a ProcessFlow based approach to get this done that replaces your Source object using similar principles outlined by @Jörg Vogel. Take a look here:

First thing, I used a 'Schedule Source' activity to create a single token that represents your item shipment of 100. If the transporter doesn't have any queued up tasks, then we go to the 'Create Object' activity and go ahead and create the 100 boxes.

If the transporter does have things to do, I decided to let him finish what he is doing by waiting for the transporter's On Resource Available trigger. When the Transporter finishes the current task, it will use a 'Create Task Sequence' activity, plus a delay activity that has a high priority and is set to preempt and abort all. This will empty out the Transporters queued up tasks, which needs to be done to clean up after ourselves and makes it safe to delete the objects it was tasked with transporting.

Finally, I use a Subflow to find out how many things are left in the rack and destroy them. The Children in the Subflow have a label reference to a single thing in the rack, and the Subflow activities do the destroy.

Once everything is destroyed it's safe to Create Objects again. This is the main reason why I wanted to use ProcessFlow for this; I get to choose when to create the objects rather than have to take what the source object gives me. I get the flexibility to not let the new shipment into the rack until I havecleaned up the previous shipment.

2599-resetting-racks-autosave.fsm


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

Regan Blackett avatar image Regan Blackett ♦ commented ·

Slight addendum, I forgot about a little thing that the objects do when they make a transporting task sequence. There are some values behind the scenes called "nrotransportsin" and "nrotransportsout" that objects use to keep track of items that have requested a transport to leave an object (nrotransportsout) and enter an object (nrotransportsin).

When we abort a task sequence that transports a flowitem it becomes our responsibility to update those values for the releasing and receiving objects. So here's a version of the model that uses a Custom Code activity to do that during the Subflow from before.

2599-resetting-racks-2.fsm

2 Likes 2 ·
Jeff Nordgren avatar image Jeff Nordgren commented ·

@Robert Hambright

I took Regan's modified model and added a custom code block when creating the flowitems for the rack. This is to color the flowitems in the rack so that you can more easily see the "change over" of one flowitem batch to the next. Good job Regan!

resetting-racks-jn2.fsm

1 Like 1 ·
Joerg Vogel avatar image
1 Like"
Joerg Vogel answered

First of all close the output of the Rack. Then dispatch a preempting and aborting all tasksequence to the transporter, because even if the items in the rack are destroyed the transport tasksequences are still existing in the transporter. Then you can destroy the items in a for loop over the content in the rack, or with a while loop as long as a first object in the rack exist.

5 |100000

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

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.