01-07-2015 10:15 AM
Hey all,
As an exercise I am trying to plot 2 functions placed in a 2D array on a graph, but for some reason the graph is only showing one of them.
The functions are : y = 5x+10 and y = 6x - 10.
I really don't see what I am doing wrong here, could anyone give me some more insight?
Thanks in advance,
Michiel
Solved! Go to Solution.
01-07-2015 10:29 AM
Based on your code, I think what you really want to use is a Chart, not a Graph. A chart keeps a history, so it just keeps adding on to the data. A graph will get overwritten each time you write to the terminal. So you were only graphing a single point for each plot.
01-07-2015 10:38 AM
Al,
To explain a bit more of what is going on, you have two functions
y1 = 5x+10
y2 = 6x - 10
Each loop of your application you receive two outputs;
y1(Numeric) = A
y2(Numeric) = B
You build an array such that you have [A,B]. When you plot the graph you then draw a line between points {0,A} and {1,B} because LabVIEW's default behavior is to use the indeces of the array as the x-coordinates
01-07-2015 02:06 PM
Oh okay I get it, how can I prevent this from happening and just show A & B on their own?
01-07-2015 03:05 PM
01-07-2015 03:32 PM
Alright I figured it out this way! Thanks alot for the help!
File added to how I did it.