LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ data into Excel

Solved!
Go to solution

Hello everyone, I am still leaning data acquisition. I want my program to store voltage data while display the voltage curve on the waveform. Since I didn't connect my DAQ to the voltmeter, the output result will be very similar to zero volt. 

As you can see, I use write delimited spreadsheet.vi to store my data into file. However, I find it weird when I open it with Excel. 

The number of samples was set to 2000 while the sample rate was set to 4000. In the excel, the stored data has 2000 per row and two column for a second which makes it 4000 data per second. However, the way it display is really weird. Can anyone help me with this problem! Thank you so much. 

 

Noted that I have two voltage channel input, so I think another question will be did I get the right data out of the 1D array? And sorry if there are some mistakes to the grammar of this article, English is not my first language. I tried really hard to express my problems. 

Thanks a lot for reading and responding to this article.

螢幕擷取畫面 2023-03-18 223354.png

螢幕擷取畫面 2023-03-18 222706.png

  

螢幕擷取畫面 2023-03-18 222725.png

0 Kudos
Message 1 of 6
(1,350 Views)
Solution
Accepted by topic author Billy90

ROtake_0-1679160557821.png

 

Modify this part of the code out of the loop, it doesn't need to be run every time. Now, note that at  every iteration of the loop, the function gives you 2000 points every line of the spreadsheet. 

 

RKO
0 Kudos
Message 2 of 6
(1,325 Views)

Hi Billy,

 


@Billy90 wrote:

Noted that I have two voltage channel input, so I think another question will be did I get the right data out of the 1D array?


Why do you convert your DBL array to string array using the ToDecimalString? Did you read the help for that function to learn it will convert INTEGER values?

 

Other items:

  • Why are the samplerate and NumOfSamples controls defined as strings? Why don't you use I32 controls instead???
  • Why do you need to init and close the DAQmx task in each iteration? Did you learn from those DAQmx example VIs in the example finder?
  • Why don't you attach real code?
  • Why don't you use AutoCleanup?
  • Why do you use InsertIntoArray when you want to build an array? Guess what the BuildArray function is good for…
Best regards,
GerdW


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

Thank you for your response and the problem was solved! 

0 Kudos
Message 4 of 6
(1,259 Views)

WOW those are some really good questions. Since I am still new to LabVIEW, I don't know how to answer some of your questions. With that being said, I think I am still able to answer some of your problems. The reason I use string to be the input to control the sample rate and NumOfSamples is because I want UI to look better in the front panel (Weird reason). If I use I32 control, there will be a triangular selector next to it which I find it annoying. The next thing is that Why I don't use AutoCleanup. The reason is because I think auto cleanup makes it harder for people to understand the connections between elements. But thanks for the advice, I am learning a lot here. 

0 Kudos
Message 5 of 6
(1,255 Views)

Hi Billy,

 


@Billy90 wrote:

The reason I use string to be the input to control the sample rate and NumOfSamples is because I want UI to look better in the front panel (Weird reason). If I use I32 control, there will be a triangular selector next to it which I find it annoying. 


Right-click the numeric control and look what hides behind the "Visible items" submenu…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 6
(1,231 Views)