LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

case structure append array

Hi there,

 

I want to fill my array depending if the radiobutton is clicked.

 

But the array does not grow.

 

Here is part of my VI.

 

test.PNG

0 Kudos
Message 1 of 12
(5,057 Views)

Hi Xeno,

 

which "array" do you want to grow?

 

In general: to "grow" an array you need an older version of the array data, then you attach new values (with BuildArray), then you store the new data set in a wire. (This is called THINK DATAFLOW!)

 

General hint 2: You store data in wires or shift registers.

 

This is pretty basic LabVIEW stuff about array handling - did you take the free online resources to learn LabVIEW?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 12
(5,051 Views)

I want to grow append array.and also that the filenames are correctly transfered into the array, but thanks for the hint.test2.PNG

0 Kudos
Message 3 of 12
(5,046 Views)

You'll need to maintain the array somewhere.  You'll want to use either a variable of some time or a shift register.  Typically, I'd prefer the latter.

 

You'll also want to get into the habit now of creating an icon for subVIs you create.  The default icon with a 1 is something that will plague you as you start to develop more complex applications.

0 Kudos
Message 4 of 12
(5,043 Views)

I understand what you mean, but I have make nearly a screenshot of the whole diagram and hopefully you will see my problem.test3.PNG

0 Kudos
Message 5 of 12
(5,030 Views)

Hi,

 

the problem is you still don't use a shift register to hold your array to append…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 12
(5,022 Views)

Please stop attaching screenshots and attach the actual VI. Thanks!

Most of the code makes very little sense.

 

  • Why is there an event structure inside a case structure?
  • Why are there FOR loops running in parallel that seem to spin as fast as the computer allows, repeating the same operation dozends of time. Wouldn't once be enough? (ever heard of autoindexing? search array?)
  • What's up with all these local variables?
0 Kudos
Message 7 of 12
(5,020 Views)

Which problem are you wanting us to see?

 

You still aren't using shift registers/variables?

You still have default icons?

You have wires running behind your structures?

 

They're all easy to fix.

 

1) Create a shift register to maintain your array.

2) Double click on the icon and edit it

3) Right-click on the wire and choose "clean up wire"

0 Kudos
Message 8 of 12
(5,019 Views)
Hopefully many suggested the right way to fix your problem.

Intialialising the array with shift register and building the array when required will be one of the easy and simplest method as per as your requirement.
----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 9 of 12
(5,000 Views)

Hey there,

 

thank you all for your help, I have found a solution. It was yesterday too hot, so my brain was a little bit damaged:)

 

Here is my vi:

filenames.PNG

 

 

Sry for asking again, but now I have a little problem with the multicolumn listbox, where I want to add string values depending on the radiobutton which works, but no string is transfered into the box.

 

box.PNG

 

And the gui:

gui.PNG

0 Kudos
Message 10 of 12
(4,971 Views)