LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

to save acquired data in a spreadsheet file in labview

Highlighted

Hi to all,

 I have created a vi that i could save the string data in a spreadsheet file. However i want know how can i merge this same csv file to be used to save acquiring data, i have attached a vi to this.

and also the acquiring data is displayed in a another vi how can i merge the two vi's and then i save the both the data in a same .csv file? for example if i was using a daqmx to acquire a voltage signal from ni daq 6008 and the acquiring data will be saved in a csv file and merged into csv file with string data output

Thanks in advance,

Regards,

Dinesh

0 Kudos
Message 1 of 11
(1,352 Views)

1. I highly recommend you learn to use an Event Structure.

2. You have a race condition in there where you will be using an old path value.  Use wires instead of local variables whenever possible.

3. I also recommend you learn to use the Format Into String function.  It can accept many inputs and makes creating your strings a lot easier.

 

So it looks like this VI is writing the header data and then you will have DAQ data coming in later.  So for that, I recommend looking into the Producer/Consumer design pattern.  The idea is your DAQ loop can run independently of the logging loop.  The data is passed from the DAQ loop to the logging loop via a Queue.  So what I am picturing is you use the low level File IO functions to open the file, write the header data, then enter the logging loop.  In the loop, read the data from the queue, use Array To Spreadsheet String to convert the data into a string format, and write to the file.  When the loop is complete, close the file.


There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
0 Kudos
Message 2 of 11
(1,326 Views)

it seems quite enough idea to get the things but i need you say once again to go through this, can you explain me in step by step?

0 Kudos
Message 3 of 11
(1,317 Views)

Hi cross rulz,

             I've created a vi to display a voltage values and it was created in a way to display the values after prompt user window is opened so that they could enter the user details and the acquired data is saved using TDMS file, but after stopping it was not displaying the acquired values in a TDMS file viewer and also when i was trying to open the MS excel also not displaying the acquired data, i just want to know how to clear this bug?, share some ideas with me.

 Thank you,

Regards,

Dinesh 

0 Kudos
Message 4 of 11
(1,187 Views)

sorry dinesh, but so many things are wrong, i wanted to list them, but i stopped,

because any listing would be invalidated by proper design

 

you should really start working through the tutorials.


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 5 of 11
(1,177 Views)

Since you are logging to a TDMS file, I highly recommend you just use the DAQmx Configure Logging to let DAQmx log the data for you.  It will be a lot simpler.

 

If you don't want to do it that way for one reason or another, you really should be using a Producer/Consumer to log your data as you acquire it.  This would eliminate the need for ever growing arrays.

 

And you also need a way to stop your VIs without generating an error.


There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
0 Kudos
Message 6 of 11
(1,166 Views)

And why i cannot acquire the data in a next task in state machine architecture bcoz i acquired data in a acquire data task and in the write to TDMS file task the acquired data is not displaying, can you explain me what i did wrong here?

0 Kudos
Message 7 of 11
(1,153 Views)

Hi dinesh,

 

And why i cannot acquire the data in a next task in state machine architecture bcoz i acquired data in a acquire data task and in the write to TDMS file task the acquired data is not displaying,

Are you talking about DAQmx tasks - or do you talk about states of your state machine?

 

can you explain me what i did wrong here?

Well, your "data" in the cluster is set to integer while you want to handle float data.

What's the point of formatting integer data to 6 decimal digits?

Why do you write measurement data formatted as strings to your TDMS file?

 

You don't clean up your VI but yet expect us to analyze this VI?

Why don't you wire your cluster to the subVI ("Promp user")? Would be much easier then wiring seven (7) individual wires into and another 7 out of the subVI…

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 8 of 11
(1,145 Views)

@dinesh

this should do almost the same .. except for the strange stuff you do in the ACQUIRE case.

cleanup.png


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 9 of 11
(1,131 Views)

can i have a 2013 version of that? and i need to know, why i can't get the acquired data in a write TDMS task in state machine?, so that i can learn tht not to do in future.

0 Kudos
Message 10 of 11
(1,118 Views)