LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Issues with saving data while in an FPGA project.

Solved!
Go to solution

I am having issues trying to save data that I am getting off of my CompactRIO. I can get the data off of it, plot and display that data, but I cannot get it to save to a file with any of the save VI's. Trying to troubleshoot this problem I made a VI outside of our project that performs the simple task of saving a provided array to a .csv file. Outside of the project, this works fine, but when I add this VI to the project is when I get the problems. If I don't provide a file path, outside the project it prompts me for the path, but in the project, this prompt is never displayed and I get an error saying the user canceled the operation. I found that this error is the same as the one you would get if you closed the prompt using the X rather than hitting the cancel button. If I provide it with a path in the VI, I get no errors, but nothing happens and nothing is saved. Another interesting thing happens when I move this file into the project. When I go to run it, I get a prompt asking to save Format Message String.vi because it has unsaved changes, and when I ask it to list the unsaved changes it says that the VI has been recompiled. When I take the VI out of the project and run it, it says it has recompiled again and needs to be saved again. It is really frustrating when such a simple task refuses to work so any help you could give is appreciated.

 

Will

0 Kudos
Message 1 of 8
(3,415 Views)

Hello,

 

Are you running your File IO VI on the Real-Time target or on the local computer.  If you are running it on the RT, then it makes sense that you would not see a pop-up for the file dialog because RT is meant to be a headless (non user interaction) system.  This means you should hardwire the location where you want to save the file to on the RT disk.  You should note that the layout of the RT disk may be different than you use on windows, but depends on which controller you are using.  

 

The reason that you are being asked to save the file each time you move your file in and out of the RT target is because LabVIEW is compiling the code for the correct target.  A RT VI is going to compile differently than a windows VI would.  You should make a separate VI that is intended specifically for File IO on your RT side. 

0 Kudos
Message 2 of 8
(3,401 Views)

 


@David_L wrote:
This means you should hardwire the location where you want to save the file to on the RT disk.  You should note that the layout of the RT disk may be different than you use on windows, but depends on which controller you are using. 

The way I am understanding this is that the path that I give the save function will not be "C:\Documents and Settings\user\Desktop\" for example, it would need to be something else based on the controller.  If this is correct, how would I find the path information to hardwire in to get the information saved onto my computer?

 

Will

 

0 Kudos
Message 3 of 8
(3,387 Views)
Solution
Accepted by topic author Iam2391212

It will never be able to save the file on your PC, only on the controller it self.

You can then use FTP to tranfer the files to your PC.

 

Or you could make a PC host VI that gets data from the controller and then stores the data on the PC.

To transfer data you can use TCP or shared variables.

0 Kudos
Message 4 of 8
(3,383 Views)

I'm sorry, but I have not been doing this very long so I might not have explained everything enough or completly understood your solutions, but I feel that right now I am using a host VI to try to save the array.  For the experament I am trying to get this save working for, we are gathering data with the cRIO, placing that data in a FIFO, then running a VI on the computer that reads data off the FIFO. We can then display/graph that data, so I feel like the data is stored on the computers memory now and should be easy to save to disk, but the save functions do not work.  If I am misunderstanding what is going on here, any explinations would be greatly apreciated.

 

Will

0 Kudos
Message 5 of 8
(3,377 Views)

I have gotten this to work.  The source of the problem was mainly my ignorance with exactly how the CompactRIO works.  I can now save and then go back and pull data off the controller with an FTP, as sugested by dkfire. Thank you for your help.

 

Will

0 Kudos
Message 6 of 8
(3,362 Views)

Then you should unmark your reply as the solution (go to your reply's option menu to the upper right, Unmark solution) and mark dkfire's reply as the solution.

0 Kudos
Message 7 of 8
(3,354 Views)

I'm glad that you got the program to work.

 

One thing that can help you is, to look at the bottom of the VI you are running. There you can see the target.

If the target is your compactRIO, then you can "RUN" and see the front panel, but all the code is running in the compactRIO and not on your PC.

 

Hope this helps.

0 Kudos
Message 8 of 8
(3,340 Views)