LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

to display an open text file in the front panel

i want to display a text file which is being constantly updated in my VI to a display on the front panel of my VI.
i figure i need a while loop to update the display once the last line in the display is different to the last line in the file but how do i keep track of lines in a string indicator?

thanks,

Staunton
0 Kudos
Message 1 of 3
(2,989 Views)
Here's one of many possible solutions:

Just query the file with "File/Directory info", then check if the "last mod" output is different from the previous iteration (obtained via shift register). If this is true, read the file again into the indicator.

If the file always grows, you could also check the size with a similar procedure.

Checking the file info is much cheaper that constantly reading the file, then analyzing it's content.
Message 2 of 3
(2,989 Views)
thanks for your fast response, the file is going to be updated every few hundred ms, your (neat) solution would only let the indicator be updated every second (if im right), is there anyway to speed it up just a little? could you check the size of the file and compare ti to previous size, or i s this too small a change (as the appending parts to the file are only reports of commands being given to an instrument)

thanks in advance,

Staunton
0 Kudos
Message 3 of 3
(2,989 Views)