02-28-2017 03:28 PM
Hello, I'm working on a school project and need some help with graphs in labview.
I am not a seasoned user so I dont know what excactly is happening.
When I try to link a graph with 12 sine functions from a subVI to one in my main VI the output is 12 straight lines. The lines are still reactive to input and change to zero when I switch a button that makes the input of the sine function 0.
I just think it's strange that the value of the graph in the subVI goes straight to the main one but changes it. I tried fixing it but nothing really worked. I just can't get my head around it.
Has anyone else ever had this problem? Any help would be appreciated.
02-28-2017 03:33 PM
It'd help to see your two VIs, the caller and the subVI.
I suspect you're running into one of two issues:
1) You're only outputting a single value instead of an array from your subVI.
2) Your range on the main VI is small enough you're only seeing a small number of samples.
A graph requires you to feed it an array to give the entire data you want to graph. If you only send it a couple of points, you won't see much. If you only send it a single value, it'll be hard to make anything intelligible from the graph. If you only want to feed a single value and have it maintain the history for you, take a look at charts instead.
Are you able to post the code so we can take a look and help you narrow down the issue?
02-28-2017 04:13 PM
I'm going to assume you know the difference between a Graph and a Chart in LabVIEW, right?
A Graph is an indicator, meaning you load it with X-Y points and it shows them "on a graph". If you have a Graph in your top-level VI and you load with points, it will show them.
If you have a sub-VI and put a Graph on its Front Panel (where you ordinarily would never see it), you can fill the sub-VI's Graph with points (12 sine waves) and it will plot them, but the Graph, itself, has no output back to the calling VI, so the calling Top-Level VI won't have any input and won't show any points. Now, if your sub-VI output the 12 sine waves themselves, that you could plot on the top-level VI.
Bob Schor