Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help on passing an image from sub vi to main

Solved!
Go to solution

Hi all,

 

I'm having trouble setting up a Control refnum. here's what I'm doing and what isn't happening.

 

I have an acquisition loop that runs continuously and puts images into a queue. From there a sub vi takes the next image and does some processing. I want to display the resulting image in the front panel of my main vi.

 

Having read the advice here on this subject I understand that I have to put a Control Refnum on the sub vi. When I do that I then go to configure it as an image control and this is where I'm stuck. Right clicking on the front panel and going through Select VI Server Class >> Generic>> GObject>>Control, on the front panel there's no image control mentioned. When I do this from the block diagram ImageControl is listed but I can't select it. I click but nothing happens. Am I missing something here?

 

BTW: LabVIEW 2015.

0 Kudos
Message 1 of 7
(2,906 Views)

By the way, "Image" refnum holds a reference to the memory where the pixel data is temporarily stored. This memory could be overwritten if other data comes in before you display the data on the front panel. Putting the image refnum into queue does not allow you to save the image pixel data into the queue.

 

I think you can right click the Image Control and create new refnum.

0 Kudos
Message 2 of 7
(2,827 Views)

I appreciate the reply but I don't understand it. The image queuing is working fine - it's just a LabVIEW example I've tailored for my needs. My issue is with creating a Control Refnum for moving an image from sub to main vi.

 

I have created an image control from the sub vi image and dropped it into the main vi block diagram. Right clicking doesn't offer me a way to create a new refnum. Attaching a picture so you can tell me if I've misunderstood.

 

0 Kudos
Message 3 of 7
(2,794 Views)

Let's bump this up with some more info.

This Knowledge Base article says "Select the appropriate VI Server Class based on the type of control in the main VI. Right-click the Control Refnum and select Select VI Server Class >> Generic >> GObject >> Control >> [select type of control]"

When I try that it won't select Image Control. What am I doing wrong? Doe sit matter that I'm using LV 2015?

 

0 Kudos
Message 4 of 7
(2,750 Views)
Create Generic Object Control Refnum and then use Variant to Data Conversion with image data type inside subvi.
Thanks
uday
0 Kudos
Message 5 of 7
(2,734 Views)
Solution
Accepted by topic author another_novice

For some reason, you are not allowed to make a control out of an image reference.

In that case, what I do is that I store the image to a global variable and read that same variable on my GUI.vi

0 Kudos
Message 6 of 7
(2,720 Views)

A Global did the job. I'd always been advised to avoid using Globals, so this was my first time. Worked exactly the way I needed.

0 Kudos
Message 7 of 7
(2,659 Views)