LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

refnum

I have just started using Labview 2014 and found that they file I/O has changed, and seemingly not for the better.  I used to be able to specify that the file using a simple path and then in going from one vi to another I would just input that path and specify append.  Now it appears I do not have that option, apparently if I want to append I need to bring out the refnumber.  However I cannot seem to locate where the indicator refnum is.  In the second vi I put the read file and all I can get is a file path.

Download All
0 Kudos
Message 1 of 5
(2,992 Views)

DrLarry a écrit :

I have just started using Labview 2014 and found that they file I/O has changed, and seemingly not for the better.  I used to be able to specify that the file using a simple path and then in going from one vi to another I would just input that path and specify append.  Now it appears I do not have that option, apparently if I want to append I need to bring out the refnumber.  However I cannot seem to locate where the indicator refnum is.  In the second vi I put the read file and all I can get is a file path.


I don't know what was the previous version of LV you used but I don't remember the File I/O vi being different. To create a refnum indicator you can right-click on the refnum output of a file i/o vi and select Create Indicator or you can use the Byte Stream File refnum from the Modern Controls Refnum subpalette. The input of the Write Text File.vi is polymorphic you can connect a refnum or a path.

 

Ben64

0 Kudos
Message 2 of 5
(2,977 Views)

Thanks Ben.

That gives me enough information to work with it.

0 Kudos
Message 3 of 5
(2,943 Views)
To append to an existing file, you need to use Set File Position to set the position to the end. If I remember correctly this was a change from older versions of LabVIEW (well before 2014, though) where there was an option to open for append. If you open an older VI that used this functionality in a newer version of LabVIEW, it automatically inserts the set file position function, but in a funny way where it's stacked under the open file function.
0 Kudos
Message 4 of 5
(2,925 Views)

That change of the File IO functionality was specifically between 7.1.1 and 8.0, where the File IO API was significantly remodeled. As mentioned, when upgrading old code (<8.0) LabVIEW should add automatically the necessary nodes to make the code behave the same with the new API but if you create new VIs while being used to the old behaviour you may run into a few difficulties, but non of them preventing you to achieve what you where able to do before, it just requires sometimes to add extra nodes, since the explicit offset settings for the Read and Write have gone for performance reasons as they often weren't even used.

Rolf Kalbermatter
My Blog
0 Kudos
Message 5 of 5
(2,879 Views)