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: 

How to save the data from 1D array to file(.txt or .xlsx)

Hi everyone!

 

I'm a LabVIEW novice so I often get into trouble with some problems. I'm now developing a system to read and write data simultaneously. My current issue is that I want to save the data acquired from the DAQmx read to files in .txt or .xlsx. Either is fine. However I can't figure out how to organize the VI and set essential parameters. Any feedback would be great. Thanks!

 

Attached is the overall pic and the code.

 

A12A34C034B6FC353E6A62FDB7ECC652.png

0 Kudos
Message 1 of 6
(3,730 Views)

Functions -> File I/O -> Write Delimited Spreadsheet is a little more straightforward than what you're doing. Sometimes you need to set Transpose? to True if the output is going the wrong way (if rows/columns are flipped).

 

Edit: I just realized you're calling that function repeatedly, so set Append to File to True.

0 Kudos
Message 2 of 6
(3,720 Views)

Thanks. But, well I wonder if I use it in a correct way? I can't get the data into the file.

1A9D6828645A302E94E003AE9C7CCFD7.png

0 Kudos
Message 3 of 6
(3,674 Views)

We cannot debug pictures. Post actual code, and be descriptive- "I can't get the data into the file" doesn't tell us anything about what's happening. Is there an error? Is the data in the file, but ordered wrong? Does no file ever get created? We need more info, then we can help.

 

I'd suggest making a very simple example program that JUST writes data to a file- use an array constant, and make the simple program work first. There should be some examples on this VI's use as well- click Help, then Find Examples. You should be able to find something that'll walk you through a simple demo, which you can then modify into your program.

0 Kudos
Message 4 of 6
(3,659 Views)

I'm sorry I forgot to add the code. Here it is. 

 

 

0 Kudos
Message 5 of 6
(3,655 Views)

Well, my answer to Anh_Tran that I accidentally posted here (it may get moved to the right place) has the answer to your question, as well.  But here is a simpler, more direct, response:Correct Use of TransposeCorrect Use of Transpose

Bob Schor

0 Kudos
Message 6 of 6
(3,605 Views)