Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot create a control or indicator for an Image Display refnum in LabView

Solved!
Go to solution
I need to pass a refnum to an Image Display control, but find that I cannot create either a control or indicator for such a refnum.  I can create the refnum with no problem, and when I right-click on the refnum I am given the options to create a control or indicator; however, when I select either of these options no control or indicator is created.
0 Kudos
Message 1 of 7
(4,370 Views)

I figured out how to do this not too long ago.  Create a refnum control for practically anything on a front panel.  Drag an Image Display control and drop it on the refnum control.  The refnum control magically turns into an Image Display refnum!!

 

I recommend making this a strict type def, then using the type def anywhere you need it in your program.  When I upgraded from Vision 8.5 to 8.6, there was a glitch in my program that crashed it until I recreated my refnum from scratch.  I had to replace it in several places in my program.  Being able to recreate it just in a type def would have made life simpler.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 7
(4,365 Views)

Thanks for the help Bruce.  I tried this, and it doesn't quite work for me.  The dragging and dropping works as expected.  However, when I try to use the resulting control, I get the following error:

 

Compiler Error: Control not in owning dco, ddo=0x8C58020

 

This is true independent of trying to hook it up; i.e., if I just create it, and then try to turn it into a strict typedef as you suggested, the .ctl itself doesn't compile, and I get the error shown above.  I am using LabView 8.5 right now.  You mention having to recreate your refnum from scratch - could you elaborate a bit on that?

 

Greg Flynn

0 Kudos
Message 3 of 7
(4,350 Views)

I thought I described exactly how I created the control.  Perhaps I left out one step that I have forgotten.

 

I have attached my type def control.  It is LV 8.5.  Hopefully it will work for you.

 

Bruce

Bruce Ammons
Ammons Engineering
Message 4 of 7
(4,348 Views)

Hi Bruce,

 

Thanks again.  The control that you sent me looks and acts just like the one I created using your instructions, so I guess they were clear.  As soon as I place the control in a VI the VI breaks, and I get the compliation error shown in my previous post.  If I simply  open the control, modify it (e.g., by changing the label), and then try to save it it fails to compile and I get the same error message.  I think we can safely conclude that my LV 8.5 behaves differently than yours.  Are you running on XP or Vista?

0 Kudos
Message 5 of 7
(4,346 Views)
Solution
Accepted by topic author gflynn

I am running XP.  I installed Vision 8.6 at one point, but had to uninstall it because it corrupted this control.  I don't know if it affects this type of control on a lower level.

 

You could probably do this the hard way using a workaround.  Convert your reference to a variant or flatten it to a string or typecast it to an integer - whatever LV allows.  In the subvi, convert it back to a reference.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 6 of 7
(4,342 Views)

Hi Bruce,

 

Thanks one last time.  Converting to variant works.  I'm on Vista, which has been a constant source of problems.  Don't know if that's the difference in this case.  I too have installed, and then uninstalled LV 8.6, in my case because I was using a driver that was incompatible with 8.6.  So, I suppose it's possible  that there is some vestige of 8.6 lingering on my computer causing problems.  In any event, I appreciate the work-around.

 

Greg Flynn

0 Kudos
Message 7 of 7
(4,333 Views)