LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"Write to measurement file" express VI (TDMS foormat) keeps file opened

Solved!
Go to solution

Hello!

 

I am trying to use "Write to measurement file" express VI to write TDMS data obtained from DAQmx in LV2011. Each run of the same write function creates new file.

It seems that last written file remains to be opened until program stops or next file written. It has 0 size and it is not possible to access it from other programs.

 

Is it possible to save file immediately and close it?

0 Kudos
Message 1 of 7
(3,623 Views)

I think you have answered your own question. You just need to close the reference to the file right after the data is written. If you post your code that isolates the issue, we can suggest some ways.

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 2 of 7
(3,614 Views)

There is no reference out for express VI... Only filename out. That is why it is not so clear at the moment hot to close reference.

0 Kudos
Message 3 of 7
(3,612 Views)
Solution
Accepted by topic author Baturin

Ok, zero file size was due to nothing actually written (demo mode, without hardware attached...). When I write some data, file size is not zero and doesn't change after.

But file timestamp is changing after next file in sequence is written. So I am using "file created" instead of "file modified" attribute and it is enough for me now.

0 Kudos
Message 4 of 7
(3,608 Views)

It seems that anyway something is wrong with my express VI...

Everything is OK when runningV from labview environment. But building exe leads to the errors in this express VI. Additionally, I am unable to debug exe - debugging fails with fatal error after downloading all Vis... One problem was with non latin charcter set used in the path. Now there is another problem, which I have not defined still.

0 Kudos
Message 5 of 7
(3,579 Views)

Hello Baturin,

 

Thank you for bringing this issue to the forums. How exactly are you creating your executable? Are you following a specific tutorial?

Here is a tutorial on how to create an exe. I have reproduced your issue on my side and I do not get an error.

 

Please make sure you are following these guidelines:

 

http://zone.ni.com/devzone/cda/tut/p/id/3303#toc1      

 

You will be interested in the section, "Stand-Alone Applications."

 

Also, are you running this executable on a computer with LabVIEW already installed on it? If not, you have to  install the correct Run Time Engines and Drivers. This is also described in the previous link under "Installers (Windows)."

 

Thank you,

Vimal Fernandez

Applications Engineer
National Instruments
0 Kudos
Message 6 of 7
(3,562 Views)

It seems, that wiring "DAQmx task" (for AI task) to "Write to measurement file" express VI does not works in my case (only in exe).

The error is the same as file not found (error code 7), but file is created. Something gets wrong inside express VI. I am unable to debug exe, so I have just disconnected DAQmx task from express VI (really don't specially need it anyway).

 

For sure, the same LabVIEW version and drivers are installed on target and VI is working in it as well as at dev machine.

Debug error which I had encounter is already published in the forums elsewhere. It seems that the problem is in VI without block diagram inside hierarchy. Maybe with Express VI.

PS test app writing tdms files the same way is working like a charm (without DAQmx task wired).

 

So, thank you for yor advices, the problem seems to be solved. Maybe I will have a look in more details about the reason of such error, but can't do it now.

 

0 Kudos
Message 7 of 7
(3,557 Views)