To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This example demonstrates how to transfer an IMAQ image from one VI to another with a queue.
Description
These two VI's illustrate how to pass image data between two different VI's on the same computer. Since the image data type is actually a pointer to the image, rather than the image data itself, we will be passing the reference to the buffer that holds the image.
In this example, queues are used.
By using the same queue name for each "Obtain Queue", we can have access to the same queue. (This works as long as both VI's are on the same machine). Once we have read the image from a file on the host machine, we pass the image into the queue. In the second "receiver" VI, we read from the queue, and then dequeue the image element. Once we've dequeued the image, all we need to do is call "refresh image" and the image will update. We do not need to keep dequeing and enqueing the image, because we are just reading from the location in memory.
Note that this is different from other LabVIEW datatypes.
Requirements
Software
Hardware
Steps to Implement or Execute Code
Additional Information or References
Note
Please keep in mind, that this example doesn't provide any synchronization between the transmitter and the receiver.
The receiving VI shows sometimes no overlay. This happens, if the receiving VI reads the image after the overlay was cleared but not written again (if the read happens between the steps 3 in the block diagram).
**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.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.