LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to rectify this error?

I am getting this error when I am attaching close reference in my labview vi. 

0 Kudos
Message 1 of 4
(731 Views)

You attached about the tiniest screenshot barely showing anything of your code.  It is nearly impossible to debug pictures.  You should have attached your VI.

 

But nearly is not completely impossible.  I think you just barely caught the problem in that picture.

 

Do you see that tunnel for the reference wire going into the Close function.  (I'm assuming that is the Close Reference that is causing the error.)

It is hollow.  That means you have it set to Use Default if Unwired, which is almost always a bad option for tunnels.  As a result, you are probably executing a case where you failed to wire the tunnel, and the Null Refnum (the default value for a refnum) is being passed out to the Close Reference.

 

Right Click on that tunnel and uncheck Use Default if Unwired.  Then go back and wire that refnum through ALL of your cases.  Your VI will have a broken run arrow until you fixed it for every case.

0 Kudos
Message 2 of 4
(721 Views)

When you execute some other case you'll send out a Default value (NULL) which causes the error when trying to close as a ref.

/Y

G# - Award winning reference based OOP for LV, for free! ADDQ VIPM Now on GitHub
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 4
(672 Views)

@RavensFan wrote:

You attached about the tiniest screenshot barely showing anything of your code.  It is nearly impossible to debug pictures.  You should have attached your VI.

 

But nearly is not completely impossible.  I think you just barely caught the problem in that picture.

 

Do you see that tunnel for the reference wire going into the Close function.  (I'm assuming that is the Close Reference that is causing the error.)

It is hollow.  That means you have it set to Use Default if Unwired, which is almost always a bad option for tunnels.  As a result, you are probably executing a case where you failed to wire the tunnel, and the Null Refnum (the default value for a refnum) is being passed out to the Close Reference.

 

Right Click on that tunnel and uncheck Use Default if Unwired.  Then go back and wire that refnum through ALL of your cases.  Your VI will have a broken run arrow until you fixed it for every case.


Starting with LV 2012(?) you can right-click on the same tunnel, but instead select "Linked Input Tunnel --> Create & Wire Unwired Cases".  Your cursor will turn into a hollow tunnel with a wire spool.  Place this cursor over the tunnel on the opposite side of the structure that corresponds to the one you right-clicked on and click.  All cases that aren't wired will become wired, most likely fixing your issue.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 4 of 4
(639 Views)