# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## convert 1D array element to integer

Does anyone know how I can extract the value (element) from a 1D array so that the output value is an integer ?  I'm having signal incompatibility problems (again).  I need to use the particular element from an array in various math blocks i.e. Add

Message 1 of 14
(13,734 Views)

## Re: convert 1D array element to integer

What is the data type of the array?

LabVIEW Champion. It all comes together in GCentral
What does "Engineering Redefined" mean??
Message 2 of 14
(13,728 Views)

## Re: convert 1D array element to integer

The following is the error message that I'm receiving:

These cannot be wired together because their data types (numeric, string, array, cluster, etc.) do not match. Show the Context Help window to see what data type is required.
The type of the source is 1-D array of
double [64-bit real (~15 digit precision)].
The type of the sink is double [64-bit real (~15 digit precision)].

I'm puzzled why LabVIEW is telling me that the data types do not match when the Source & Sink are the same (double 64-bit real) ?

Message 3 of 14
(13,689 Views)

## Re: convert 1D array element to integer

One is an array and one is a scalar. That's not the same!

(What does your question have to do with whatever code you attached above?)

LabVIEW Champion. It all comes together in GCentral
What does "Engineering Redefined" mean??
Message 4 of 14
(13,682 Views)

## Re: convert 1D array element to integer

@bunnykins wrote:

I need to use the particular element from an array...

I could be over simplifying things here, but it sounds like you just need to use the Index Array function.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 14
(13,675 Views)

## Re: convert 1D array element to integer

I tried using Index Array but it still doesn't work.  The output from the Index Array is still in 1D array format.  I need the output to be a plain and simple integer or constant that I can then manipulate along with other constants in Add, Subtract blocks etc.

Message 6 of 14
(13,659 Views)

## Re: convert 1D array element to integer

Please post the VI you are having your problem with and tell us exactly where your problem is in the VI.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 7 of 14
(13,656 Views)
Solution
Accepted by topic author bunnykins

## Re: convert 1D array element to integer

@bunnykins wrote:

I tried using Index Array but it still doesn't work.  The output from the Index Array is still in 1D array format.

If the input is a 1D array, the output of index array is a scalar. (Only if the input is a 2D (or higher) array, and not all indices are wired, you don't get a scalar)

Make sure you are really wired to the output and not to the already wired input or similar.

LabVIEW Champion. It all comes together in GCentral
What does "Engineering Redefined" mean??
Message 8 of 14
(13,650 Views)

## Re: convert 1D array element to integer

Hi,

I faced the same problem as well but I don't really understand what you meant by "Make sure you are really wired to the output and not to the already wired input or similar."

Do you mind to explain in details?

Thanks! 😄

Regards,

Vanessa

Message 9 of 14
(12,724 Views)

## Re: convert 1D array element to integer

Please do not add to an old thread that is already marked as solved with a new problem. (if you had the same problem the above solution would be sufficient!)

Please attach your code and tell us exactly what you are trying to do and what kind of problem you have.

LabVIEW Champion. It all comes together in GCentral
What does "Engineering Redefined" mean??
Message 10 of 14
(12,719 Views)