LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

program stuck, and would not write into file

It seems  a wired problem.

In the program, I open a log file.  In one "while" loop, I read data, and write data into the file, pause for 30 seconds and goes to the beginning of the loop.

The program stuck after about 33 minutes of program running.  When I checked the log file, I found the log file was stuck a few iteration ago. The files have 109 and half lines of data. Acturally, if nothing wrong, when the progrm stuck, there should be 118 lines of data.

Have no any clue why this happen, and how to fix it. Please help!

 

0 Kudos
Message 1 of 3
(3,365 Views)

I have no idea on why it happens, but I would suggest you to close and reopen the file periodically (say every 10 minutes) and see if this solves the problem.

 

I had the impression reading your message that your programming environment is LabVIEW: if this is the case you should post this question in the appropriate forum: this board relates to LabWindows/CVI. In any case, with so few details on your application it's difficult to try helping you: as an example, supposing you write a line of data on every iteration I cannot match your supposed timing (2 times per second) with the amount of data expected (118 lines in 33 minutes means more than 3.5 lines per second).

Should the problem still appears please add some more details on the code so that we can suggest you some check / modification / improvement to test.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 3
(3,355 Views)

To get an idea what happens, you will probabaly have to add some code, which shows you the return value of the function, you are using to write the log file. At least if the return value indicates an error.

 

You also might consider to open the log file in every iteration of your loop and to close it again at the end of the loop when the data was written.   

 

 

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