LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to handle 25 leds


@Rafi2003 wrote:

1. Radio Buttons

    a.   When I define a radio button (Modern -->Boolean-->Radio Button)  I get something completely different from you.

    b.   In the Front Panel -- I don't see a binary switch like you show

    c.   In the block diagram I get the same symbol like you.


Maybe this post will help? 😄


@Rafi2003 wrote:

2. Transparent Cluster of colored Leds.

    a.   I define a cluster in the block diagram programming-->cluster Class and Variant-->Cluster constant.

    b.   I get a square ?!

    c.  I define few leds in the front panel.  Then, I put those leds inside the cluster.

    d.  The cluster still shows cluster with 0 elements   .... ?!


 (All you get on the block diagram is a cluster constant that can contain other constants. You cannot place terminals inside a cluster constant, for example, so that's not what you want. Unless the cluster frame highlights when you move something over it, it will not accept it. All you get is a terminal on top of a cluster frame.)

You define a cluster on the front panel (controls...array, matrix & cluster...cluster!), then place the indicators inside (skip the transparency for now, it is easier to work with). Try again.


Rafi2003 wrote:

In addition, as I stated in my requirement, I would like the vi to leave the state of the LED even after I push a different one.  In other words, once I pushed a button and the led turned to its color (green or red) it will stay so and will not blink again.


Then you simply need to store the state in another shift register, here's one possibility. See how far you get. 🙂

 

Of course this still does not seem complete, for example there is no way to ever reset the indicators to "don't know". Try to add it. 😉

 

 

Download All
Message 11 of 17
(681 Views)

Hello Altenbach

 

You've been very helpful, thank you very much!

 

Problems so far...

 

1. Radio Buttons

   a.  I created a cluster

   b.  I put in a radio button

   c.  I changed the radio button to a binary switch.

   d.  I copied it few times to get more buttons.

   e.  PROBLEM:  My switches shown as binary (True/False) which is what expected

   f.   Your diagram shows them as numbers.

   g.  We have different icons...

   h.  Can you describe the steps to achieve the radio buttons section (are you using a cluster?)

 

Thanks again

RK

0 Kudos
Message 12 of 17
(664 Views)

Attached is my vi

 

Also the leds seems to be of the wrong type.... and it can't be connectd to the 'numeric to cluster' component.

 

How do I fix it?

 

thanks

RK

0 Kudos
Message 13 of 17
(663 Views)

@Rafi2003 wrote:

1. Radio Buttons

   a.  I created a cluster


The radio button control can be found in the boolean palette. It is NOT a cluster. It is a special container that can contain only booleans and only one (or zero) can be true at any given time. The data tpye is an enum with items names corresponding to the labels of the booleans. 

0 Kudos
Message 14 of 17
(657 Views)

@Rafi2003 wrote:

Also the leds seems to be of the wrong type.... and it can't be connectd to the 'numeric to cluster' component.


My cluster contains colorboxes that look like LEDs, see my earlier link. Since you want more than two states (colors), a boolean is inufficient because its data can have only two possible states. (... and constantly switching colors using property nodes would be silly). The data of a color box is numeric, much more suitable.

 

Also don't forget to set the cluster size for "Array to cluster". If you only have four LEDs, it needs to be set to four.

Message 15 of 17
(655 Views)

Hi and thanks for your help.

 

I got it to work.

 

Now, I want to add a loop that will blink only one led, the operator will press the approperiate switch and then the led will turn green/red.

than, after a timeout (2 sec) the next led will flash yello/blue

 

I've done something but I cant control the 2 second delay.

 

Can you help to fix this?

 

Thanks

RK

0 Kudos
Message 16 of 17
(646 Views)

You really should start with a few basic LabVIEW tutorials. Just looking at your code for 2 seconds it is clear that it can never work. The inner loop termination condition is evaluated before the loop starts and then never updated. Also, the output if the wait function is the tick count, and it thus will never work the way you seem to think.

 

You have three stacked loops: a while loop inside a for loop inside a while loop. That is way too much code! All you need is exactly one loop and a case structure that changes the code according to the current state.

0 Kudos
Message 17 of 17
(637 Views)