Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   How to do file i/o in labview (http://www.chiefdelphi.com/forums/showthread.php?t=73887)

rsisk 08-02-2009 00:10

How to do file i/o in labview
 
OK, the team and I struggled with this one today.

We want to write out a log file to trace some values as they change. We open the file at the beginning of the program and close it at the end (same place motors are opened and closed). Inside of a loop, we write to a text file passing in a string of characters.

The file name is c:\trace.txt, the open, writes and close work with no errors. But I cannot find the file that should be created. I even ran Filemon on the laptop to see if I could see an I/O to a file.... no luck.

There's gotta be a way to write to a file in labview, any idea what I am missing?

Many thanks in advance.

Mike Betts 08-02-2009 08:25

Re: How to do file i/o in labview
 
LV experts, feel free to correct me if I am mistaken...

Your file is most likely on the cRIO and not on your laptop. You can use the ftp command on the command line or you can use a web browser and point it at url ftp://10.xx.yy.2 and browse for the file on the cRIO.

Regards,

Mike

rsisk 08-02-2009 09:50

Re: How to do file i/o in labview
 
Sweet, thanks Mike.

Your post inspired me to take a look at the NI site and found this gem:
http://decibel.ni.com/content/message/3137#3137

Says you can use MAX to FTP to the cRIO.

ChiefDelphi and Mike Betts ROCK!

RyanCahoon 08-02-2009 13:46

Re: How to do file i/o in labview
 
Quote:

Originally Posted by rsisk (Post 816366)
The file name is c:\trace.txt, the open, writes and close work with no errors. But I cannot find the file that should be created.

Also note that teams wishing to use a log file will have to change the filename to one compatible with the cRIO, namely a UNIX-style, /path/to/file type path.

Greg McKaskle 08-02-2009 14:26

Re: How to do file i/o in labview
 
LV has a built-in path type that abstracts /, \, and : for you. So wherever you look at it, it will look native, but at runtime it will be native there too.

I mention this because sometimes old habits are hard to break, and people then start to build their own path/string stuff. It is better to use the built-in path datatype and functions.

Use the same path as the ftp location.


All times are GMT -5. The time now is 10:35.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi