Example Code

How to Send Images Between Two VIs in 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

  • LabVIEW

Code and Documents

Attachment

Overview
This simple example can be used as a starting point to creating "efficient" ways to read the incoming TCP messages.


Description
Sometimes you may wish to interface with instrument or devices over TCP without using the VISA library.

In such cases, it is not uncommon to not know how many bytes incoming messages will consist of, and most of the time you have no control of the transmitting side which may or may not implement CRLF (aka \r\n) as the termination character(s).

 

 
Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Unzip " TCP Query And Read 2012 NIVerified.zip"
  2. Use or modify “TCP Query 2012 NIVerified.vi” in your program

 

Additional Information or References
VI Block Diagram

 5-204.png

 **This document has been updated to meet the current required format for the NI Code Exchange.**

Applications Engineer
National Instruments

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

Comments
STSLabs
Member
Member
on

How did you create the "Grab" reference in the Read vi?  I've tried a number of different ways but can't seem to figure it out.

Eric-J
NI Employee (retired)
on

Hi!

You can create the constant by right-clicking on the input to the Image Display on the Block Diagram and select Create > Constant. Next, double click inside the constant and type the name of the buffer you wish to access. Hope this helps!

Applications Engineer
National Instruments