LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I see file sizes and disk space remaining on RT controller?

Does anyone know a way to get a complete disk directory, including space available, for the hard drive in a PXI embedded controller? FTP shows directory structure, but doesn't give file sizes and available space. I'm running LabVIEW 6.1 RT on an 8175 PXI controller. Thanks.
0 Kudos
Message 1 of 6
(4,292 Views)
You can use the LabVIEW functions from the Functions>>File I/O>>Advanced File Functions palette to give you this kind of information. The two main functions you would probably be interested in would be the 'List Directory' function which lists the directories and file names for a given directory path, and 'File/Directory Info' which returns the size and the date last modified. There is also a 'Volume Info' function which returns information about the drive such as used and free space. There is an example of a file explorer that ships with LabVIEW which you could target to the RT system and run to view all of this information. The example is named 'Listbox for File Explorer Demo.VI' and can be found at ..\LabVIEW 6.1\examples\general\controls\listbox1.llb.


Regards,

JR A.
Application Engineer
National Instruments
0 Kudos
Message 2 of 6
(4,292 Views)
Thanks. Exactly what I needed.
0 Kudos
Message 3 of 6
(4,292 Views)
Alas. I modified the example vi (see attached file) and it runs perfectly on Windows 2000, but when targeted to the RT system, the free and used parameters seem to return bad values. Perhaps the RT operating system doesn't support these calls??
0 Kudos
Message 4 of 6
(4,292 Views)
I tried both the original example and your modified verion of it and both seem to work properly. I tried it on a PXI-8146 controller which has a CompactFlash card for a hard drive. I then removed the CompactFlash card and inserted it into a CompactFlash Reader so that I could look at it with my Desktop machine directly. The free space was exactly the same (down to the last byte). The total space and used space was a slightly different but not significantly and was probably due to the RT system reporting memory that the drive is required to use for things like the file allocation table. I'm not a drive expert but this doesn't seem uncommon to me since I wasn't surprised that Windows reported my 32 MB CompactFlash Card as 30.2 MB. The free m
emory and the file sizes are correctly reported. Also, in your VI you divide by 1,024,000 to convert to MB and it technically should be 1,048,576 which is 2^20. Let me know if you have questions.

JR A.
Application Engineer
National Instruments
0 Kudos
Message 5 of 6
(4,292 Views)
Well, I still seem to be getting different results with the 8175 controller. Attached are screen shots of the vi targeted to both the Win2000 and RT systems. Disk size is correct in both cases, but the RT system seems to be returning a bad value for both used and free, which appears to be 2^26?! I did modify the vi a bit and moved the volume info node outside the while loop, since there's no point in continuously executing it. And I used 2^20 for the divisor.
Download All
0 Kudos
Message 6 of 6
(4,292 Views)