Calling Dynamic Dispatch VIs
- Updated2025-03-28
- 2 minute(s) read
Calling Dynamic Dispatch VIs
Purpose
This example demonstrates how you can use dynamic dispatch with LabVIEW classes directly from a TestStand sequence to implement a hardware abstraction layer (HAL). In this approach, TestStand calls the implementation of each Class VI corresponding to the class you select in the initial dialog.
Example File
Location
<TestStand Public>\Examples\Fundamentals\Calling Dynamic Dispatch VIs\Calling Dynamic Dispatch VIs.seq
Highlighted Features
- LabVIEW Adapter - Class Member Call
- Dynamic Dispatch
Major API
None
Prerequisites
The LabVIEW 2012 Run-Time engine or LabVIEW 2012 or higher development system is required to execute this example. Dynamic dispatch support in TestStand requires LabVIEW 2012 or higher.
How to Use This Example
Complete the following steps to run the example:
- Select Execute»Single Pass to execute the sequence.
- When prompted, select the DMM base class and click OK.
- When the sequence completes, view the report. Notice that the report text indicates the class used.
- Select Execute»Single Pass to execute the sequence again.
- When prompted, select one of the child classes and click OK.
- When the sequence completes, view the report. Notice that the report text has now changed because the steps called the specific VIs in the class you selected.
Complete the following steps to review the sequences and steps in this example:
- In MainSequence, select the Select Class VI. This VI returns a reference to a different LabVIEW class based on the user selection. The VI can return the parent DMM Base class, or one of two child classes—PCI-4070 or Simulated DMM. Note The Initialize, Read, and Close steps are configured using the Class member call call type in order to call members of the Generic DMM class. Based on the class selected previously, TestStand dynamically selects the implementation of the class VI which matches the class reference. This action allows the sequence to behave differently based on the type of LabVIEW class reference selected.
- To view the implementation of the LabVIEW classes, open classes.prj, located in <TestStand Public>\Examples\Fundamentals\Calling Dynamic Dispatch VIs.