From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
08-18-2018 09:13 PM
Hi, I am summing a GP series (with x and N as inputs) and trying to show its deviation from an infinite GP case. The final deviation fails to connect with the indicator. Assuming I did the For Loop correctly, where am I missing out? Thanks a lot.
Solved! Go to Solution.
08-18-2018 10:06 PM
Your calculation puts out an array of doubles. Your indicator is just a scalar double. Right click the indicator and pick "Change to Array".
I would recommend you learn more about LabVIEW from here. How to Learn LV
08-18-2018 10:12 PM
dbhadra,
Seems you're trying to output an array in a double indicator.
Adding to RavensFan's answer, you can use the Context Help (Ctrl+H) and hover over the conflict so you can see the explanation of the problem.
All the best,
08-19-2018 09:13 AM
Expanding slightly on oscarfonseca's excellent explanation, For loops, by default, use an indexing output tunnel (if you look carefully, you'll see the tunnel is a square surrounding a pair of square brackets, [ ], suggesting an Array). Your exponential is a series that you want to sum. Notice that the wire coming out of the tunnel is slightly thicker, the sign of a 1D array. When you pass it through the Sum function, you add up all those elements and get a number, now carried in a thin "scalar" wire.
What about the other calculation, 1/(1-x)? This never varies, and is (probably) the (single) number that you want to compare to your summed series. By default, you are also bringing this out through an indexing tunnel, so you are creating an array, when you really want a single number. The only change you need to make to your code is to change the indexing tunnel from the 1/x function to a "last value" (the filled-square) tunnel. Right-click the tunnel, choose Tunnel Mode, Last Value, and the errors will disappear. Now run your code. With N = 5 and X = 0.5, I got a deviation of -3%, which dropped to -0.1% for N=10.
Bob Schor
08-19-2018 02:03 PM
Bob_Schor, this is exactly what I'd in mind. Thanks for confirming the same.