01-17-2012 04:46 PM
Hello,
I am currently trying to read an array from a file in my CompactRIO host code. However, I seem to be having trouble defining the correct path for the file as I keep on getting file not found errors. My file is in my LabVIEW Data folder within my My Documents folder as well as the LabVIEW Data folder on the CompactRIO (I put it there using FTP).
However, whether I use
D:\Users\rwil267\Documents\LabVIEW Data\TestProfile.txt
OR
C:\LabVIEW Data\TestProfile.txt
I get an error 7 which is file not found.
I also put the same file in a folder called LabVIEW Data which I created in my computer's C drive but this didn't work either.
Any help would be much appreciated,
rustawilliams
01-17-2012 05:05 PM
Could you post your code so it's more clear exactly what you're doing? Are you using strings, or paths? Which function are you using to read the file and where does the error occur? If the folder "LabVIEW Data" exists on the C drive of the cRIO, and your file is inside it, you should be able to read it. Note that the cRIO cannot read files from your local PC (because they're different computers).
01-17-2012 05:25 PM
Hey,
I have solved this problem for people who look at this in the future. I needed to use the Default Data Directory VI then the Build Path VI with the name of the file as the 'name' input. This wired into Open/Create/Replace File VI as the file path will load a file placed in the LabVIEW data directory on the compactRIO (put there using ftp). See attached PNG.
Thanks,
rustawilliams