LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"False" statement in case does not occur in case

Hi,
I've used the basic serial read/write to get some data from a microcontroller.
I had to modify the VI a bit, so I can check to see if the data I receive is either one specific value, or any other value.

My problem is that only the "true"-case occurs. If i receive anything else but '1', nothing happens.
Why does not the "false"-statement occur?

Regards,
Cato
0 Kudos
Message 1 of 10
(3,569 Views)

The false case occurs.Smiley Wink

Just that when a false condition occurs, you are writing a false boolean value to the false indicator( in the false case). Hence the 'Not OK' LED does not glow

And you are not resetting the True case indicator to false (so the 'OK' LED remains 'ON' once it goes on)

Look at modifications in attached VI



Message Edited by devchander on 03-12-2008 06:04 AM
Message 2 of 10
(3,563 Views)

An Additional information.

Since you seem to be comparing floating numbers, read this link and proceed as suggested

Message 3 of 10
(3,559 Views)
That was perfect, thanks! Smiley Wink
0 Kudos
Message 4 of 10
(3,557 Views)

Simpler still, you don't need the case structure since the 2 cases have essentially identical code.



Message Edited by Ravens Fan on 03-12-2008 11:01 PM
Message 5 of 10
(3,524 Views)

I had a hunch that I was overlooking some simpler solution Smiley Very Happy

Good one, Ravens Smiley Happy

Message 6 of 10
(3,518 Views)
Dev,
 
The LLB I downloaded from the link you specified does not open in LV 8.5. Smiley Sad
 
What could be the problem? Smiley Surprised
- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 7 of 10
(3,511 Views)


Ravens Fan wrote:

Simpler still, you don't need the case structure since the 2 cases have essentially identical code.


Even simpler: delete the "NOT OK" indicator and color the FALSE state of the OK indicator RED. Since you only have 2 possible states, it seems a waste to use two indicators. One LED is enough to handle all possibilities. 😉
Message 8 of 10
(3,503 Views)

Oh,

that LLB was written in LabVIEW 5.0

And those vi's cannot be opened in LabVIEW 8.5

I have put a note to the author of the KB Article, to update theLLB to a more compatible version

Meanwhile, here is the same LLB in LabVIEW 8.0

Sorry for the inconvenience Smiley Happy

 

 

 

Download All
Message 9 of 10
(3,502 Views)

Even simpler: delete the "NOT OK" indicator and color the FALSE state of the OK indicator RED. Since you only have 2 possible states, it seems a waste to use two indicators. One LED is enough to handle all possibilities
And ofcourse, have Boolean Text for indicator as 'OK', 'Not OK'

Message Edited by devchander on 03-13-2008 01:55 AM
Message 10 of 10
(3,500 Views)