This FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices.
TE FlowItem as Transport for other FlowItems (41.3 KB)
Author:
Brandon Peterson)
Date Added:
08-21-2009
Downloads:
2225
Grade:
A
Description
This model demonstrates how to use Task Executer(TE) FlowItems to transport other flowitems in the model.
In the model you will notice that there is an Operator Source that is connected directly to the Sink. There are four network nodes in the model, each one is connected to a dfferent object. The TE FlowItems naturally would flow from the Source to the Sink via the NN1 to NN4 route.
On Reset and every 186 seconds 8 flowitems are created by the Item Source and placed in the Rack. The flow in the Rack is set to not release the items and the Use Transport code is custom code that simply returns zero. There is some code in the message trigger that will change the color of the item to match the operator and to release the item.
When there are items in the Rack that have not been selected for transport the Use Transport code modifies the task sequence of the TE FlowItems. The code changes the color of the item to Blue and the color of the TE FlowItem to green. It tells the TE FlowItem to travel to the rack load the item and then take it to the Queue and unload it.
If there are no items in the Rack but there are items in the Queue the Use Transport code will modify the task sequence of the TE FlowItem to transport the items from the Queue to the Sink. The colors will be orange instead of blue and red instead of green.
The Queue is set the same as the Rack.
All of the code has been commented so that you can easily determine what I have done. All of the code resides in the following triggers:
Operator Source:
Use Transport - Creates the Task Sequences and changes the colors
Rack:
Flow - Set to the don't release option
Use Transport - Returns zero so that nothing happens - taken care of by the Operator Source
Message - Release the item and change its color
Queue:
Flow - Set to the don't release option
Use Transport - Returns zero so that nothing happens - taken care of by the Operator Source
Message - Release the item and change its color