article

Paul Toone avatar image
0 Likes"
Paul Toone posted

Tutorial - Task Sequences   

This tutorial will teach you how to create task sequences in the Process Flow module and link them to a 3D model. For this tutorial, you will create a model with two processors that are manned by two operators. Each operator will use the same task sequence to transport flowitems to the next downstream object. You'll begin by creating a simple task sequence inside a sub flow that will simply tell the operator to load and unload the flowitems. Then, you will make the task sequence more complex by adding tasks that will make the operator clean the processors after they finish transporting the flowitems to the next destination.

Tasks Covered

This tutorial will cover the following tasks:

  1. Building a simple 3D model
  2. Building a task sequence in a sub flow
  3. Attaching the processors and operators to the sub flow
  4. Editing the activity properties to add dynamic references
  5. Viewing instances during a simulation run
  6. Adding more activities to the task sequence
  7. Editing the properties of the new activities

For More Information

For more in-depth information about the concepts covered in this tutorial, refer to the following topics:

Step 1 - Build a Simple 3D Model

First, we'll create the 3D simulation model that will use a task sequence in a process flow.

NOTE: This step will include detailed instructions about which types of objects and port connections you should make while building the model. If you don't need these step-by-step instructions, you can skip to the end of this step and view the final image to see how the simulation model should look.

  1. Create a new model.
  2. From the Library, add:
    • 1 Source
    • 2 Processors
    • 1 Sink
    • 2 Operators
    • 1 Shape (found under the Visual group in the Library)
  3. Create port connections (A connects) between these objects (in this order):
    • The Source
    • The first Processor
    • The second Processor
    • The Sink
  4. Create a center port connection (S connect) from the first Processor to the first Operator.
  5. Create a center port connection (S connect) from the second Processor to the second Operator.
  6. You might need to move the objects so that they look similar to the following image:

NOTE: The Shape object will eventually represent a cleaning supplies storage closet in this simulation model.

Step 2 - Build a Task Sequence in a Sub Flow

Now you'll create a simple task sequence that both operators will use whenever they need to load and unload a flowitem. In this step, you'll set the process flow to run a separate instance each time an operator runs the sub flow. Process flow instances will be explained a little bit in each of the following steps, you can also refer to Process Flow Instances for more information.

  1. Click the ProcessFlow button on the main toolbar to open a menu. Select Sub Flow to create the kind of process flow that is best for running sub flows. It will automatically open as a separate tab in the center pane. You might want to split the center pane between the model view and the process flow view for your convenience.
  2. Next, you'll change some of the sub flow's general properties. Start by renaming the sub flow to ItemTransport for clarification. In Quick Properties, click in the Process Flow Name box. Delete the current name and type ItemTransport.
  3. Click the Instance Creation menu and select Per Instance. With this option selected, each operator that runs the task sequence in the sub flow will be considered a separate instance. By default, when you select this option all shared assets will be local to each instance, meaning the two operators won't share assets.
  4. Now you'll build the actual task sequence in the sub flow. Using this task sequence, the operator will load and then unload a flowitem. Using your preferred method for adding activities, add the following activities to a single stacked block (in this exact order):
    • Start
    • Load
    • Unload
    • Finish

When you're finished, your process flow should look like the following image:

Step 3 - Attach the Processors and Operators to the Sub Flow

