11-12-2013 09:10 PM - edited 11-12-2013 09:10 PM
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 !
11-12-2013 09:32 PM - edited 11-12-2013 09:32 PM
11-12-2013 09:38 PM
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 !
11-12-2013 09:44 PM
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.
11-13-2013 06:11 AM
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.
11-13-2013 07:21 AM
@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.