FieldPoint Family

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read a file in an RT target

When an application in a Host PC starts, I need it to read a file in the connected RT target (i.e. cFP-2110).  In this case the file is a small data log file.  Attached shows the result when I do this.  The top screen shows the files located in the target when viewed with Window Explorer.  The file I need to programmatically open is hw.bin. The middle screen shot shows the path used to an Open Datalog function.  (The subvi contains a string to path conversion.) The bottom screen shot shows the resulting error.  In the error message ,I don’t understand what the \  is after the ftp: is or where it comes from.   I’m using LV 8.5.1 with Win-XP. What am I doing wrong or is there a better way to automatically retrieve a file from an RT target? Dave J.

 

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

Hi!

   I don't know Datalog, but I suppose that Open datalog file does a straight "File Open" for first.

 

   There you can't use as path "ftp:// ....", you have to provide a valid pathFTP is an application, not a path! So, either you enable file server on cFP-2110 (I can't do it, I don't know how to do it! while it is said on cFP product page that you can have file server!), either you first get the file via ftp (also programatically, through system exec, for example), and then you read locally the file.

 

   Anyway, now I'd like to know how I can enable file server on my cFP!!!

 

graziano

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

Hi Graziano,

 

Thanks for the clarification that the FTP string is not a path.  However, it still remains unclear how to open file from a target from within the host pc application.  I found knowledge base articles on how to manually transfer files to and from the target, but not programmatically though a host vi.  I may not be approaching this correctly.  For example, perhaps the better way is to first transfer the data to shared variables and then monitor the shared variables in the host pc.

 

What I have are a number of RT targets.  Each target has it's own hw.bin file that sets up various operating parameters that are unique to each target.  I have a number of laptop computers that will run the host vi that is used to edit the hw.bin files.  When a laptop connectes to a target, I want to open the hw.bin file withing that target so it may be edited.

 

Please advise how to best approach this application while remembering that I'm a newbie to the FTP concept.

 

Thanks,

 

Dave J.

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

Hi!

   Maybe the Shared Variable is a good option, but on this I cannot say much, since I'm using LabView 7.1, which doesn't implement Network Shared variables!

 

   Anyway, if you want to consider the file stuff, you can use FTP. FTP is, strictly, a protocol, as said by its name (File transfer Protocol).  This name, however, is also used for an "FTP Client", which is an application that allow to transfer files within networked PCs.  Windows has its own FTP client, just open Explorer (<windows> + <e> ) and type ftp:\\127.0.0.1 or whatelse.  Or you can consider the command line tool, opening a console, ant typing the same (C:current_folder> ftp 127.0.0.1 ).

 

   If you want to use FTP, you'll have to embed someway a client to LabView, if it hasn't already one (check Internet toolkit...).  I don't know if there's a way to treat it as a system command, with "system exec" VI...

 

graziano

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

Hi Dave and Graziano,

 

There are a couple of ways to programmatically retrieve files from an RT target. You can use FTP programmatically or use the System Exec VI. Below are the links to KnowledgeBase articles that describe these methods and include examples.

 

http://digital.ni.com/public.nsf/allkb/3D985C3C08C12D0B862574BB005A7684?OpenDocument

http://zone.ni.com/devzone/cda/epd/p/id/4269

 

To transfer files manually (Graziano, I think you were asking about this), you can use Measurement and Automation Explorer, right-click the target under Remote Systems, and select Transfer. This will bring up an FTP window.

 

Hope this helps!

Product Support Engineer
National Instruments
0 Kudos
Message 5 of 7
(7,056 Views)

LaRisa_S wrote:

 

To transfer files manually (Graziano, I think you were asking about this), you can use Measurement and Automation Explorer, right-click the target under Remote Systems, and select Transfer. This will bring up an FTP window.

 


Hi!

   Actually, I have no problems in transferring files manually, there're plenty of ways... I prefer using windows FTP client, sometimes I use command line client, sometimes NI's one.  What I was asking was enabling file server on cFP.  In product page, I can see that cFP has web server and file server.  No problem with web server, it's well known, but I didn't find anything for enabling file server!

 

   To keep it simple, for file server capability I mean the possibility of directly navigate cFP file system from my PC, without using FTP, just like networked PCs on a LAN with SMB protocol.

 

   Thanks

 

graziano

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

Graziano,

 

I'm certain that anywhere on the product page that we talk about File Server, we're talking about using FTP to access the files on the cFP. That's the only protocol that the cFP products support directly, which is why I misunderstood your question. So, I think what you're looking for is a way to mount the cFP file directory onto your network drive. The only way I can think of to do this would be to use a third-party software that does this. I did a quick Google search for "mount FTP as drive" and it brought up more than few free software options.

Product Support Engineer
National Instruments
0 Kudos
Message 7 of 7
(7,017 Views)