LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

changing boolean state and read change

Solved!
Go to solution

Hello Everybody,

 

sorry to bother you, but as a new user of Labview, I still have problems to program VI's. I try to do my best alone, but right now I have been in a dead end for a while... Thats why I come back to you.

 

Here is my problem:

 

- in A VI I made, I have a boolean , which command if data are recorded or not. When recording is on, the led enlights, when it is off the led is of.

- Actually, I would like to link the recording action to something more complicated:, I would like the changing state of the boolean to enlights several leds in a specific order. 

Thus, when the boolean change, this should change the state of the leds. 

I managed to do so, when pressing the button in the boolean_count.VI, that has the result I would like to obtain.

 

My problem is that, the change of state is not initiated only by a push button. It depends of several state (true or false), which order the recording or not.

To simulate that, I have tried to do same as previously, but with 2 booleans, which have to be both true to initiate a change. I tried to do so in the file Try_out_boolean.VI 

But iin this file, when I push my buttons, there is no change of state in the right part of my panel...

 

I hope You can underrstand what I mean. If you have any suggestions, I will be glad to read them.

 

 

 

Download All
0 Kudos
Message 1 of 6
(4,483 Views)
Solution
Accepted by jeffou

in the property node "1and2" of your Try_out_boolean.vi, you read the property "BindingLEDVisible".

(as well as I downloaded) That makes no sense.

-> click with the mouse on this property node an choose the property "Value" instead.

Then your application should react as wanted.

 

Thre may be other improvements possible, e.g. using event structures instead of continually polling -

but that is another topic...

 

i hope, this helps a little bit.

Message 2 of 6
(4,460 Views)

I'm not at all sure what you are trying to do (it can be difficult to figure out the "idea" behind someone's code without documentation).  However, if what you want to do is have a "boolean counter", that is, have a series of lights that "count" in boolean (0 is all lights off, 1 is first light on, 3 is first two lights on, etc.), you might look into the "number to array" and "array to number" functions on the Boolean palette.  Wire an integer into Number to Array, and wire an array of boolean indicators to its output, and presto, a Binary Counter emerges.

Message 3 of 6
(4,453 Views)

Indeed, it works. I don't know why I did not do that before (I guess that learning a new software I can be perturbated by simple things...).. Thanks for the solution T Hamberger.

 

 

0 Kudos
Message 4 of 6
(4,439 Views)

Dear Bob, thank you for your answer. 

 

Actually, what I really want is that, when the boolean 1and2 is changing state (in my try_out_boolean.vi corrected version that I join here), that initiates the change of colours of the leds corresponding to leader 1 and leader 2, i.e., I have an order of enlightening of "leader 1" and "leader 2" led and the change of colour is initiated by the change in state of the boolean "1and2".

 

Perhaps it is possible to do something simpler ythat the case structure corresponding to the changes of colours after each state change but I am still searching.

 

Anyway, thank you for your help, I am gonna learn more about "number to array" and "array to number" functions.

0 Kudos
Message 5 of 6
(4,431 Views)

I forgot to join the vi...

0 Kudos
Message 6 of 6
(4,427 Views)