LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reference passed to a subVI not working well in 7.1

Hi there.

I wrote a small VI in LV 7 to detect the coordinates of a click on a 2D array. The point was that you use a mouse down event and feed the CtlRef and Coords into it and get X,Y out of it. It worked beatifully.
Then, I ported it to 7.1 and suddenly I started getting 2147483647 as a result (because of the division by NaN) and the following error:

Error 1320

LabVIEW: In edit mode, LabVIEW cannot return a property for a control part that you have not yet created.

So I said, why not try including the data type with the reference, maybe it will like that?
Didn't help...
So I tried running the top VI once with the subVI open and then, after it recieved the refence, running the subVI itself.
Bingo - now it works.

So, what's going on? Why is it that LV thinks I created the "control part" only after I manually run the VI after it recieved the ref? And why wasn't it like this in 7?
Obviously, I tried looking for info about this error on the site, but no results.

___________________
Try to take over the world!
0 Kudos
Message 1 of 5
(3,581 Views)
tst,

I took a look at the code and the issue has to do with the array's caption. If I run your code on an array that never had a visible caption I get the error. However, if you make it visible then invisible the error goes away.

This also explains the text of the error. LabVIEW has not created the caption for the control yet because there was no need to. Therefore you can not get properties of a non-created object.

I am making a report of this so that we can investigate how this should behave in future versions.

For your code what I suggest is querying who is visible one at a time, and if you get an error from that, you know the item is invisible because it was never created.
0 Kudos
Message 2 of 5
(3,550 Views)
I found the same bug back in Oct. and reported it here as well as in the LAVA buglist.

It seems I reported it to NI support, but I do not have a conformation email about it, so maybe I didn't get that part done.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 3 of 5
(3,546 Views)
So it comes down to ranting about 2 things: the search engine which only gives the correct results if you set it to search the forums (which I shall do in the appropriate thread) and the decision to change this behavior. Looks like I should have searched LAVA as well. Thanks, guys.

Addition: So why is it that when I had the subVI open, ran the top VI once to pass the ref to the subVI and then ran the subVI itself it worked fine? The caption was still invisible. This definitely looks like unwanted behavior to me

Message Edited by tst on 04-14-2005 09:39 PM


___________________
Try to take over the world!
0 Kudos
Message 4 of 5
(3,542 Views)
I'm not sure they intended to change the way it works. It just doesn't make sense to have to manually turn on the Caption before you can use a property on it.


Addition: So why is it that when I had the subVI open, ran the top VI once to pass the ref to the subVI and then ran the subVI itself it worked fine? The caption was still invisible.


The Caption being "invisible" or turned off isn't the problem. The problem is if you've never turned it on. It doesn't get created until you do that, so any properties that operate on it won't work.

However, if you meant that the Caption in question had never been created, I have no idea why it worked. Something we'll have to look for LabVIEW 8 to see if works correct.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 5 of 5
(3,532 Views)