Create/Add Worker

The Create/Add Worker tool allows you to build up the statically linked Worker call-chain hierarchy of a Workers application.

Options

Select Type of Worker

First you must select the type of Worker you want to create. Here you can select:

  • Worker with EHL - The Worker's Main VI will contain an Event Handling Loop. Select this option if you need your Worker to handle events. E.g. events from front panel elements.

  • Worker without EHL - The Worker's Main VI will not contain an Event Handling Loop. This option is preferred if you don't need your Worker to handle events.

  • Worker from template - Create a new Worker from your own Worker template. See Creating Worker Templates.

Good to know

If you select a Worker without EHL and then later on realize that you need to handle events, you can simple add an EHL yourself, copied from another Worker with an EHL.

Name of your New Worker

Select a name for your new Worker. This will be the name of the Worker's class. The name you select should be suitable to be a filename, but is not allowed to contain any periods (.).

Inherit from:

Select the class you want to directly inherit your new Worker from. By default every Worker inherits from Worker.lvclass [Workers.lvlib].

Create non-reentrant Worker for real-time targets

This option only appears if a real-time target has been selected in the Workers tools menu. By default this flag is ticked, meaning that a Worker with a Main NR.vi will be created (the non-reentrant version of a Worker's Main.vi).

Worker Alias

The Worker's alias is what the Worker will be known as within a Workers application. This field is optional. If left blank, the Alias will be the same as the Name of your New Worker. If your Worker's name is long, you can create a shorter alias for your Worker.

Icon Header

A string for the header or your Worker's icon. Here you can also select the background and text color of the icon's header.

Icon Preview

What the icon of your Worker will look like, based on the header and text/background colors you choose.

Parent folder of new Worker's folder

When a new Worker is created, its class file is put in a folder with the same name as the Worker. The 'parent' folder is one level above the folder that is created for the new Worker.

Add the Worker as a subWorker to the Worker selected below

When you select this flag, the new Worker you are creating (or if you select a Worker from the Add Exiting... tab) will be added as a statically linked subWorker to the Worker you select directly below this field in the list titled Workers in (target).

Opens the Worker Hierarchy Viewer tool.

Advanced

Tasks performed by the tool

A summary of the scripting tasks performed by the Create/Add Worker will now be provided. This summary is for when a new Worker is created by the tool and then added as a statically linked subWorker to another Worker.

  1. The tool creates a new Worker from a template.

  2. A control subWorkers.ctl is created and added to the Manager.

  3. subWorkers.ctl is added to the Manager's private data cluster

  4. Setup subWorkers.vi is created and added to the Manager.

  5. Setup subWorkers.vi is added to the Manager's Main VI's block diagram

  6. Setup subWorker - *New Worker's Alias*.vi is created and added to the Manager.

  7. Set Initialization Data - *New Worker's Alias*.vi is created and added to the Manager

  8. The new Worker's Main VI is added to the Manager's Main VI, below the Manager's QMH and the VI is wired up.

The result of the steps above can be seen in the example below. Below (left) is a screenshot of the items are that created by the tool (highlighted in blue) when adding a new Worker (Worker B) to a pre-existing Worker (Worker A). Below (right) shows that subWorkers.ctl has been added to Worker A's private data cluster.

The VIs within the red boxes in the block diagram below have been added by the Create/Add Worker tool.

Last updated