Showing results for 
Search instead for 
Did you mean: 

Read from the datafile while data acquisition

I have a program to process and record the data while experimenting. The data file is attached here with (please have a look). It is recorded injection by injection with injection number. Is it possible to read the data file while acquisition and display the injection number (only the injection number)? I mean, the counter should count the number of injection while experiment from the datafile.

0 Kudos
Message 1 of 4

If you are writing to the file, it is really a bad idea to try to read from it at the same time.  Weird things can happen.


Instead, you should keep a counter in your code.  Shift Registers work extremely well for that.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 4

Well of course it its possible! You can do it and much more!

Have you started any program? If so, show us your VI and tell us what bothers you - we'll be more happy to help you;)

0 Kudos
Message 3 of 4

Hi aneps,


when your software is recording the data why can't it display your information directly? Why to go the redirection by reading the data file?


Yes, you could read the datafile and parse the injection number. But:

- the datafile may be set to exclusive access from the writing routine. Then you will have a hard time to read it while it is written to.

- You need to parse data from the end of the file. Either you need to read the whole file again and again or you need to remember the last read position…


Best regards,

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 4 of 4