LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best way to save data from GPIB Device in a file?

HI!
I have a Keithley SourceMeter and want to save readings in a File along with settings on the front panel and timestamps plus several other infos. What is the best way to do this? Which file type? Any recommendations or hints could help me?
Thanks
0 Kudos
Message 1 of 4
(3,071 Views)
Hello,

if you don't need to have an ASCII file here's a little solution for you. Write an array of clusters in a data file.
before executing the VI select a file where you want to write the data (*.dat). Select a file that exists in order to overwrite it or write a new file.

Hope this helps !
Julien
0 Kudos
Message 2 of 4
(3,071 Views)
Thanks. but actually I think I need to have an ASCII file. Maybe I could use the spreadsheet file type in order to get the data analysed with excel?
0 Kudos
Message 3 of 4
(3,071 Views)
Hi Andy,

There are 3 main file formats that you can consider writing your data out to in LabVIEW:
  • ASCII

  • Binary

  • Datalog


ASCII
ASCII files are useful because every operating system and almost every application can read/write ASCII format files. Use ASCII files when:
  • Other users or applications will need to access the data file.

  • You will not need to perform random access file I/O

  • File I/O speed is not crucial

  • Disk space is not crucial


Examples within LabVIEW Example Finder: Fundamentals >> File Input and Output >> Write to Text File.vi and Read from Text File.vi

Binary
Binary byte stream files are more specific to data storage and retrieval. Use b
inary files when:
  • File I/O will remain in LabVIEW only -- no other applications will be needing to write/read that file. There is no standard formatting for binary files and thus other applications or operating systems may be unable to read the file.

  • Files are smaller than ASCII files

  • Easier and faster random access to data


Examples within LabVIEW Example Finder: Fundamentals >> File Input and Output >> Write Binary File.vi and Read Binary File.vi

Datalog
When to use datalog:
  • If you need to record data with a mixture of types, it can be cumbersome to convert everything to ASCII or to keep track of the binary formatting.

  • Datalog format is binary and internal to LabVIEW, so again only use this format if no other applications or operating systems will be needing to perform file I/O on the file.


Examples within LabVIEW Example Finder: Fundamentals >> File Input and Output >> Write Datalog File
Example.vi and Read Datalog File Example.vi

Good luck!

Kileen C.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(3,071 Views)