LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Export Waveforms to Spreadsheet File.vi

Solved!
Go to solution

Hi All,

 

I'm trying to use the export waveform to spreadsheet function on a waveform that is appended for the duration of a while loop using a shift register. The VI runs just fine and acquires all the proper data and corresponding timepoints however when I hit the stop button to exit the while loop there is no prompt or pop up asking me to save the excel file. The VI simply ends after leaving the while loop.

 

Has anything else had this problem? I think I am likely missing a step somewhere, but I based the block diagram from a a youtube video walkthrough (https://www.youtube.com/watch?v=GBhJk5Tnshc) and I cannot seem to find my error.

 

Please find attached my block diagram and VI and apologies for the in text link above, I am not quite sure on the exact posting protocol here.

 

Any help would be much appreciated!

 

Ben

Download All
0 Kudos
Message 1 of 9
(6,076 Views)
Solution
Accepted by topic author bsia5466

Hi bsia,

 

you should have mentioned you want to run your VI on a myRIO target!

 

The RIO platform usually has NO screen attached to show a UI to the user. When there is no UI you cannot show any file dialog on/in the UI!

Simply supply a filepath constant to the WriteWaveform VI - and don't forget to choose a path available on the myRIO target: you cannot save directly on your PC's harddisc!

 

On your VI:

Why are you warking with a waveform at all? I don't see any specific sample rate setting, so building a waveform seems senseless to me! Just collect your data in an array and use the simple SaveSpreadsheetFile function to save this array to (myRIO) disc!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 9
(6,070 Views)

Hey GredW,

 

Cheers for the reply. I want my encoder values to have corresponding time values and that waveform method was the first I could find to do such a thing. How could I build an array that accumulates/stores the encoder value and corresponding time over each iteration of the while loop? I'm pretty new to labview but if you could point me in the right direction I could hopefully figure it out quickly!

 

Ben

0 Kudos
Message 3 of 9
(6,047 Views)

Hi bsia,

 

I want my encoder values to have corresponding time values and that waveform method was the first I could find to do such a thing.

When you set a dt=0.01 for your waveform constant you should take an encoder reading each 10ms=0.01s! Right now there is no loop timing, so the dt parameter of the waveform is senseless…

 

To build a waveform you don't need this ExpressVI: just build an array of Y values and use BuildWaveform to put this Y array in a waveform!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 9
(6,044 Views)
When i build the array of y values, do I have to specify the length of the array? I do not know exactly how long the loop will be running for? (It is dependent on other parameters). Is there a way to increase the size of the array using an append type function?
0 Kudos
Message 5 of 9
(6,016 Views)

Hi bsia,

 

right now you also create a waveform from scalar samples, without setting any length limit on the waveform…

 

You could use a simple BuildArray function in the very same way:

check.png

(Basic sketch…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 9
(6,013 Views)

Thanks so much GerdW this is working really well now.

 

In addition to the displacement values logged by the encoder I want to log the speed as well. Now I can work out the speed pretty easy but I am wondering if I can add an additional data column to the spreadsheet file containing the displacement data. I've tried putting in the speed number into the build array function however when I take a look at the CSV file it alternates between the speed and displacement data every 0.01s, this is because that array is running into a single Y terminal on the build waveform function. Is there a way to the change the build waveform function to accept two data columns at matched to the same timestamp?

 

0 Kudos
Message 7 of 9
(5,916 Views)

Hi bsia,

 

Is there a way to the change the build waveform function to accept two data columns at matched to the same timestamp?

Yes, there is.

 

Create a 2D array with 3 columns: timestamp, encoder, speed. Save this 2D array using the simple WriteSpreadsheetFile function (as mentioned before)!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 9
(5,868 Views)

Cheers, worked perfectly!

0 Kudos
Message 9 of 9
(5,798 Views)