In LabVIEW, how to access properties or methods of a Image Display within a SubVI?

Updated Jan 15, 2020

Reported In

Software

  • LabVIEW
  • Vision Development Module

Driver

  • NI-IMAQdx
  • NI-IMAQ

Issue Details

In LabVIEW, I want to programmatically control properties or methods of an Image Display. I can do that in my Main VI by creating a reference and connecting a property node.

 

Now I want to create a SubVI to handle all Image Display related methods or properties, but I can’t find a way to access the ImageControl reference. How can I do that?

Solution

To successfully handle all Image Display related methods or properties in a SubVI, you need to create a generic control reference on the SubVIs Front panel and then, using To More Specific Class, cast it to ImageControl type. Follow these steps:

(1) Create a generic control reference on the SubVIs Front panel



(2) Connect the Control Refnum to connector pane of the SubVI

To do this, follow LabVIEW SubVIs Explained, Section Assigning Terminals to Controls and Indicators

(3) Use To More Specific Class


(4) Right-Click on the upper input of To More Specific Class, Target Class, then click Create Constant

(5) A Generic Constant is created. Change it to Generic->GObject->Control->ImageControl

Now you are able to use a SubVI to handle all Image Display related methods or properties in your Main VI