08-17-2015 02:30 AM
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
Solved! Go to Solution.
08-17-2015 02:39 AM - edited 08-17-2015 02:40 AM
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!
08-17-2015 03:09 AM
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
08-17-2015 03:12 AM
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!
08-17-2015 03:30 AM
08-17-2015 03:32 AM - edited 08-17-2015 03:35 AM
08-17-2015 07:31 PM
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?
08-18-2015 12:31 AM
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)!
08-19-2015 01:59 AM
Cheers, worked perfectly!