LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read files in Target


@Benru wrote:

In the image I attached the .vi that I made on my personal computer. I must take this same .vi to another computer where host-target is configured, I have the int.txt in the target, the .vi in ​​the host but I have not told the .vi how to go look for that int.txt


Ah, now we are getting somewhere.  You want to know how to configure a Host (PC) machine to be able to do File I/O with a connected Target (myRIO).  Before I suggest how you might do this, I want to handle the general question of "How to get data collected on the myRIO to the Host PC".

 

I had been assuming you had the following scenario:

  • LabVIEW RT routine where Target was running a Real-Time Data Acquisition and Control routine, generating "real-time" data that needed to be transmitted to the Host for display and streaming to disk.
  • Host contained User Interface that managed "parameters" of RT code, including Sampling Rates and the "Start/Stop" commands to the Target.
  • Communication between Host and Target was via TCP/IP (for example, Network Stream channels, Host-to-Target for "Commands", Target-to-Host for "Responses" and "Data".

But another way to communicate between Host and Target is what I think you are now suggesting:

  • Target creates and maintains "Data" (meaning the result of doing whatever it is supposed to do, for example, sampling and logging results to a (small) file on the (limited) file system that is part of the Real-Time Linux OS on the myRIO.
  • Target also has "Parameter" file that contains relatively-static settings, perhaps such things as the sampling rates and number of channels in the data file.
  • Host wants to get the contents of these files, and maybe upload a new set of "Parameters" to the Target.
  • NI provides something called "WebDAV" that can do this.  You can go on the Web and search "WebDAV", where you will find notes from NI and others describing how to use WebDAV to do exactly what you describe -- take the VI that you made on your personal computer, transfer it to the PC that is the Host connected to the myRIO Target, and use WebDAV to transfer this file into the File System on the myRIO where you can use LabVIEW File I/O commands to (on the Target) read the contents of the file and use those contents as you see fit.

I've played a little bit with WebDAV, just to see how (and if) it works (the good news -- it does work, but it is a little confusing dealing with the differences between the Windows file system on the Host and the Linux file system on the Target).  However, for what I want to do (the first scenario I outlined above), I prefer Network Streams.

 

So go explore WebDAV, see if you can write a utility that will open the communications channel and copy a Linux file from the myRIO to the PC, preferably a text file that you can open (you'll need to learn how to navigate the Linux directory structure and see where/how files are stored).  If you get stuck, come back, post your VIs, and we'll try to help.  I'd suggest making a small LabVIEW Project ("Explore WebDAV") to do this, and attaching the entire Project Folder (in Compressed, zipped, form) when you do this so we can "see everything" and maybe even try to run it ourselves.

 

Bob Schor

0 Kudos
Message 11 of 13
(170 Views)

Where can I find a project that allows me to understand how file transfer works using WebDAV?

In the Labview examples no example appears

0 Kudos
Message 12 of 13
(142 Views)

NI has a nice Knowledge Base article here.  

 

Bob Schor

0 Kudos
Message 13 of 13
(130 Views)