LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Spreadsheet

Solved!
Go to solution

Hi,

 

       I am having a problem where I wish to collect a continuous stream of single 1-D array data but the spreadsheet file I am reading the data into is only getting six columns of one row data. I want a continuous stream of data from the time I run a VI till the time I stop it. Here is a word file that contains image of my VI and an image of data in the excel file.

 

Thanks

0 Kudos
Message 1 of 8
(3,618 Views)
Solution
Accepted by topic author Ognee

If I understand you correctly, you just want to log continuously as you acquire data?

 

Just move the Write Spreadsheet to File VI inside the while loop.  Also, set the input parameter for "Append to File?" to 'true' Boolean Constant.

 

Therefore, for your example in the word document, move everything inside the while loop and just set "Append to File?" to 'true'.

 

EDIT:

 

The reasoning behind this is:  Dataflow works such that the while loop data WILL NOT be passed out of the while loop until it has COMPLETELY finished executing.  The ONLY data you will be getting is the LAST iteration. 

 

Additionally, you DO NOT want the files to overwrite one another, so flag it to "append" (add onto the end of an existing file).

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If someone helped you out, please select their post as the solution and/or give them Kudos!
Message 2 of 8
(3,606 Views)

Dear MrHappyAsthma,

 

  Thank You very much for helping me out with this. Now the only problem that seems to persist is that the program runs for a few seconds and continually asks me to choose a file to enter the data into. I wish to enter all the appended data into the csv file but every time I choose the csv file, it tells me to choose again after 3-4 seconds. The csv file does append data but it asks me to choose a file after every append. Also is there to append the pressure readings in a single column instead of rows of data appending to form a gorwing column?

 

 

0 Kudos
Message 3 of 8
(3,566 Views)

If you notice from the Help document on the Write to Spreadsheet File VI, you can see that you should wire a file path if you do not wish to see a Dialog Box Pop-up:

 

 

Right click on the blue-ish line that says "file path (dialog if empty)" and click "Create Constant".  It will make a blue text box that looks similar to a string.  This is a File Path data type recognized by LabVIEW.  Type in the file path -- something like c:\desktop\myfile.csv

 

Then it will not prompt you every iteration but rather will find the same file by following the path that you specified.

 

Also, if you wish to save to a single column instead of a bunch of rows forming a growing column, you are likely going to need to do a bit more work.  The purple line coming from your  DAQ Assistant Express VI is likely some form of cluster.  I forget whether or not you can use existing functions to manipulate this or if you need to Bundle/Unbundle it because it is a cluster. 

 

I do not have LabVIEW installed on the current PC, but once I am home from work I can take a look at that data type and see what options you have.  I will either edit this post if you haven't responded, or just respond to you next message with this data included as well.  If you have any other questions or issues, just make a reply with them and I will address those as well.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If someone helped you out, please select their post as the solution and/or give them Kudos!
Message 4 of 8
(3,560 Views)

Thank You very much for the suggestions. I have tried to foolow them but I have come across aa situation where the data forms a 2-d array for the first six rows and then the data is appended in a single column for the rest of time the program is run. I have atached images of the excel fiel and my program.

Download All
0 Kudos
Message 5 of 8
(3,519 Views)

Hi Ognee,

 

one "nice" feature of ExpressVIs is to hide all relevant settings from the user in some dialogs. So by just showing a picture of your VI we can'T help on that topic.

 

All we can do is guess:

- Your DAQ assistent only ouputs one value per read after several calls. You can easily check this with some basic debugging.

- Your Formula ExpressVI outputs just one value after several calls. Even if this is unlikely you may easily check this with some basic debugging.


To summarize: Probably it's not the WriteToSpreadsheetData that limits the number of data written to the file...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 8
(3,484 Views)

Thank You for your reply. Is there a way to time the readings I mean in there a clock type VI in labview? Also I am trying to find a way in which instead of the waveform graph refreshing every 6 seconds, the whole graph can be seen for the time time interval that I am running the program?

0 Kudos
Message 7 of 8
(3,461 Views)

Hi Ognee,

 

two points:

- There is a function palette called "Time...". There you will find functions for timing loops.

- BUT: When you use DAQmx you can use that to time your loop as the DAQmxRead will wait for new samples/data before continuing. Set a nice samplerate/#samples combination to time your loop... Did I already mention the example VIs coming with LabVIEW?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 8
(3,441 Views)