The Workers Main VI

A Workers QMH is located on the block diagram of the its Main VI (Main.vi) and is designed in the style of the LabVIEW QMH Template. The block diagram of a Worker's Main VI is shown below:

A Worker's Main.vi is a re-entrant shared clone, meaning that you can have multiple instances of them running simultaneously.

Event Handling Loop

The event handling loop (EHL) at the top of the Main VI is optional, and can be used to handle both front panel and user events, much like in the LabVIEW QMH template.

Message Handling Loop

Every Worker's Main VI is required to have a message handling loop (MHL). Workers send messages to each other via message queues, and these messages are dequeued within a Worker's MHL.

A Worker's MHL can receive messages sent from the Worker's EHL, sent from cases within itself, or sent from external Workers (or VIs) that have access to the Worker's message queue.

A Worker's MHL is shown below, and contains the following parts within a while loop:

  • Dequeue Message.vi - This VI dequeues messages from the Workers message queue.

  • Data - Data (as a variant) can be sent along with a message. This data can then be acted upon within a case of the case structure.

  • Case Structure - The cases of the case structure are selected by a string. This string is contained within the message received by the Worker's Dequeue Message.vi.

  • Error Handler.vi - Any errors received by this VI will be sent to the Workers Debug Server.

  • Worker.ctl - The blue wire corresponds to a Worker's private data cluster, contained within a shift register in the MHL.

Last updated