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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with data in numeric indicator

Solved!
Go to solution

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. 

0 Kudos
Message 1 of 5
(3,011 Views)

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

 

 

0 Kudos
Message 2 of 5
(2,996 Views)
Solution
Accepted by topic author dbhadra

dbhadra,

 

Seems you're trying to output an array in a double indicator.

Screen Shot 2018-08-18 at 10.08.43 PM.png

 

 

 

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,

0 Kudos
Message 3 of 5
(2,993 Views)
Solution
Accepted by topic author dbhadra

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

0 Kudos
Message 4 of 5
(2,955 Views)

Bob_Schor, this is exactly what I'd in mind. Thanks for confirming the same. 

0 Kudos
Message 5 of 5
(2,943 Views)