Using the Spawn Task for Adding a Parallel Run or Wait

You can integrate the following instructions in Robot Simulation.

  • Create a new Spawn Task Trigger action.
  • Parallel Run (PRUN).
  • Parallel Wait (PWAIT).

Important: Complete all the tasks that this page discusses in the order listed.

This page discusses:

Creating a New spawn Task

You can specify the task as spawnable to get that under the Task list in the PRUN dialog box.

Instructions Parallel Run (PRUN) and Parallel Wait (PWait) are then available in the Teach instructions bar.

You can specify a Task as Spawnable from the Sequencing tab or Task edit dialog.

  • Sequencing tab: Right-click on Task, Properties, Task starts. Select

    Spawnable, then click OK.
  • Teach Sequence tab: Right-click on Robot Task, Edit.

    Select Create As Spawnable, then click OK.

New instructions Parallel Run (PRUN) and Parallel Wait (PWait) are now available in the Teach instructions bar.

Parallel Run (PRUN)

You can create a Parallel Run in Teach. It allows you to define the spawnable task. During the simulation, Spawner triggers\fires the spawnable task and simulates the spawnable task in parallel with the main Spawner task. The current task is named spawner. The task that is getting invoked\fired is a spawnable task. Define the task as spawnable to get that under the Task list in the Parallel Run dialog.

This allows you to start a spawnable task. In PRUN dialog:

  1. All the available spawnabilities for the current tasks are available. From the list, select the task.
  2. Identifies the parallel thread. This is referenced in the Parallel Wait.
  3. If selected, the simulation keeps running when the spawned task is still executing. Otherwise the simulation ends when the main task finishes.



    Note:
    • Task can be defined as service as well as spawnable task.
    • A task being launched in parallel must be declared as spawnable in the properties of the task. It can have input arguments but no output arguments.
    • JobID is optional and is useful for using sustain option or ParallelWait instruction (JobID scope is managed at resource’s level.)
    • The sustain option allows you to maintain keeping the simulation alive until the end of the spawned task. Otherwise, simulation stops when the main program is finalized.
    • All the IOs that are created\available under the selected spawnable task are listed under the parameters. The user can enter the valid values or select the available IOs for the current task from the list.

This functionality verifies if a new move attempts for a device that is already executing a move during simulation. If it is, it stops simulation and displays a message in the device Output (and RRS) message windows.

Parallel Wait

You can create a Parallel Wait that allows to wait for a spawned task for the given job ID.

If the job ID is not valid, it does not consider.