LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Image Display reference problem

Has anyone seen this problem or better yet have a work around for it.

I have an image display that I want to create a ImageControl reference and pass it out of the vi.  I create a reference to the display and then when I create the indicator, to vi will not run due to an error associated with the indicator.  I have attached an example (LV8).

It seems to work OK if I create the same vi in LV7.1, but not in LV8.01.  I am doing to work in LV8.0 so it is not really feasible to constantly go back and forth between the two versions.
Randall Pursley
0 Kudos
Message 1 of 12
(4,296 Views)
Randall
 
The VI is broken for me in LV8.0 with Vision 7.0
 
David
0 Kudos
Message 2 of 12
(4,283 Views)

I can also confirm that there is no problem with 7.1

David

0 Kudos
Message 3 of 12
(4,281 Views)

Randall

Would you consider passing the Pane reference out of your vi and then using that to access the methods and properties of the image indicator?

David

Message Edited by David Crawford on 07-19-2006 08:50 PM

Message Edited by David Crawford on 07-19-2006 08:52 PM

Message Edited by David Crawford on 07-19-2006 08:53 PM

Message 4 of 12
(4,279 Views)
This is essentially what I am already doing.  Not the elegant solution I was hoping for, but it will have to do for now.




Randall Pursley
0 Kudos
Message 5 of 12
(4,250 Views)
Hi David, Hi everyone!

I'm quite having the same problem: There is no way to pass an ImageControl reference into an SubVI.
I tried out your solution in a small test environment and it worked perfectly. Now I implemented it into one of my bigger projects and it stopped working. I can't figure out where the problem is! Perhaps you got an idea?

I'm just doing it as always: Create a pane reference and pass it to the SubVI.
Because I was not able to write any Images to the ImageControl from the SubVI I added the Pane property node, the index array and the Specific Class Cast to the main VI.

When I run the VI the following error is thrown: "Error 1057 occurred  at To More Specific Class in Main.vi (Type mismatch: Object cannot be casted to the specific type)"

In the attachment you find a picture of my code.

I'm using LabVIEW 8.2 OOP on WinXP with IMAQ and DAQ devices.

Thanks a lot in advance and best regards,

Benjamin
0 Kudos
Message 6 of 12
(4,086 Views)
Your "image" seems to be a variant, since it is red, not blue. So, you need to cast the control to a variant, or change the control to a picture control.


Btw. If you right click the terminal, you should be able to select "Create Reference" without any problem.


Regards,


Wiebe.
Message 7 of 12
(4,071 Views)
Hi Benjamin

You would need to index the correct control for the typecast to work correclty. My example indexes the only control on the front panel which is Index=0. I expect that you have more controls than that on your front panel so you will need to find the correct index.

Look at the NI Example "Queue Control Reference Info.vi" to learn more about "To More Specific Class" function.

Hope this helps...

David
Message 8 of 12
(4,067 Views)
Hey you both!

Thanks a lot! Now it works! 🙂 I could have got the idea on my own. It's index number 7.
One more thing: How can I ensure that the index stays the same in case I change sth on the front panel? Now if some controls are added or removed the number will be changing, right?

Thanks a lot and best regards,

Benjamin
0 Kudos
Message 9 of 12
(4,060 Views)

In figure 6 of rely #1 you will find an example that ilustrates a trial and error approach.

Ohter approaches include making sure your tabbing order always has the image at the same index or you can check the name of each control looking for a match.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 10 of 12
(4,050 Views)