Now you'll link this sub flow to the simulation model. On the processor, you'll use a special picklist option that will allow you to dynamically run the task sequence every time the processor uses an operator to transport a flowitem.

  1. With the model view open, double-click one of the Processors to open its Properties window.
  2. In the Flow tab, check the Use Transport checkbox. This will activate the box next to this property in which you select the task executer that will transport the flowitem. Click the arrow next to this box to open the picklist menu for this property. Select ProcessFlow: Use Task Sequence Sub Flow from the menu to open the options for this picklist.
  3. Click the arrow next to the Dispatch Object box to open a menu. Select centerobject(current, 1) to attach the operator that is attached to the processor's center port to this sub flow.
  4. None of the other properties on this picklist will need to be changed:
    • The Sub Flow menu should display the name of the sub flow you created earlier. (If you didn't change the name, the sub flow would have been named ProcessFlow by default.) You don't need to change this property because it should have automatically selected the sub flow that you created earlier.
    • The Activity box should also have the Start activity selected by default, which is the first activity in your sub flow.
    • You should use the default labels that are assigned to the flowitems when it goes through the processor. The fromObject label assigns the current processor as the pickup location for the flowitem. The ToObject label assigns the object in the outgoing port connection as the destination for the flowitem. Be aware that you'll dynamically reference both of these labels in your sub flow in the next step.

  5. Repeat these steps for the second Processor.

Step 4 - Edit the Activity Properties to Add Dynamic References

Now you'll edit the activities in your sub flow so that it is dynamic, meaning it will change based on conditions that are unique to each instance of the sub flow. As a reminder, each time an operator picks up a flowitem from the processor and transports it to its destination, that will act as a separate instance of a sub flow. In this step, you'll also get some experience with properties that use the Universal Edit feature. See Editing Activity Properties - About the Universal Edit Feature for more information.

  1. With the process flow view open, click the stacked activity block to select it.
  2. You'll start by creating a dynamic reference to the operator that is assigned to the task sequence. In the Quick Properties for the Load activity, look for the Executer/Task Sequence box. This property determines which task executer will be assigned to complete this task. In this case, you'll want to replace the text in this property with the keyword current. This keyword creates a dynamic reference to the object attached to the current instance of the sub flow. In other words, any time this sub flow is run, it will assign this task to whichever operator is currently attached to that instance of the sub flow.
  3. Repeat this step for the Unload activity by typing current in the Executer/Task Sequence box.
  4. Next you'll create a dynamic reference for the flowitem's pickup location by referencing the fromObject label assigned by the processor to each flowitem. (This label assigns the current processor as the flowitem's pickup location. See Step 3.4 as a reminder.) In the Quick Properties for the Load activity, click in the Station box and type the following text: Label: fromObject. NOTE: The command Label: is a Universal Edit keyword.
  5. Lastly, you'll create a dynamic reference for the flowitem's destination by referencing the toObject label. (This label assigns the object in the outgoing port connection as the flowitem's destination. See Step 3.4 as a reminder.) In the Quick Properties for the Unload activity, click in the Station box and type the following text: Label: toObject.

When you're finished with this step, the Quick Properties for the stacked block should be the same as the one in the following image:

Step 5 - View Instances During a Simulation Run

In order to help you get a better understanding of how instances work, in this step you will run the model and view the two different instances of that process flow in action.

  1. Run the model by pressing the Reset and Run buttons on the simulation control bar.
  2. As the model runs, you should see that any time a flowitem needs to be transported, it appears as a task in the sub flow. Each token represents an Operator performing the task:

  3. Press the Stop button on the simulation control bar to pause the similation. Press the Step button repeatedly to advance the simulation to the next step until you can see two tokens in the process flow at the same time, as shown in the following image:

  4. Click in a blank spot in the process flow to ensure nothing is selected and to display the process flow's general properties in Quick Properties.
  5. In Quick Properties, find the Attached Objects (instances) group. Notice that this lists the two operators that are attached to this process flow, as shown in the following image:

  6. Click one of the operators in the list to select it. Then click the Open Process Flow View button to open the process flow for that specific instance. You could also do the same for the second operator. The following image shows what it would look like if you were viewing the main process flow and both instances at the same time:

  7. Notice that both tokens are in the main process flow. However, the first token belongs to the first Operator and so it is the only one that appears in the instance for that Operator. The same is true for the second token, which belongs to the second Operator.

Step 6 - Add More Activities to the Task Sequence

In this step, you'll edit the task sequence to make it a little more complicated. You'll add activities that will make the operators clean the processors after they finish transporting the flowitems to the next destination.

  1. Press the Reset button on the simulation control bar to stop the current simulation run.
  2. Now you need to separate some of the activities in the stacked block. With the process view open to the main sub flow (not the instances), click the stacked block of activities to select them.
  3. Click the Scissors to the left of the the block in between the Start activity and the Load activity to separate them.
  4. Now click the Scissors to the left of the block in between the Unload activity and the Finish activity to separate them.

  5. You can move any of the activities around if you need to put some extra space between the activities as you work on the next few steps.
  6. After the Start activity, add a Custom Code activity.
  7. Click the stacked block with the Load and Unload activities and drag it to the bottom edge of the Custom Code activity to link the activities together.

  8. After the Unload activity, add the following activities (in this order):
    • Travel
    • Acquire Resource
    • Travel
    • Delay
    • Custom Code
    • Travel
    • Release Resource
  9. Click the Finish activity and drag it to the bottom edge of the Release Resource activity to link the activities together.

  10. Add a Resource activity off to the side of the stacked block without connecting it.
  11. Lastly, you'll rename the activities to clarify their purpose in the task sequence. To rename an activity, double-click an activity name and type in a new name. Rename the activities as follows:
    Current Name New Name
    Custom Code Close Processor Input Ports
    Load Load at Processor
    Unload Unload at Destination
    Travel Travel to Supplies Closet
    Acquire Get Cleaning Supplies
    Travel Travel to Processor
    Delay Cleaning Time
    Custom Code Open Processor Input Ports
    Travel Travel to Supplies Closet
    Release Return Cleaning Supplies
    Resource Cleaning Supplies
  12. If needed, you can resize the activities.

When you're finished, your process flow should look similar to the following image:

Step 7 - Edit the Properties of the New Activities

In this step, you'll edit the properties of all the new activities you added to the task sequence. The steps will be logically organized by the activity types rather than the order they appear in the task sequence.

  1. Click the activity block to select it.
  2. You'll start by editing the two Custom Code activities so that they close and open the processor's ports at the right point in the task sequence. In Quick Properties under the Close Processor Input Ports group, click the Add button next to the Custom Code box to open a menu of available picklists. Point to Control, then Close and Open Ports to open its picklist options.
  3. Leave the Action menu set to closeinput so that it will close the incoming port of the current processor.
  4. Click the arrow next to the Object box to open a menu. Select getlabel(token, "Label"). In this box, change "Label" to "fromObject". This setting will make a dynamic reference to the object listed in the token's fromObject label. (This label assigns the current processor to this property. See Step 3.4 as a reminder.) In other words, the incoming port from the current processor will be closed.

  5. Repeat steps 2-4 for the Open Processor Input Ports activity with one small change: in the picklist options, select openinput in the Action menu. This will open the incoming port of the current processor after the operator finishes cleaning it.

  6. Now you'll edit the properties for all the Travel activities so that they are assigned to the correct Operator. In Quick Properties for all three Travel activities, change the Executer/Task Sequence box to current.
  7. Now you'll edit the properties for all the Travel activities so that they are assigned to the correct Destination. In Quick Properties under the first Travel to Supplies Closet group, next to the Destination click the Sampler button to enter sampling mode.
  8. Select the Shape object in the 3D model to open a menu. Select Shape9 from the menu, although the exact number of the object might be different in your model. (This object will represent the supplies closet in the model.)
  9. Repeat steps 7-8 for the second Travel to Supplies Closet activity.
  10. In Quick Properties under the Travel to Processor activity, click in the Destination box and type Label: fromObject to make a dynmaic reference to the object listed in the token's fromObject label. (This label assigns the current processor as the destination. See Step 3.4 as a reminder.)
  11. Lastly, you'll link the Cleaning Material resource to the process flow. With the stacked block still selected, click the Exclamation icon next to the Get Cleaning Supplies activity to enter sampling mode, then click the Cleaning Supplies resource.

You'll use the default settings for all the other activities. Be aware that the Cleaning Supplies resource is set to be globally accessible to all instances of the process flow. You also don't need to change the Return Cleaning Supplies settings because the system uses resource labels on the token to determine which resource needs to be returned.

Reset and run your model. You should see the operators moving a flowitem, going to the closet and back to the processor, staying at the processor for a length of time, and then traveling back to the closet. Once they start traveling back to the closet, the processor should start processing again.

See Troubleshooting Process Flows for best practices about fixing a model if your operators are not behaving as expected.

You could possibly experiment with adding some queues in front of the processors so that you could monitor the accumulation of flowitems. You could also experiment with having more than one set of cleaning supplies.

flexsim users manualuser manuals
5 |100000

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

Article

Contributors

paul.t contributed to this article

Navigation

FlexSim 2016.1