Example Code

Access IMAQ Images Based on their Pointer using LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • Vision Development Module
  • LabVIEW

Code and Documents

Attachment

Overview

This example rdemonstrates how to access an IMAQ image by its pointer.

 

Description

Two VIs are used in this example. The first VI, Create Image.vi creates a space in memory for IMAQ to place an image, and then reads an image file from disk based on a dialog box. It then keeps this reference open until the display VI stops its running loop via a notifier. The second VI, Display IMAQ Image from Pointer.vi, allows the user to specify a string which is then type cast to IMAQ type. By doing this, LabVIEW now associates this IMAQ wire with any IMAQ session created under the same name. So, this second VI, running in parallel, may access and display the image created by the Create Image VI. This method will only work across VIs/custom devices running on the same machine.

 

Requirements

 Software

  • LabVIEW Base Development System 2012 (or compatible)
  • NI Vision Development Module 2012 (or compatible)

 Hardware

  • No hardware is necessary to use this example VI

 

Steps to Implement or Execute Code

  1. Download and open the attached file
  2. Run the program

 

Additional Information or References

Create Image.vi - Front Panel.png     Create Image.vi - Block Diagram.png

 

Display IMAQ Image from Pointer.vi - Front Panel.png     Display IMAQ Image from Pointer.vi - Block Diagram.png

 

**The code for this example has been edited to meet the new Community Example Style Guidelines. The edited copy is marked with the text ‘NIVerified’. Read here for more information about the new Example Guidelines and Community Platform.**

Matt J - NI Tools Network

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
Tinnotek
Member
Member
on

Nice approach!!!

This technique allow us to access the image anywhere in the application with string.

I tried to use this technique to control the CCD and it worked well though.

You can try to use a string constant "cam0" type casted to CCD session then snap some image.

It just works the same as this approach.

IMAQ String Reference.png