From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

making the data file visible as the vi runs and writes to it

This is a rather simple question but I want to make sure I that I know how to do it and do it right. I am writing to a text file and would like to make it visible as the vi runs and updates it. Thanks.
0 Kudos
Message 1 of 4
(2,323 Views)
A little complex answer for the simple inquiry....

The most simple way is using probe function, by which you can see
real time data in any data types on any wires lined in the diagram.
Please try to click right on the necessary wire and you will be
able to find out it.

Otherwise, you might make array data for the purpose and have it
visible during a certain time period when you want to look up
the data just written on the text file.

Tom

Reik2001 wrote:

> This is a rather simple question but I want to make sure I that I know
> how to do it and do it right. I am writing to a text file and would
> like to make it visible as the vi runs and updates it. Thanks.
0 Kudos
Message 2 of 4
(2,323 Views)
A little complex answer for the simple inquiry....

The most simple way is using probe function, by which you can see
real time data in any data types on any wires lined in the diagram.
Please try to click right on the necessary wire and you will be
able to find out it.

Otherwise, you might make array data for the purpose and have it
visible during a certain time period when you want to look up
the data just written on the text file.

Tom

Reik2001 wrote:

> This is a rather simple question but I want to make sure I that I know
> how to do it and do it right. I am writing to a text file and would
> like to make it visible as the vi runs and updates it. Thanks.
0 Kudos
Message 3 of 4
(2,323 Views)
If you are using this for the purpose of de-bugging your program, I like the idea Tomoya wrote about using a probe to see what is going to the text file. It's very simple.

If you are trying to do this at runtime, I would handle it this way : In a loop seperate from the one that does the writing, use a file properties vi to get file size and compare it to the last file size query (use a shift register for this). If the file size has changed, re-read and display the contents of the file to a front panel text box. Otherwise do nothing.

For a more programatically correct method, use a semaphore or queue to tell the update loop that its time to re-read. The writing loop would (after write) set the queue element (or semaphore). The reading loop would wait on this trigg
er to know when to read.

Jared
0 Kudos
Message 4 of 4
(2,323 Views)