10-12-2023 08:21 AM
Hello everyone, I am new to LabVIEW. I am trying to plot x1 = sin(t), x2 = sin(t+2π/3), x3 = sin(t+4π/3), and x1^2+ x2^2 +x3^2. Here is what I have already done:
The thing is, as I set x1,x2,x3 and x_sum as numeric indicators, I cannot wire them to waveform chart. Can anybody tell me how to fix this problem? Also, can I put all four plots into one graph? It seems like waveform chart can only be wired to one variable.
Thank you so much for spending time answering my question!
Solved! Go to Solution.
10-12-2023 08:45 AM - edited 10-12-2023 08:51 AM
The chart IS an indicator. Put it in the loop and you can wire any of the output wires to the chart as well as the DBL indicator you already have. If you want to chart all of the outputs, combine them with a bundle. If you hover over the chart terminal with the help open, you will see how to do it.
10-12-2023 08:49 AM
One more thing to do is to right-click your chart terminal and create a property node for History Data. Put it in front of your loop and wire the error out to the loop so it always runs first thing. Set the History to read and create a constant. That will clear your chart at the beginning of every run. Otherwise, your chart will remember its history and append new data which can be confusing.
10-12-2023 08:56 AM
use a function called "bundle" and connect all your indications into it, then wire it to thte waveform chart. Ensure you do this INSIDE the loop so the chart is updated while the loop is running, not after you press the stop button (that's how it will behave the way it is currently shown in your code).
10-12-2023 09:00 AM - edited 10-12-2023 09:02 AM
Don't forget the example finder for help with the basics either: Help > Find Examples...
Click the search tab and search for waveform chart and look at this example for instance...
Of course, you should also not forget the tutorial: LabVIEW Tutorial (ni.com)
10-12-2023 09:09 AM
ONE MORE THING! I notice your code will not really plot waves unless you manually update your value of "t". Your code is running in a loop that has an indicator for the iteration. Maybe there's a way to automate "t"??? Hint: Look at that example...
10-12-2023 09:22 AM
It worked! Thank you so much!