LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

case structure with binary number as case

Hi, i wanna to do a case structure with binary as case instead of true and false. I did it in following way.

 

Capture.PNG

The problem that i have now is that

 

10 - available

01 - not available

11 - booked

 

when i reach the not available stage, i wan it jump to the avalaible case instead of booked stage after my sensor is detecting nothing. Can someone help me with better idea? thank you very much.

0 Kudos
Message 1 of 7
(1,444 Views)

I have no idea what you mean.

 

How can it jump except by changing the values of the buttons? What sensor are you talking about? I see nothing which looks like a sensor?

 

Is this a subVI to a largre main VI? How do you use this VI?

 

Do you really want the 00 case to have the same effect as 01 - not available? That is what the default seeting does.

 

Lynn

Message 2 of 7
(1,429 Views)

I think this is simply a case of "I am not familiar enough with LabVIEW to know where everything is."

 

This is really how you should be doing it...

 

Agreed that the exercise doesn't really make sense, but...

 

Hey how do you save a snippet in an earlier version of LV?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 3 of 7
(1,426 Views)

Sorry! the following attach is my car detection project. i have the difficutly when the the car is leaving the parking lot and the indicator exercute back "booking" case. is their any possible way that when the car is leaving the parking lot and i want it exercute the "empty" structure. sorry for the initial post.

0 Kudos
Message 4 of 7
(1,414 Views)

oops

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 7
(1,401 Views)

You can assign multiple values to a single case structure. You have already one ("empty") as default. Isn't that enough?

 

You can do the same code wit less computing effort and less diagram clutter by forming a binary array, converting to number, and set the radix of the selector to binary (see picture)

 

 

Also, why do you need to read and convert the pictures with every iteration fo the loop? Do the files change on disk? It would be more reasonable to read and convert the pictures once outside the loop and use the case structure to select one of the three different blue wires. You could event autoindex over an arrray of file names and create an array of pictures to simplify (see picture).

 

Also notice that "LCD print" occurs in all cases, thus it beongs after the case. Only it's inputs belong inside the case structure. Why are you re-bundling the visa resource on the bottom right? That's not needed. Why are you even constantly closing the VISA resouce?


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
Download All
Message 6 of 7
(1,385 Views)

Thx you for your help sir! i will try it my best! i am just a very beginneer to labview. Thank you for helping me.

0 Kudos
Message 7 of 7
(1,371 Views)