LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading a Row from a Sheet Every Second

I am trying to read the next value in a .txt file every second. Right now, I can put the whole thing in a while loop, but I believe it reopens the .txt file everytime. If I put just the count in a while loop, it only updates the vlue when the loop terminates.

 

The file testnumbes.txt is just a list of numbers. Eventually I want to program the setpoint for a pressure regulator based on a routine I specify in the .txt file.

 

Thanks and happy holiday!

 

 

0 Kudos
Message 1 of 5
(2,838 Views)
It's silly to read the file more than once. Read the entire file and then just wire it to a for loop to index the array, line by line.
0 Kudos
Message 2 of 5
(2,826 Views)

Ok so I figured it out so the below works. My issue though was that I couldn't just send the indicator value from a loop. The whole thing needed to be in a loop. I'm not really sure why, but this works.

 

 

0 Kudos
Message 3 of 5
(2,792 Views)

While I have figured it out on the input side, I can't figure out how to output to a file. While below works, it is opening the file every time.

Download All
0 Kudos
Message 4 of 5
(2,784 Views)
Why didn't you use a FOR loop like I suggested? Make use of its auto-indexing feature.

Please take some time and take one or more of the free LabVIEW tutorials.
0 Kudos
Message 5 of 5
(2,778 Views)