03-03-2021 07:55 PM - edited 03-03-2021 08:15 PM
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!
Solved! Go to Solution.
03-03-2021 08:12 PM - edited 03-03-2021 08:12 PM
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?
03-03-2021 08:23 PM
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?
03-03-2021 08:32 PM
Okay now that we have something to work with.
Does your fife contain both X and Y data?
03-03-2021 08:43 PM
Something like this?
03-03-2021 09:31 PM
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.
03-04-2021 10:43 AM - edited 03-04-2021 10:54 AM
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)?
03-04-2021 10:49 AM
Thank you RavensFan for your great explanation.
It was very helpful to understand the mistakes in my VI.
03-04-2021 01:35 PM
@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.
03-04-2021 06:36 PM
Thanks a lot RavensFan for that explanation.