LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

selective arrays

Currently i am using 8 toggle switches to simulate 8 bits, which are going into an array and are being displayed as a binary number. I would like to have the option to have all the bits on, or all the bits off, or for the user to select specific bits? has anyone got any ideas on how to do this? thanks
0 Kudos
Message 1 of 12
(3,632 Views)
Hello,

Does the attached VI do what you were asking for ?

Feel free to tell me if I am missing the point...

We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

Message 2 of 12
(3,618 Views)
Nice solution. Adding to that, in LV8 you have the ability to use front panel object short-cut menus, so you could if you really wanted to, implement the code so that you get the option of setting all high or all low, by right-clicking on the array object and making the relevant menu selection. This would at least remove the need for the two additional booleans but could be slight over-kill for your app 🙂
Message 3 of 12
(3,599 Views)
hmmmm... I didn't know that... someday I should upgrade to LV8, I keep reading posts with "LV8 can do this easier..." or "LV8 has this built in"...
Smiley Very Happy

We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 4 of 12
(3,595 Views)
Yeah, there are some really good features. You could also build this into an XControl, and the block diagram would only look like a standard icon, hiding the lower level code. In fact, that gives me an idea, if I get time, I'll post an example of this, but you know what its like trying to find a little bit of time to play around with some code 🙂
0 Kudos
Message 5 of 12
(3,590 Views)
thanks a lot guys, unfortunately my uni is too tight to pay for labview 8, but i will try the Vi u suggested. cheers
0 Kudos
Message 6 of 12
(3,584 Views)
Hi, the vi you suggested is just what I was looking for. I didnt even think about using event loops! I am having trouble indicating that the bits are on/high with LED's however. Do you know how i could do this?
 
thanks again!
 
tom
0 Kudos
Message 7 of 12
(3,568 Views)
Hi tom,

I'm sorry I don't understand what you mean by :



 I am having trouble indicating that the bits are on/high with LED's however. Do you know how i could do this?
 


Tell me if the attached vi does what you are asking for... Smiley Surprised

We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

Message 8 of 12
(3,560 Views)
Sorry i wasnt being clear. When bit 1 is switched on, I'd like an LED to indicate that it is on. The same for the whole port of 8 bits. I was having troube doing this with the event cases.
thanks
0 Kudos
Message 9 of 12
(3,555 Views)
Well this is what I assumed... and the last vi I sent is doing this, no Smiley Surprised ?



We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 10 of 12
(3,552 Views)