LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to read text file more than one time - Bug?

Solved!
Go to solution

I am opening the Refnum of a text file while starting my software and I am keeping the file open until the software runs. I am reading a text file when an event occurs. The problem I am facing here is when I read the file 1st time am reading am able to read the text from the file but when I read it again am getting only empty string. Could anyone help me to understand why this happens.

 

 File Read.png

-----

The best solution is the one you find it by yourself
0 Kudos
Message 1 of 3
(2,679 Views)
Solution
Accepted by topic author P@Anand

A race condition?  Why are you doing two reads in parallel?  Keeping the file open is not a problem, but remember there is a file pointer.  If you are reading empty strings, it's probably because you are a the end of the file.  Use Set File Position VI to set is for the start of the file.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
Message 2 of 3
(2,677 Views)

Not actually a race condition but the pointer you said does the matter. Issue got solved. Thanks

-----

The best solution is the one you find it by yourself
0 Kudos
Message 3 of 3
(2,671 Views)