What is a Worker?

What is a Worker?

A Worker is the name for a modular QMH in the framework. This is the simple definition of a Worker.

In LVOOP terms, a Worker is a QMH and its supporting code that is encapsulated in a class, which inherits from the ultimate parent class of all Workers: Worker.lvclass.

Good to know

For developers without LVOOP experience, you can simply think of a Worker's class as a library with its own data-type.

As with a regular QMH, you assign your Workers a specific task, e.g. as a user interface or data logger, etc., but because a Worker is modular, you can easily reuse your Workers again in multiple projects, or even use multiple instances of them within the same application.

Worker Contents

You can create new Workers and add them to your LabVIEW projects, using the Create/Add Worker tool. A new Worker created by the tool contains only four items, as shown below.

New Worker.lvclass

This is the Worker itself: a class that contains your Worker's methods and data, ie. VIs and ctls. For those who are not familiar with classes, you can simply think of a class as a library that has its own data type.

New Worker.ctl

This is a cluster of data that is private to the Worker. Here you can add any data types that you wish to store data between MHL iterations within the QMHs shift-register.

Initialization.ctl

This is a cluster of data that is used to pass data into the Worker's QMH when the Worker is initialized.

Main.vi

This VI is referred to as a Workers Main VI and contains the QMH of the Worker (see The Workers Main VI). This VI is a reentrant shared-clone.

Last updated