LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Index Array Strange Error?

Solved!
Go to solution

Greetings Everyone,

 

  I am trying to work with reading in a file and plotting the data from this file. In the #1 frame of my VI, I am trying to plot the data from the Listboxes on the front panel. When I try to wire in the Y-Axis to columns, I receive an error, but the error does not make sense.

 

  I receive "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
    long [32-bit integer (-2147483648 to 2147483647)].
The type of the sink is long [32-bit integer (-2147483648 to 2147483647)]." - but the X-Axis is fine and I have that wired to columns.

 

   Can someone tell me what I am doing wrong?

 

   Thanks!
    TheLT

0 Kudos
Message 1 of 5
(2,626 Views)
Solution
Accepted by topic author TheLT

It is because you listbox is set up to "allow multiple selections." Therefore, the data type is an array, one index per selected item. Right click the y axis control on the front panel and uncheck this option

 

Edit: It's under selection mode-> uncheck 1 or more items.

Message 2 of 5
(2,624 Views)

It makes perfect sense.  You can't wire an array into the index terminal of the Index Array function because it expects a scalar value.

 

I think your problem begins because that Y listbox is set for 1 or more items.  Since multiple items can be selected, it has to return an array.  Meanwhile your X listbox is set for 1 item.  If you right click the Y listbox and go to the Selection Mode menu choice, change it from 1 or more items to just 1 item.  Also go to Selection Mode, Data Type and change it from Array to Scale, then your problem will resolved itself.

Message 3 of 5
(2,621 Views)

Thanks to both for respoonding.

 

  I just have a quick question. Say if I needed to have the X-axis as only one selection and required to have the Y-Axis more than one. How would that work?

 

  Thanks!

   TheLT

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

Ok, I figured it out. I needed a for loop!

 

Thanks to both!

Message 5 of 5
(2,581 Views)