LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read files in Target

Hello. I have a host-target, on the host I am creating a *.vi to run on the target. In the target I have put an int.txt to extract its content and generate a signal. I don't know how the path should be in the "Read Delimited Spreadsheet VI" image so that it looks for the file on the target, not on the host, how do I correct it? Thank you.

0 Kudos
Message 1 of 13
(443 Views)

You cannot run a VI on a host to access a file on another machine. Either you run the VI on that target, or you transfer the file from that target. You can Execute VI Remotely by Using VI Server from a host PC.

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 2 of 13
(413 Views)

To precicise a bit: When you talk about a “target” what exactly is it? A Raspberry Pi, Arduino, LabVIEW realtime target such as a myRIO or cRIO or your own kitchen-sink ESP32 project?

How do you execute your VI on that target?

Where did you store that file on your target?

Rolf Kalbermatter
My Blog
0 Kudos
Message 3 of 13
(389 Views)

I can't access another machine (target) from a *.vi created on the host, I don't know how to put the path (that goes to the target) from the .vi in ​​the attached image

0 Kudos
Message 4 of 13
(369 Views)

@Benru wrote:

I can't access another machine (target) from a *.vi created on the host, I don't know how to put the path (that goes to the target) from the .vi in ​​the attached image


As ZYong already explained: Another computer is not magically accessible on your computer by a path. If that was possible, you would have a very serious security risk. The harddisk (or flash memory) of another computer (target) is the properly of that target and only accessible for an application on that target.

If you want to access a certain location on another computer, you first have to share it on that computer, for instance by configuring a network share, and then connect to it from your other computer. In order for that to work you need to have the credentials of that share (this is typically a user account on that machine or a domain that machine is part of) that has at least read access to that location.

Rolf Kalbermatter
My Blog
Message 5 of 13
(364 Views)

I've already set up a network share, and I connected from their other computer.

0 Kudos
Message 6 of 13
(360 Views)

In general, in a Real-Time system, the Host (PC) handles all the file I/O (largely as this is not a "deterministic" process, as paper tapes and spinning disks (what's an SSD?) take unpredictable amounts of time), while transmitting data via TCP/IP from the RT Target to the PC Host is both fast and much more time-predictable.  For this reason, most "real" I/O (i.e. saving information in "files") takes place on the PC -- the RT side uses TCP/IP to send the data to the PC, which packages this up and writes them to a file system.  Note that that last step, "organizing" the data into a Data Base, a TDMS file, an Excel WorkBook, etc., requires "extra" time and might benefit from multi-threaded processing, Producer/Consumer organization, etc. common in modern Operating Systems, not so much in Real-Time OSes.

 

Note -- in principle, one could do I/O on a Linux-based RTOS, but for the reasons I noted above, it goes against the determinism that are the main aim of the Real-Time label, and should probably be avoided by punting the data up to the Host, which has the threads, hardware, and fast memory to better accomplish saving the data.

 

Bob Schor

0 Kudos
Message 7 of 13
(313 Views)

@Benru wrote:

I've already set up a network share, and I connected from their other computer.


You need to give more information. From what I read it should simply work but it obviously doesn't, so you are not telling the whole story.

Rolf Kalbermatter
My Blog
0 Kudos
Message 8 of 13
(292 Views)

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

0 Kudos
Message 9 of 13
(282 Views)

Let's use A for the PC where you would like to run and view the data while using B for the PC on which the data resides.

  1. Go to PC-B and share the directory that contains the data file (int.txt)
  2. Go to PC-A and open Windows Explorer
    • Right-mouse click to Add Network location
    • Enter the information or search regarding the shared location on PC-B
    • A new network location option should now be present on PC-A
  3. Create your vi on PC-A to open file (int.txt) on this new network location
  4. View data remotely (PC-B) from local vi (PC-A)
Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
0 Kudos
Message 10 of 13
(272 Views)