09-01-2011 09:02 AM
Hi!
I wrote this project to acquire data (using DAQ USB NI-6008) and to save them in a .tdm file.
It works perfectly but because I need to run that application on a pc without labview, I built the .exe file (and everything went fine!).
Can someone explain me because the stand -alone application writes a .tdm file without data?
It's not empty, but it contains no one of the time - preassure data I need.
Thanks a lot for your attention!
Marco Montorsi
09-01-2011 10:26 AM
Basics - did you install DAQmx and the hardware config file onto the pc?
09-01-2011 11:06 AM
I'm trying to make the exe working on the pc where labview and DAQ's driver are installed (before using it on the other pc).
Of course, when I run the exe, labview is closed...and I have the problems I described.
I really can't undesrtand why?
09-01-2011 11:10 AM
Wire up an error indicator and place it on the front panel. Need to see if an error is being generated.
09-01-2011 03:12 PM
Sorry to answer you only now, but I'm a beginner of Labview and implementing your advise took me a lot of time.
I attach the new vi file.
I added what you said and I ran the vi project: no errors, everithing works fine.
So I built the exe and I tried it: after asking me to decide the filename for the report, the second time the program has to write data in the file an error task appairs.
It says that file can't be found...?!?
Thanks a lot!
You allowed me to find a bug...but I really don't understand why it happens and, manily, how to solve this problem?
I hope in a new your great idea!
09-01-2011 03:27 PM
I have never used Express VI's... However, I am willing to bet that the file path is the culprit.
I know I should not suggest this, but can you wire a path constant and fill it with a known / existing location where you want the file to be written to? Run the code and then try the same code as an executable. Change the name slightly and see if the files go to the same location.
You may also want to place some indicators on your front panel to see what path is being sent to the Express VI.
09-01-2011 05:10 PM
I added and wired a constant pathfile to the filename's input of write express VI, I added and wired an indicator from filename output of that function to a path indicator for the user.
Everything still works fine in the .vi project but the .exe has the same problem: error 7, file can't be found.
It's so incomprehensible ...
I can try a different way...but I need your help!!
I used write express VI because I'm a begginer and that is the fastest way to write a file with a time column data and a column with my measured data.
How can I do that using "write to spreadsheet"? In particular how to create time column data? (write need an array of double, not a string?)
Thanks again for your support!
09-02-2011 01:20 PM
It's quite simple.
You can build a 2D array and wire that directly to the Write to Spreadsheet file.
When you initialize your 2D array, you can also write the headers to the first row (0) of the 2D array.
If you need to deal with numerics & strings, you can use format into string, so that all the data is of the same type.
Otherwise, if all your data is numeric, you can wire it directly to the write to spreadsheet file.
If I get a chance, I will post an example.