LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convert case in array

I am new to LabView and I am working on a set up that handle 36 leds with a customized slide control. I had it set up with a case structure but there are a lot of wires to maintain in case of futures changes and it is becoming a way too convoluted. I know it would be much easier to do this with arrays/bundles but I have no idea how to use them, please help.

Here is my current program:
 
 
0 Kudos
Message 1 of 6
(2,977 Views)

Take a few steps back and rethink your code (focus on the part with all the booleans). 🙂

You need two horizontal arrays with 10 booleans. Initialize a 10 element boolean array outside the loop, then replace the desired element with TRUE depending on the slide 2 value..

Do you need individual access to ALL these wire segments or do they always turn on in groups? If so, all that jumble in the center should be replaced by a picture ring indicator, again hooked up to slide 2, where each element is a picture of one of the various states.

 

 

Message 2 of 6
(2,968 Views)

I was following the explanation that help me to understand what was better to solve the question. Now I have this issue where I don't know how to reset the previous value, I mean, I don't know how to reinitialize the cluster before change to a new value.

 

Attached the vi.

0 Kudos
Message 3 of 6
(2,936 Views)

What's with all these local variables??? You have 20 locals where you actually only need... drumroll... zero!

Do something like in the attached image, for example:

Since there is no shift register, each case starts out with the virgin cluster from the input tunnel and makes the desired modification. 🙂

 

Message Edited by altenbach on 02-14-2007 08:48 AM

Message 4 of 6
(2,925 Views)

Sirs, this is what I call optimization!!

Even if I really don't understand very well, right now, how it works; this was the kind of optimization I was looking for.

Thanks, really very precise.

 

 

This is not the end.

 

0 Kudos
Message 5 of 6
(2,887 Views)


@José Luis wrote:
Sirs, this is what I call optimization!!

Actually, you can make it even much simpler if this is all there is!

There is no need to go to the cluster and back on the left side and all cases are the same so we can eliminate the case structure entirely. 🙂

Message Edited by altenbach on 02-21-2007 08:22 AM

0 Kudos
Message 6 of 6
(2,861 Views)