Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Creating a User-Defined Comparison VI (Unit Test Framework Toolkit)

LabVIEW 2009 Unit Test Framework Toolkit Help

Edition Date: June 2009

Part Number: 372584B-01

»View Product Info

Complete the following steps to create a user-defined comparison VI.

  1. Select File»New VI to create a new, blank VI.
  2. On the Controls palette, select Modern»Variant & Class to display the Variant & Class palette.
  3. Add a variant to the front panel and label the variant Resulting Value.
  4. Right-click the variant and select Change to Control from the shortcut menu.
  5. Add another variant to the front panel and label the variant Expected Value.
  6. Right-click the Expected Value variant and select Change to Control from the shortcut menu.
  7. On the Controls palette, select Modern»Boolean to display the Boolean palette.
  8. Add a Round LED or Square LED Boolean indicator to the front panel and label the Boolean indicator Comparison Result.
  9. Right-click the icon in the upper right corner of the front panel window and select Show Connector from the shortcut menu to display the connector pane. The connector pane replaces the icon.
  10. Right-click the connector pane and select Patterns from the shortcut menu. Select the following connector pane pattern.

  11. Assign the following connector pane terminals to the front panel terminals:
    1. Top left connector pane terminal to the Resulting Value variant control.
    2. Bottom left connector pane terminal to the Expected Value variant control.
    3. Right connector pane terminal to the Comparison Result Boolean indicator.
    Note  You must configure the connector pane properly in order for the user-defined comparison VI to work properly.
  12. Display the block diagram by selecting Window»Show Block Diagram.
  13. Add or define your own comparison to the block diagram.
  14. Wire the Resulting Value and Expected Value variant controls to the comparison.
  15. Wire the result of the comparison to the Comparison Result Boolean indicator.
    Note  The comparison must return a Boolean data type.
  16. Select File»Save As to save this user-defined comparison VI in an easily accessible location.

Refer to the labview\examples\Unit Test Framework\Custom Comparison\Custom Comparison.lvproj for an example that demonstrates how to use user-defined comparison VIs in the Unit Test Framework Toolkit.


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit