LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I continuously update a .txt File?

A DOS-app updates continuously a .txt File on my system. While I read out this file with a loop in LV it seems that the updating process
from the .txt File is blocked until I stop the LV-app!
Is there a good way to read this .txt File out while it is updating in the background? Or do I need to change the read loop?


thanks in advance
Norick


I'm using: LV 7.1 / Win2k / SP2

- see the .vi File
0 Kudos
Message 1 of 4
(3,129 Views)
Dear Norick,

you have to close the file after the read. Otherwise your loop will eat up all available handles in the OS and util LV is running creting memory leaks. This will also allow your DOS-app to continue writting the file while the while loop is waiting.
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
Message 2 of 4
(3,125 Views)
well I allready tried it but it doesn't make any diferences. Probably the problem is linked to the 'System Exec.vi'. It seems this vi can't update the file correctly. If you take a look to my vi, I send a cmd-string to the 'System Exec.vi' which should write the actual status direct in a file which I read out.
When I send the whole cmd-string inside a separate dos-box I can see the actual status of my dos-app which works fine so far. But I still have some troubles to get this status in the LV!


Thanks
0 Kudos
Message 3 of 4
(3,118 Views)
Sorry I was too loosy looking at your code.

You are calling a batch file through cmd and redirecting stdout to a file named "C:\TEMP\Release\Statuslog.txt". The SystemExec.vi will redirect stdout to itself to be able to give back the contents in the "standard output" indicator. But this shouldn't happen since you let it run in the background.

With my knowledge I do not see any solution other than changing your dos-app to have the file written directly.
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 4 of 4
(3,093 Views)