LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Inputs read from daq are overwritten

Solved!
Go to solution

Hey there

 

I have a Daq input reading into a spreadsheet file

 

The daq tells me that one is supposed to have a while loop around it, and I can't get it to run without one, so okay

 

But my main problem is that this means that it overwrites my written file each time the while loop repeats

 

It also asks me to choose the file to write in multiple times

 

How would I go about fixing this?

 

Thank you

0 Kudos
Message 1 of 6
(2,575 Views)

You have left the path input unwired and you are writing to the file inside the while loop. Don't do this way.

 

If you are acquiring data in a while loop just gather the data in that loop and use a queue, push the data into it. Create a seperate loop with a low level text file functions, open the file before the loop begins, read the queue and write the data to the text file by converting the data to text. Finaly close the file outside the loop once the data acquisition is complete.

 

If you have any question in any of the above please search in the LabVIEW example, if you are not able to find come back. 🙂

-----

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

It seems to me that you are using the DAQmx Assistant to configure your acquisition.

Why don't you "Enable TDMS Logging" in this Assistant? By default, it appends new data to the file.

 

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 3 of 6
(2,548 Views)

The file path works perfectly, thank you

 

The second part I don't get, (Still very new to labview). It makes sense that the write is outside the while loop, but I don't get how one is supposed to append the write file with a continuously flowing set of data points. Is there a dynamic data to text/string command?

 

Sorry for my lack of knowledge on the subject

0 Kudos
Message 4 of 6
(2,523 Views)
Solution
Accepted by topic author TWCRN

Yes you can convert numeric to string, check the attached VI. I would recommend you to go through basic LabVIEW materials and also play with NI example which comes with LabVIEW. Remember do not use the attached example along with data acquisition, always use seperate loops.

-----

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

You're a life saver, thank you

 

I'll definitely look at the examples/tutorials, but it's nice that there's such a supportive community behind the software

0 Kudos
Message 6 of 6
(2,495 Views)