LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to communicate an IMAQ Image Reference between applications?

Hello, I want to communicate and IMAQ Image Reference, created with "IMAQ Create", between local applications. One application is the camera driver that creates the Image Reference and does image acquisition. Another application would get an image from memory (with the Image Reference) and do some calculations with it. I could use the "IMAQ Create" function in the second application and use the same parameters (same Image Name and Image Type) as in the first. But this deletes the last image in memory which is unwanted. Thank you in advance.... Kudos will be given! :)
--------------------------------
The Enrichment Center is required to remind you that you will be baked, and then there will be cake.

Message 1 of 9
(4,597 Views)

Have you tried using IMAQ Copy?

Message 2 of 9
(4,595 Views)

Thank you for your reply.

 

For IMAQ Copy I need a second Image Reference plus extra memory space and a loop that continuously copies images as the camera is running. It has to be possible to acces the same image in memory with both applications.

--------------------------------
The Enrichment Center is required to remind you that you will be baked, and then there will be cake.

0 Kudos
Message 3 of 9
(4,592 Views)

Hi,

try just passing the Image Reference to the other Appplication. You can create the Connections on the Frontpanel with Vision -> IMAQ Image.ctl

If this is about some sort of live-evaluation of pictures, have a look at the consumer-producer-loop architecture.

 

Or did I understand your question incorrectly?

Greetings

Message 4 of 9
(4,583 Views)

hmm so you acquire an image then you pass it through an application that does some calculations on it, right? so do you want all the images to be accessible in memory or just the previous/current image?  You could try creating a memory buffer and just extract the relevant IMAQ reference when you need it.

Message 5 of 9
(4,582 Views)

Thank you for your replies.

 

@kper

It are 2 seperate applications, 2 seperate executables. Therefore it is not possible to use Frontpanel elements to connect 2 applications or use the Producer/Consumer design pattern.

 

@Nik1

I only want the current image to be accessible in memory. "You could try creating a memory buffer and just extract the relevant IMAQ reference when you need it." How can I do this, please explain.

 

Please let me try to explain myself in other words. One application already made an Image Reference using the "IMAQ Create" function. A second seperate application (on the same machine) would ideally get access to the same Image Refence in memory, but I have no idea how to program this. Using "IMAQ Create" a second time with the same parameters at the inputs works, but deletes the current image in memory. Which is highly unwanted.

 

 

--------------------------------
The Enrichment Center is required to remind you that you will be baked, and then there will be cake.

0 Kudos
Message 6 of 9
(4,567 Views)
An IMAQ reference is just like a pointer. As such there is NO way to pass it to another application and have that application work on it. It is totally meaningless to that application. There os no other way than to extract the image content and pass that to the second application. Some possible means: shared memory, tcp/ip comm, image file on disk, ...
Rolf Kalbermatter
My Blog
Message 7 of 9
(4,563 Views)

If they are in 2 different VIs, then you can't do what I suggested and roflk is correct (as far as I know). Would it work if you embedded 1 of the applications into the other? So you had 1 application as a sub-vi in the main vi?

Message 8 of 9
(4,556 Views)

I know I'm very late, but I hope it will help other people.

 

Not sure if it will work between apps (not sure if they share an environment, but they should share a run-time engine at least), but you can indeed store images in memory and pass them between sub-VIs using this trick, you just need to implement it a bit differently.

 

If you place a probe on an image wire and inspect it, you can notice that its value is represented as a string which you have passed to IMAQ Create VI. So you can simply coerce image name to IMAQImage type or use it directly as a reference with automatic coercion.

To check if image with such name already exists you can use Not A Number/Path/Refnum? function.

0 Kudos
Message 9 of 9
(2,683 Views)