From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving files directly from myRIO to computer

Solved!
Go to solution

Hi all,

 

I encountered a rather bizarre yet simple issue. In my myRIO project, I used to save files directly on myRIO (using a file path constant), and it works. For example, the path I saved this following file(RawData_Fly2_E1_F_2016Jan26.tdms) is this:  

 

/c/RawData_Fly2_E1_F_2016Jan26.tdms

 

With the above address, this file is saved to this location: R:\c\RawData_Fly2_E1_F_2016Jan26.tdms

 

However, now my project started to generate very big files, so I want to save the files directly to my computer, to which the myRIO is connected via a USB device cable. I specifiled my file to be saved directly under C disk.

 

I did the following changes: I used the File Path Control to specify the location, instead of using file path constant.

 

But with this change, my file cannot be found. It basically is gone...All the files that contain this change of location cannot be found in the specified location or original location.  

 

Here is a screenshot of my file path control and file path indicator directly reading the file path.

 

Would you guys help me how to correctly save files directly from myRIO to computer?

 

Thank you!

0 Kudos
Message 1 of 6
(10,876 Views)
Solution
Accepted by topic author bazingagirlsun

Think of the myRIO as a computer - running its own OS and with it's own file system. The LabVIEW code you write runs on that computer so, without some sort of networking/file transfer, it can't acccess your computer.

 

Typically you would either:

1) Stream the data over the network to a VI running on your computer (e.g. network streams) which then saves it to disk on your computer.

2) Use some method of transferring the files from the myRIO to your computer either automatically (e.g. FTP, network folder (??), HTTP POST the files), or manually (FTP / WebDAV)


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 6
(10,858 Views)

Thank you, Sam_Sharp. Apologies for the delayed response due to my hardware failure and cannot test myRIO this past week.

 

Is there pros and cons for the two methods you mentioned? Would you give me some recommendation/links of NI whitepage as to how to inplement either methods? I don't have a computer background but I am willing to learn and want to solve this problem.

 

Many thanks!

 

 

0 Kudos
Message 3 of 6
(10,790 Views)

Here are a few pros/cons - there are obviously lots more - it's up to you to decide what you need and which to go for.

 

Streaming Data:

+ Data is immediately available and visible on the host PC so you can view/analyse it live

- If you lose connection, the PC crashes or you shutdown your application, you will start to lose data

 

Saving to files:

+ If the transfer fails, you still have the files to manually transfer them later

+ Using WebDAV / FTP to access your myRIO doesn't require any extra coding

- It will use up disk space on your myRIO so you might run out (unless you save to a  large USB stick!)

- If you use a web server to POST the files, you need a web server, and a script to handle the incoming files

 

There are lots of whitepapers/tutorials about network streams - google them. Saving files on the myRIO is as simple as specifying a path local to the myRIO (see here: http://www.ni.com/tutorial/14669/en/) and then transferring the files by whatever means you have.

 


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 4 of 6
(10,745 Views)
Solution
Accepted by topic author bazingagirlsun

Hi

 

I am a fan of the later method especially if you want to guarantee that no data is being lost.

Why don't you use an USB storage device that you attach to myRIO and later transfer the files with WebDAV (which is faster than FTP based on my experience).

0 Kudos
Message 5 of 6
(10,716 Views)

Hello,

I try using WebDAV / FTP code for myRio but it not work. Can you for me an example

0 Kudos
Message 6 of 6
(7,233 Views)