10-04-2012 10:03 PM
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
Solved! Go to Solution.
10-04-2012 10:05 PM - edited 10-04-2012 10:11 PM
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.
10-04-2012 10:11 PM - edited 10-04-2012 10:13 PM
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.
10-05-2012 05:45 AM
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
10-05-2012 06:15 AM
Ok, I figured it out. I needed a for loop!
Thanks to both!