Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot write to file

Hello,

Perhaps this is the wrong forum, but I believe that this is specific to my myRIO/labview myRIO version.  

I have a vi that needs to save out its measurements so I tried the save measurement file wizard.  This did not work, it didn't create a file or write to an existing file, but gave no errors.  I then tried manually using the open file, write to file, and then close file blocks based on an example that is known to work.  Again it failed without any error messages.

Please help as saving to a file is absolutely necessary for this program to work for me.

0 Kudos
Message 1 of 7
(7,143 Views)

Please do help, this is the last thing holding my project up.

Attached is the VI that should be saving the file.

 

Thank you

 

0 Kudos
Message 2 of 7
(7,125 Views)

Hello Mike,

 

I believe the problem you’re running with is file paths for Linux RT. I’m guessing that you’re deploying and running this VI in the myRIO. The file path you specified is for Windows, not Linux RT, which is the operating system in the myRIO. Please take a look at this article that explains how to use file paths in different OSs and this example that implements it for myRIO. 

0 Kudos
Message 3 of 7
(7,122 Views)

Im actually learning this file save process myself and i agree with amezam...

you have to understand where you want to save the file... if you are running the program on your rio using real time then you should look into writing the path for you OS on your target...

i had the same confusion myself:

all the tutorials i was following trying to understand had c:\ and that made me default “oh i want it to save in my documents folder on my computer all I have to do is just copy and paste the path...” WRONG =P

 

we first need to establish where you want to save your file... on your RIO target device or your computer?

- if it is to your target device you want to save to that i feel will be easier just follow the links amezam posted above...

- if it is to your computer you want to save there is a little more of a process to do so

0 Kudos
Message 4 of 7
(7,102 Views)

Thanks, I'm sure that it what was wrong.  I want to save a file to the host computer and the RIO is connected over the usb cable.  How can I do this programatically instead of just saving to the RIO's filesystem and then fetching the file from its IP?

0 Kudos
Message 5 of 7
(7,093 Views)

So I now have the file saving on teh myRIO's local filesystem.  Sometimes it triggers the save function twice, how can I make this a one shot, but goes once every few minutes?  I will attach the updated VI.

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

just off the top of my head looking at you circuit, you are not controlling how fast you while loop is executing...

this might be causing the file to save twice, if i understand correctly the file will save at every iteration - if you hook up a indicator to the little i at the bottom left of your while loop you will be able to see how many time your loop has ran, does that make sense?

 

it is saving the file correctly in the directory you want it to on your RIO target device...

that’s good you got it to work, i think now you just need to control your loop execution rate

also the way you are saving the file might not be the best way to go about saving it, although it might be working , i learned that every time you have to open/create a file and close it can take up a lot of resources - you can fix this by moving the open/create & close outside of the while loop so then it is executed 1 time instead of being executed at every loop iteration

here is a link to one of my threads that talks about this:

save file process ( this link will bring you directly to the post and you can read on from there)

 

anyways its Friday and i have to clear my desk before the weekend so I’m not going to be able to go over how to save it to your computer, but if you start from page 1 on the thread i linked above there are lot of links i posted in there that should be able to answer some of your questions... either way that it is going to be a separate VI that will run on you computer that will talk to your target device and save the data that your RIO target device is streaming... but for sure check out that link there is a lot of good information there that relates to this issue... we both are working on different devices so our file save directory is going to be different, but the rules still apply 😃

 

 

 

0 Kudos
Message 7 of 7
(7,074 Views)