LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

The vi project works, the exe file no. Why?

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

 

 

 

 

0 Kudos
Message 1 of 8
(3,337 Views)

Basics - did you install DAQmx and the hardware config file onto the pc?

0 Kudos
Message 2 of 8
(3,323 Views)

 

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?

 

 

0 Kudos
Message 3 of 8
(3,315 Views)

Wire up an error indicator and place it on the front panel. Need to see if an error is being generated.

0 Kudos
Message 4 of 8
(3,312 Views)

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!

 

0 Kudos
Message 5 of 8
(3,295 Views)

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.

0 Kudos
Message 6 of 8
(3,287 Views)

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!

 

0 Kudos
Message 7 of 8
(3,268 Views)

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.

0 Kudos
Message 8 of 8
(3,233 Views)