01-23-2020 09:02 AM
I am collecting digital on/off boolean data from four cDAQ9181. Currently I am using write to text file, but I set the extension to csv because I would like to open them using Excel. I attach the vi.
It works ok but when I build an exe file and run it, the file dialog does not show me the file extension (which instead appears if I run the source code)
Ideally, I should write the data to an xlsx file directly. I was given different suggestions (tdms, write to measurement file…) but they don't seem to fit my case. What would you suggest me? Thanks
01-24-2020 04:10 AM
Hi Davide,
I opened your VI to try to reproduce your issue, but I wasn't able to do so because the ReadDigitalInput subVI is missing. Could you please send it in attachment, too?
Best regards,
Alessia
01-24-2020 04:17 AM
yes you are right! sorry about that, I attach it here . Thanks 🙂
01-24-2020 04:19 AM
I am pretty sure i did it.. let me try again,
01-24-2020 04:44 AM
Now I can run the VI, thanks; it creates a CSV file whose name is "today's date".csv. However, it's not clear to me how the behavior of the executable differs from that of the source code, sorry... Could you please send a couple of screenshots explaining what happens when you run the source code and when you launch the executable?
Regards,
Alessia
01-24-2020 04:56 AM
It actually happens on the production PC and right now I have no access to it.
Basically, it does not add the csv extension to the newly created file…
But still, the ideal solution would be to write the data to an Excel spreadsheet.
Thanks a lot!
01-24-2020 05:40 AM
Hi Davide,
@DavideB wrote:
But still, the ideal solution would be to write the data to an Excel spreadsheet.
Then there are several options:
01-24-2020 11:37 AM
I wonder if you are using the Express VI improperly (its documentation is a little confusing, and it might have some strange behaviors). You are supplying a default name (a string representing today's date), and specify a pattern-matching for existing files of ".csv" (which, as it turns out, will match no existing .csv files -- you would need to specify "*.csv" to match existing files).
You are also making the (very common for LabVIEW users) mistake of confusing text files that follow a row/column method (called "Comma-Separated Values", or "csv"), which Microsoft's Excel Spreadsheet program can open, as can any Text editor, with the proprietary Workbook Files that Excel uses, with the extension .xlsx. If you are only storing numeric data in regular rows and columns, I recommend using LabVIEW's Delimited Spreadsheet VIs that write .csv files (though the LabVIEW default method uses <tab> characters as column separators, though you can specify a <comma> to get a "true" .csv format. Excel doesn't care -- it usually figures out what separator you are using.
Bob Schor