Adding a Helper Loop to a DQMH Module

By default the Main VI of a DQMH module contains an Event Handling Loop (EHL) and a Message Handling Loop (MHL). The EHL is responsible for managing incoming request events, along with any user interface events for modules displaying a UI. The MHL is responsible for performing business logic pertaining to incoming request events or user interface events.

Sometimes, your DQMH module needs to handle periodic operations, or other resource-intensive event traffic that may not be suitable to handle with the EHL or the MHL. In these cases, it makes sense to create a Helper Loop in your DQMH Main VI so the EHL and/or MHL aren’t burdened with this extra event/message traffic.

To create a new helper loop in your DQMH Main VI:

  1. Go to Tools>DQMH Consortium>DQMH>Module>Add Helper Loop to DQMH Module.

  2. Select the DQMH module for which you wish to add a helper loop. This drop down menu will only list valid DQMH modules found within the project.

  3. Provide a name for the helper loop. The name must be different than any of the Existing Event Loop Names in the Selected Module that are displayed.

  4. Click OK to create the new helper loop. The module Main VI block diagram will be opened and you can scroll down to the bottom of the diagram to see the newly-created helper loop.


Ensuring Old Helper Loops are Compatible with DQMH Scripting Tools

Any helper loop created with the above procedure will be compatible with all DQMH Scripting Tools, notably the Create New DQMH Event tool. If your code has old helper loops that you created manually, you can ensure those loops are also compatible with the DQMH Scripting Tools by confirming the following:

  1. The Helper Loop has a visible subdiagram label, and there cannot be any other loop on the Main VI diagram with the same subdiagram label.

  2. The dynamic event registration terminal of the event structure in the helper loop is wired to a Register For Events function with a label of "DQMH_HELPER_REGFOREVENTS" (this label does not need to be visible). Note also that the entire request event cluster must be wired to the Register For Events function…​ this procedure will not work for a Register For Events node that only has certain unbundled request events wired to it.

  3. There is a call to the DQMH Error Handler - Helper Loop subVI at the end of each loop iteration, and the "Error Debug" input of that subVI is wired to a string constant with the label "DQMH_HELPER_LOOP_NAME" (this label does not need to be visible), and the value of that string constant matches the subdiagram label described in step (1) above.

  4. (cloneable modules only) The Cloneable Module Admin class must be wired to the event structure border.

  5. The DQMH Message Queue class must be wired to the event structure border.