|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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. |
|
#2
|
||||
|
||||
|
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 |
|
#3
|
||||
|
||||
|
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! |
|
#4
|
||||
|
||||
|
Re: How to do file i/o in labview
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.
|
|
#5
|
|||
|
|||
|
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. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to use the data obtain in one C file to another C file? | tommy_chai | Programming | 8 | 11-01-2008 02:17 |
| File Open Problems in LabVIEW | pyroslev | LabView and Data Acquisition | 3 | 20-01-2007 15:52 |
| Labview Demo File for 2006 Camera? | JABianchi | General Forum | 2 | 15-09-2006 18:23 |
| How to open a step file.... | Allison K | Inventor | 2 | 08-09-2006 17:47 |
| How do we convert a modified user routines file into a valid .HEX file | HuskieRobotics | Programming | 13 | 28-02-2004 12:12 |