LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA read to file

Hi Guys,

 

A simple question here.

 

I am reading data from a serial port. I would like to store the data log into an Excel file. I tried using VISA read to file but it is not working.

 

Do you have any idea to store the data to a file ? The data comes in a comma deliminated format.

 

Thank you very much !Smiley Embarassed

0 Kudos
Message 1 of 6
(4,161 Views)

@pokerprof wrote:
but it is not working.

In what way is it not working?

0 Kudos
Message 2 of 6
(4,151 Views)

Hi there,

 

This is what I did:

 

1. Create an Excel file

2. Insert the Excel filename (the path) to the VISA read to file

3. Run (no problem)

4. Tried to open the Excel file but got error msg "Excel cannot open the file because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the file format.

 

Please help. Thank you, Amigo !

0 Kudos
Message 3 of 6
(4,146 Views)

What filename did you create.

 

Make sure you use .csv or .txt.  Don't use .xls or .xlsx.  Since you are not creating a true Excel file, but a text file that Excel is capable of importing when you open it with Excel.

0 Kudos
Message 4 of 6
(4,144 Views)

Hi Pokerprof,

 

I think you should use only one read function to read data from COM Port. When you read data first time the block will flush the buffer and hence second "Read to File.vi" call will not any data to read. So If you want to store last read data to file then use "Read to File.vi" only once

 

Kudos are most welcome.

Vinal Gandhi, CLA
0 Kudos
Message 5 of 6
(4,122 Views)

@Vinal_G wrote:

Hi Pokerprof,

 

I think you should use only one read function to read data from COM Port. When you read data first time the block will flush the buffer and hence second "Read to File.vi" call will not any data to read. So If you want to store last read data to file then use "Read to File.vi" only once

 

Kudos are most welcome.


Actually, since it looks like the data is needed for other things, you should just use Write To Text File to save data to your file directly.  Be sure to open the file before you enter this loop and close it afterwards.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 6
(4,115 Views)