LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FPGA Open/Create/Replace File Error

Solved!
Go to solution

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.

0 Kudos
Message 1 of 12
(3,582 Views)

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?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 12
(3,577 Views)

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.

0 Kudos
Message 3 of 12
(3,561 Views)

 

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 ?

0 Kudos
Message 4 of 12
(3,555 Views)

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.

0 Kudos
Message 5 of 12
(3,542 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 6 of 12
(3,541 Views)

@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.

Message 7 of 12
(3,536 Views)

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?

0 Kudos
Message 8 of 12
(3,515 Views)

What is the shared folder name?  Assuming the file is directly in that folder, it should be "\\PC Name\shared folder name\file name".


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 9 of 12
(3,498 Views)

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.

Download All
0 Kudos
Message 10 of 12
(3,480 Views)