LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

shift regsiter pass file reference problem

Solved!
Go to solution

Hi, I met some problem when I use shift register to store file reference, please refer to attachement.

I want to implent the function that every hour a new file would be create, and close the old file. but the close file.vi reported error message, said error source is can't close file. other parts in the diagarm works well.

 

 

0 Kudos
Message 1 of 3
(2,269 Views)

Your not a refnum constant and the type on the SR are not the same.  use the comparison "not a number/path/refnum" in place of the equal to


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 3
(2,258 Views)
Solution
Accepted by concorpoly

Are you testing this VI by itself or as a called subvi?  LabVIEW will automatically close the file reference once the top level caller stops running, even if you don't close it in code.  The ref info will remain in the shift register but it's no longer valid.  This means it passes the not a ref test but Close File can't use it.  I threw a loop around your code to keep it running(as if it were a subvi) and everything worked.


--Using LV8.2, 8.6, 2009, 2012--
Message 3 of 3
(2,255 Views)