11-21-2019 10:40 PM
I am getting this error when I am attaching close reference in my labview vi.
11-21-2019 11:21 PM
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.
11-22-2019 07:22 AM
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
11-22-2019 01:45 PM - edited 11-22-2019 01:46 PM
@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.