LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pulling single element from 2D array

Hi,

How can I pull a single element from a 2D array (an array of decimal numbers) and store it in a numeric DBL?

Thanks!
0 Kudos
Message 1 of 4
(3,200 Views)

look here.gif

Here is some useful tips for the Labview beginner (we have all been there some time)

1)Then starting a new Labview session enable context help (Ctrl+h). Do not be afraid to use the detailed help option

2)Then stuck, go to help in the toolbar then select find examples

3) Before you post in this forum always do 1) and 2). That is mandatory



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 2 of 4
(3,191 Views)
0 Kudos
Message 3 of 4
(3,165 Views)

The link above gives a confusing solution that is only partially correct.

 

You simply use "Index array", no resizing needed. (you cannot change the number of inputs, just the number of outputs!). You will get one index terminal for each dimension of the array per element you want and you only want one element. No resizing needed! 😉

 

I am not sure what you mean by "store in a numeric DBL". The data is in the wire coming out of the "index array" node and you can re-use it in downstream code or also hook up an numeric indicator if it is of interest to the operator. If you want to use it in later iterations, keep it in a feedback node. You can also place it in a queue or shared variable, depending on the requirements. Can you tell us a little more what you want to do?

 

I am also not sure what you mean by "2D array of decimal numbers". "Decimal" is just a cosmetic feature of a control or indicator. Is is a 2D array of numerics? Is it a 2D array of decimal formatted strings? If you have a string, you need to scan it. If you have a different numeric data type, you can convert it to DBL.

 

Message Edited by altenbach on 08-02-2009 05:07 PM
0 Kudos
Message 4 of 4
(3,150 Views)