From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Transmit IMAQ Image by flattening to data string

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

The example demonstrates how to transmit an image by flattening the image to a data string.

 

Description

Most data transfer mechanisms only accept byte arrays or strings as an input. To transmit IMAQ images the image has to be first converted to a string and then after receiving the image converted back to the IMAQ image data type.
To accomplish that, the IMAQ palette features the 'IMAQ Flatten Image to String' function to generate a data string from the IMAQ image. To convert the data string back to an IMAQ image the 'Unflatten from String' function from the Data Manipulation Palette is used.

 

Requirements

 Software

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

 Hardware

  • No hardware is necessary to use this example VI

 

Steps to Implement or Execute Code

  1. Run the VI

 

Additional Information or References

Transmit image through serial LV2012 NIVerified.vi - Front Panel.png

 

Transmit image through serial LV2012 NIVerified.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.**

Kevin R
Applications Engineer
National Instruments UK&Ireland

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