10-11-2024 10:15 AM
This may be a simple question, but I can't seem to figure it out.
In my program, I am measuring an experimental voltage (Vresis). I am dividing that voltage by a numeric constant of resistance (Resistance) to get the current that goes through my one-loop circuit. I am able to chart the current vs time on a standard waveform chart.
I am also taking in another voltage, (delta V 1-2). I want to chart my current on the x-axis and voltage (delta V 1-2) on the y-axis in order to find the slope and y-intercept of that graph.
1. How can I chart the two variables against each other, making it so I have a variable other than time on the x-axis?
2. How can get my program to identify the y-intercept of the voltage (delta V 1-2) vs current graph to use for other calculations?
I have included screenshots of my entire labview program below. I am a beginner, so any tips or comments would be greatly appreciated!
10-11-2024 10:25 AM - edited 10-11-2024 10:30 AM
Sorry, we don't do screenshots. Please attach your VI (save for previous, 2020 or below first)
(You attached 3 different pictures showing at least seven charts. How are we supposed to figure out what you are talking about!)
The x axis is labeled "time" by default, but can be named anything of course, as long as the points are spaced equally.
To graph Y vs X, where X and Y are randomly spaced, you need an xy graph. If you want to graph the x,y position as a trajectory updated in time, you need to build the data in a shift register. Simple!
10-11-2024 10:28 AM
I have linked my VI below. Thank you!
10-11-2024 10:31 AM
You did no "save for previous". It is still In LabVIEW 2023.
10-11-2024 10:35 AM
I apologize. Please let me know if this is in an earlier version.
10-11-2024 10:43 AM
Here's a simple example graphing two values against each other as a function of time.
10-11-2024 11:21 AM
1 To plot xy you need to bundle 2 arrays (your delta V1-2) and the Current array and bundle to plot on a XY graph.
2To calculate the y intercept play around with a function Liner fit, pass voltage as Y and current array as X.
10-11-2024 11:38 AM
@charlotte99 wrote:I want to chart my current on the x-axis and voltage (delta V 1-2) on the y-axis in order to find the slope and y-intercept of that graph.
This assume that there is a linear dependence between the two sets and you have at least two point. Is this a valid assumption?
In that case, you can just feed the data to "linear fit ptbypt" and get a display of slope and intercept updated as more data arrives. You could even chart these outputs.
About your code.
10-14-2024 11:38 AM - edited 10-14-2024 11:49 AM
"This assume that there is a linear dependence between the two sets and you have at least two point. Is this a valid assumption?"
Yes, that is correct.
I took your advice to revise my code, as I have linked below.
What do you mean by "create and destroy two virtual channels with each iteration of the top loop"?