LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multicolumn listbox issues

I seem to be having an issue where I'm now not initialising enough cells for data to go into. However if I initialise too many I'll have blank spaces, and while the data is in memory it won't actually get displayed on the listbox as there isn't enough ItemNames initialised in the array. Any help?

I can provide screenshots as needed

0 Kudos
Message 1 of 12
(1,821 Views)

Instead of initializing an array, use "Place Element In 2D Array.vim" (attached)

like this:

mcl.png

"If you weren't supposed to push it, it wouldn't be a button."
Message 2 of 12
(1,812 Views)

@TylerHW wrote:

I can provide screenshots as needed


As we discussed in your other thread, you just need to do it correctly. No need to initialize anything! A 2D array has no "cells", just elements. Once you get the 2D array of strings for the item names, you know how big it is.

Message 3 of 12
(1,785 Views)

Okay let's stick to this thread.
I understand that arrays don't have cells, i'm just using that word for ease. I'm referring to the element of the listbox. My issue is that I have no idea how big it'll be from the start. I'm scanning the directory for the files and editing the array (listbox) to contain the files info, as it goes through a for loop.

0 Kudos
Message 4 of 12
(1,781 Views)

Hi Tyler,

 


@TylerHW wrote:

My issue is that I have no idea how big it'll be from the start. I'm scanning the directory for the files and editing the array (listbox) to contain the files info, as it goes through a for loop.


So you are using an autoindexing FOR loop - good.

Why do you need to know the resulting array size before starting the loop?

 


@TylerHW wrote:

I'm referring to the element of the listbox.


The "element" of a listbox os the index of the selected item.

I think now you are referring to items of the listbox - as this is their name in the list of properties…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 12
(1,766 Views)

I've attached my project below, in essence, I need to make a media organiser, which takes media files and organises them into playlists. I'm defining these playlists using xml files. The media must also be associated with it's path, a comment, a category and an image. Which is also determined by xml files and then all of this info is passed into the vi. You can see my processes in the project.

Sorry for being vague I'm just a bit stressed trying to get this to work 🙂

0 Kudos
Message 6 of 12
(1,762 Views)

My issue stems from when I'm trying to add media to a potential new playlist, "create playlist" tab, it gets to about 7 elements displayed in the listbox and then doesn't display anymore, however if i click let's say 3 more times to add media to the playlist, i then have to remove them 3 elements again before the change is displayed. If you give the VI a go you can see what I mean

0 Kudos
Message 7 of 12
(1,760 Views)

Hi Tyler,

 

many of us don't like RAR files because they require proprietary software. Please use ZIP instead!

 


@TylerHW wrote:

I've attached my project below, in essence, I need to make a media organiser, which takes media files and organises them into playlists. I'm defining these playlists using xml files. The media must also be associated with it's path, a comment, a category and an image. Which is also determined by xml files and then all of this info is passed into the vi. You can see my processes in the project.


Ok, why do you still initialize the listbox with this huge array constant? This is from "Main.vi":

GerdW_0-1676493302911.png

Is there a reason to initialize to 3 rows ad 501 columns of empty strings and just one "0" in the last element???

You have been told to initialize with an empty array constant instead!

 

The same problems happens in here:

GerdW_0-1676493523065.png

Why do you initialize with an array of 9×5 empty strings???

 

Why do you use ReplaceArrayElement when you want to build an array of unknown size in "Fill Playlist Array File Names"??? Use AutoIndexing instead!!!

See this as suggestion:

GerdW_0-1676493957528.png

 

For my taste you are using way too much local variables/"value" property nodes: data should be kept in wires and shift registers! Controls/indicators should be used to input/display data, but not to buffer data…

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 12
(1,748 Views)

Not sure why my previous reply didn't send, for both of the examples you sent me that's not what I have in my project? Not sure where u got that from.

TylerHW_0-1676493989936.png

TylerHW_1-1676494001082.png

I'm going to attach a ZIP to this reply

0 Kudos
Message 9 of 12
(1,731 Views)

Sorry for my weird responses too. For some reason the forum only likes to display parts of your message after refereshing 🙂

 

I'm going to implement your example and see how that works out 🙂
Cheers

0 Kudos
Message 10 of 12
(1,716 Views)