04-01-2013 10:16 AM
Hey Guys,
I'm having a problem where when I try to use the Read from Spreadsheet VI in my RT Host Application, it returns error code 7 (cannot find file or file does not exist) when it calls the Open/Create/Replace File Function. The function works fine when used in a standalone VI that's not part of the FPGA project and I've ensured that my File Path is correct but for some reason it does not work in my FPGA application. I've placed probes and ensured that the correct file path is linked to the function input but the error persists. The file refnum output is returning 0 as well, not 'Not A Refnum'. Does anyone have an idea about why I'm getting this error or if I'm the only one? Any help would be appreciated. Thanks.
Solved! Go to Solution.
04-01-2013 10:27 AM
RT or FPGA? FPGAs can't open files. So I'm going to assume you are talking RT.
Are you trying to open a file that's on your PC or on the RT computer?
04-01-2013 11:52 AM - edited 04-01-2013 11:53 AM
Hi crossrulz,
Thanks for your reply. Yes as I've stated it's on my RT Host. The file I'm trying to open is on my PC. I have a cRIO-9074 controller set up with my PC and I'm trying to open a text file on my computer. The test file I'm using is in My Documents folder but I've also tried it in my root C:/ folder with the same results. Thanks.
04-01-2013 12:21 PM
Remember that the Rio is just like any other PC on a network. To have other PC's access a file on your PC, you need to share it. Have you done that ?
What is the path you are using on the RT to the file your are trying to read ?
04-01-2013 12:48 PM
Hi dkfire,
Thanks for your reply. No I have not taken any special actions to share the file over the network. My file path is just something like C:/mydata.txt. I'll look into sharing files. Would you happen to have a link to a reference I could use? Thanks again for your help.
04-01-2013 12:48 PM
Is the file on your PC in a shared location? If so, what is the network path to that file? That is what the cRIO system needs for the file location.
If you aren't sharing the file, you need to FTP the file to the cRIO and have the cRIO locate the file in its own directory structure.
04-01-2013 01:11 PM
@Uxorious wrote:
Hi dkfire,
Thanks for your reply. No I have not taken any special actions to share the file over the network. My file path is just something like C:/mydata.txt. I'll look into sharing files. Would you happen to have a link to a reference I could use? Thanks again for your help.
If the path is c:\mydata.txt, why do you think the RIO is looking for a file on your PC ?
Remember at the RIO is a standalone unit that has its own file system. It is independent of your PC.
Sharing files on a windows PC is something everybody can do, if not, try Google.
When you have shared the file with the network, remember to change the path on the RIO for the correct network path.
Else move the file to the RIO's c-drive.
04-01-2013 07:41 PM
Hello again.
So I'm able to open a file if I copy it to the RT Target and open it from there but I'm still unable to open a file directly from my PC even after enabling network sharing for the folder. I used the file path in the form "\\PC Name\file path" but I receive a dialog box saying that I need an absolute and not a relative file path. I tried "\\IP Address\file path" but I get the same message. In what form is the absolute path that Open File is asking me for?
04-02-2013 07:46 AM
What is the shared folder name? Assuming the file is directly in that folder, it should be "\\PC Name\shared folder name\file name".
04-02-2013 12:48 PM
The shared folder is called Trajectories and the file I'm trying to open is called mydata.txt. The file path I specified is "\\PC Name\Trajectories\mydata.txt". I'm still receiving the same error. I've attached screenshots as a reference.