11-24-2008 05:31 PM
Solved! Go to Solution.
11-24-2008 09:56 PM
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
11-25-2008 07:49 AM
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
11-25-2008 08:02 AM
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
11-25-2008 08:16 AM
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?
11-25-2008 08:29 AM
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
11-25-2008 09:00 AM
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