LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Want to create a waveform using imported data from spreadsheet

Solved!
Go to solution

Hi,

 

I would like to make a waveform chart using imported data from Excel spreadsheet file.

 

But in my VI, the graph obtained is not in the correct shape. I would like to convert it to the waveform like in the photo I attached.

 

Could you please tell the error in my VI or suggest another way to do this?

 

Please help!

 

 

 

0 Kudos
Message 1 of 13
(2,283 Views)

Well without your data file we can't really test your program but...

 

My first question is:

 

Why are you converting your data file to strings when you want to graph numbers?

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 13
(2,274 Views)

Sorry for the inconvenience, previously I uploaded the wrong files. Now I reedited the post and uploaded the correct files. 

 

Could you please check those?

 

 

0 Kudos
Message 3 of 13
(2,261 Views)

Okay now that we have something to work with.

 

Does your fife contain both X and Y data?

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 13
(2,255 Views)
Solution
Accepted by topic author samitha95

Something like this?

 

XYCapture.PNGX-YGraph1.png

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 5 of 13
(2,249 Views)
Solution
Accepted by topic author samitha95

RTSLVU's last message is the real solution to your question, not the earlier one.

 

But the major flaw in your attempt was that you were converting the strings to numbers using Decimal String to Number.  That can be a confusing function as most people thing of decimal points and numbers after the decimal point.  But in this case Decimal means Decimal integer (as opposed to hexadecimal, octal, and binary).   So all of your nice fractional numbers were forced to integers (-1, 0, 1).   If you had used Fractional String to Number, it probably would have turned out alright, ignoring the extra code bloat.

0 Kudos
Message 6 of 13
(2,222 Views)

Thank you very much RTSLVU. Actually that's I wanted.

 

 

Are there any differences in between XY Graph and Waveform Graph (for the above purpose)?

 

0 Kudos
Message 7 of 13
(2,148 Views)

Thank you RavensFan for your great explanation.

 

It was very helpful to understand the mistakes in my VI.

 

 

0 Kudos
Message 8 of 13
(2,143 Views)

@samitha95 wrote:

Thank you very much RTSLVU. Actually that's I wanted.

 

 

Are there any differences in between XY Graph and Waveform Graph (for the above purpose)?

 


XY Graphs have X, Y pairs for points.  They can be anything.  X can be unevenly spaced.  X can be repeated.  It can loop back on itself, you can create an array of pairs that forms a circle.

 

Waveform Graphs are for evenly spaced data.  You have an array of Y values, and two other parameters a T0 to indicate a start time and a dT to indicate the interval between X values.  (Although they are called T0 and dT, they don't necessarily need to be "time".  They could be values that represent position, frequency Temperatures, whatever you want the X axis to mean.)

 

It looks like your data has evenly space X values, so a Waveform graph would've worked.  But since the data provides it as X and Y pairs, it is easier to just treat it that way and use an XY graph.

Message 9 of 13
(2,133 Views)

Thanks a lot RavensFan for that explanation.

0 Kudos
Message 10 of 13
(2,122 Views)