LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

can i prevend the generation of files in temp directory

I noticed, that a labview (7.0) application generates different files in the temp directory when executed and deleting them when stoped.
(Except of the *cur.txt and *log.txt files which only exists once per application)
Is there a way to prevend LabView to write this files (lvtl*.rsc; lvtr*.rsc; *.tmp)
I've got an application, which i have to kill (there's no other way at this moment).
If i do so, the files still exist. I kill this application about once a minute.
Because i don't end the application the regular way, the mentioned files still exist.
As a result the temp directory runs full.

Suggestions are appreciated.

Best regards,

Rainer

P.S.: The Suggestion to regular stop the application does not help me of course 😉
0 Kudos
Message 1 of 7
(3,631 Views)
You could always use the DELete file function to remove files from the temp directory (as long as you are sure that you are the owner of the files and they are old enough to not be the file currently in use). LabVIEW also contains vi's that tell you the names of the files in a directory. Just take the list, apply it to a loop, and delete unneeded files as part of the opening code of your program.

Les.Hammer@CompleteTest.com
0 Kudos
Message 2 of 7
(3,595 Views)
Les,

thank you for your suggestion.
This might be a good "work around".
But how can i be sure, that: "you are the owner of the files and they are old enough to not be the file currently in use"?
I can delete all lvtl*.rsc and lvtr*.rsc files, but what about the *.tmp files?
Do the (labview application) *. tmp files always are lvs*.tmp and nix*.tmp style?
How can i be sure no other application generates a lvs*.tmp or nix*.tmp file that it needs?
A lot of new questions 🙂
The primary question is still: can i prevend this file generation?

Thnaks, best regards,

Rainer
0 Kudos
Message 3 of 7
(3,589 Views)
Rainer Balzerowski wrote:

> Les,<br><br>thank you for your suggestion.<br>This might be a good "work around". <br>But how can i be sure, that: "you are the owner of the files and they are old enough to not be the file currently in use"?<br>I can delete all lvtl*.rsc and lvtr*.rsc files, but what about the *.tmp files?<br>Do the (labview application) *. tmp files always are lvs*.tmp and nix*.tmp style?<br>How can i be sure no other application generates a lvs*.tmp or nix*.tmp file that it needs?<br>A lot of new questions :)<br>The primary question is still: can i prevend this file generation?<br><br>Thnaks, best regards,<br><br>Rainer

Well, any files in use by LabVIEW will generate an error if you try to
delete them. Just ignore the errors coming from the Delete function and
you are fine.
Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 7
(3,575 Views)
Rainer,
Nice question!

There are different ways for doing this. Unfortunately no any "100% guaranteed" way (because its not documented by NI - which temporary files are created by LV app):

  • So, first suggestion with deletion of all temporary files seems to be safety, because normally Temp directory must be empty. In case if some files currently used by other applications, they locked and you cannot delete them.


  • Second way - change path to temp directory especially for your application. Just add tmpdir key into assotiated ini file:

    [app]
    tmpdir=C:\MyApp\Temp


    After that lvtl*.rsc; lvtr*.rsc will be created into this directory. You can safety delete these files after kill.
    (Note, that "*" is pid of your application)


  • Third way - looking for all handles, which currently opened by your application. You can do this with some utilities, for example with Handle.exe from SysInternals.
    For example for my simple application following output was generated (some not important lines are skipped):

    Handle v2.2
    ---
    App.exe pid: 656
    cc: File C:\Temp\App_7.0_Administrator_cur.txt
    144: File C:\Programme\National Instruments\Shared\LabVIEW Run-Time\7.0\lvapp.rsc
    148: File C:\MyApp\App.exe
    1f0: File C:\Temp\nix2E5.tmp
    210: File C:\MyApp\Temp\lvtr656.rsc
    214: File C:\MyApp\Temp\lvtl656.rsc
    760: File C:\MyApp


    Now you can parse output and looking for all currently opened temporary files, then kill your your application and then safety delete tmp and rsc files. Note, that files lvtl*.rsc and lvtr*.rsc are located in "local" temporary directory as described in ini file, but nix*.tmp still in "default" directory.



Hope it help a little bit...

Andre.
Message 5 of 7
(3,563 Views)
Hi,
I have more serious problem with LV real time engine. It is creating these temporary files toooo fast and i am loosing hard drives.
The files exist for a short instant in the c:\documents and settings\administrator\local settings\tmp
The base of the name is lvs***.tmp
Any suggestion how to prevent the generation of theese files?
I have third party LabView application using LV 6.1
My NIDAQ is 6.9.3

Orlin
0 Kudos
Message 6 of 7
(3,472 Views)
Orlin,

as Andre mentioned you can change the path to the temp directory where these files are generated.
What about creating a ramdisk and point the temp directory to this ramdisk?
Then there's no impact to your hard disk anymore.

Rainer
0 Kudos
Message 7 of 7
(3,423 Views)