LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Import signal from excel file and run X Sample/s

Hello,
I want to import signal previously saved by LabView as .xlsx file and also import signal generated by matab in .xlsx file. Afterwards I want to run the signal for let's say 1000Sample/s and do further calculation

I also want to get a steady spectrum of the signal directly from excel data.

I am trying different VI, but couldn't find anything yet. Can anyone guide me?

Thank you in advance

0 Kudos
Message 1 of 6
(735 Views)

Hi mub,

 


@mub.re wrote:

I want to import signal previously saved by LabView as .xlsx file and also import signal generated by matab in .xlsx file.


To read Excel XSLX files you should use functions from ReportGeneration toolkit.

LabVIEW comes with example VIs (in the example finder) that explain how to use them…

 


@mub.re wrote:

Afterwards I want to run the signal for let's say 1000Sample/s and do further calculation
I also want to get a steady spectrum of the signal directly from excel data.


  • What do you mean by "run the signal"? Do you want to output to DAQ hardware?
  • You can do any calculation you like on your signal(s) after you read those XLSX files.
  • What is a "steady spectrum"?
  • What means "directly from excel data"? (Again: once you read your signals you can do any calculation you like to…)
Best regards,
GerdW


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

Hello,
Thank you for your help.
So Steady Spectrum was a poor choice of word. Normally the signal spectrum shows continuous value. What I want is a spectrum generated by last 1 minute’s value and update every 1 or t minutes. Is there any VI for that?

Thanks

Best regards

0 Kudos
Message 3 of 6
(695 Views)

You failed to attach VIs showing what you are trying, which would give us a whole lot of useful data and allow us to make "intelligent" suggestions.

 

Here are some questions I have:

  1. You describe a signal (1 channel?) saved in an Excel .xlsx file.  Describe this signal -- is it one column of, say, 50,000 entries representing 50 seconds of 1 kHz sampled data?  Something else?  Some other format?
  2. You then mention "signal generated by matlab in .xlsx file".  Is this another file?  Does this represent a "matlab connection" with LabVIEW that "delivers to LabVIEW" sampled data?  What is the format of this data?  How does it compare with the data of Point 1, above?
  3. When you acquire a signal, you say "run the signal for let's say 1000 Samples/s".  But when you acquire a signal, the sampling rate is set (and needs to be know before you do computations).  Is "the signal" the Excel signal of Point 1, or the Matlab signal of Point 2, or something else?
  4. You describe wanting a "steady spectrum".  What I think you want is, for example, to take the first 1024 points (FFTs really like powers of 2) and compute a "spectrum" (Gain and Phase?  Power?  what?) representing the first second (plus a little bit) of the first second of a signal sampled at 1 kHz.  Then you move down the data by 1000 points (1 second), take the next 1024 points, and do another FFT for the spectrum of the next second of data, and so on until you reach the end of the data.  Is this what you want?
  5. You don't really tell us what sort of data rate you are talking about, nor how much data (and in what format) you are using.  Note that saving lots of data in Excel does not seem so practical for data acquisition (as lots of time would be wasted going into and out of Excel), but if you are trying to use LabVIEW as a data analysis platform for existing Excel data, you know (and like) LabVIEW, then go for it.
  6. When we understand the Question better, you stand a much better chance of getting Useful Answers.  Help us to help you by attaching your "Project in Progress" (compress the Folder holding your Project files, and attach the resulting ZIP file.  Include an Excel Data file, which would be a big help.)

Bob Schor

0 Kudos
Message 4 of 6
(689 Views)

Hi,

Here is the whole VI, I have random Sine wave generated by matlab and saved as xlsx file. Now I want to see the wave graph and spectrum and run through weight filter to get rms value. Till now I wasn't able to read the file, but now I can read the file, but I want to read it 1000sample/s, otherwise weight filter doesn't support it. And it seems like the wave graph value is actually the frequency value, not in wave form

 

Thanks

Download All
0 Kudos
Message 5 of 6
(686 Views)

In order to open and test your Top Level VI (which you attached), we need to be able to also run all of its sub-VIs.  If you are developing your code using a LabVIEW Project (file and Folder), then you can compress the Project Folder (which contains the Project File, the top-level VIs, and should also contain the sub-VIs and Type Defs) and attach the resulting .zip file.

 

Your "data file" ("file.xlsx") is a 1 column x 229112 rows Excel file that (mostly?) contains Floating Point numbers in the range -20 .. 20.  Are these sampled data taken at a fixed sampling rate (such as 1 kHz)?  Note that to do any Time Series analysis of these data, the "time" component must be specified.

 

Just for fun, I used the Report Generation Toolkit to open this data file, read all of the data into a 2D Excel Dbl array, extracted the (1-D) data, and plotted 229 1000-poinr Graphs at a rate of 1/sec, just to see what's there.  Looks pretty noisy, with no obvious pattern (except during the first few seconds).

 

So what is it you expect these data to represent, and what do you want to do with them?

 

Bob Schor

0 Kudos
Message 6 of 6
(648 Views)