LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Jumping to specific case structure states

Hi, 

I am an absolute beginner in Labview. I am stuck in this task: I want to jump to a specific case based on a number comparison result. I did the initial googling and forum read, but sadly did not find what I am after. I am sure its really simple, but this time I need that extra help. Thank you in advance.

Download All
0 Kudos
Message 1 of 8
(682 Views)

Hi,

 

I guess this is what you're looking for :

 

PinguX_0-1715955248441.png

 

It is in "Comparaison" Palette on the block diagram.

Message 2 of 8
(678 Views)

PinguX is correct, but keep in mind that simply putting another case structure inside the first one will work too.  This is also more versatile and will allow for more complex logic.

 

However, avoid the temptation to nest too many case structures as it can become a nightmare to debug and upgrade.  That is the time to start using proper programming architectures like a State Machine.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
Message 3 of 8
(669 Views)

Well, that "case inside case" approach was suggest to me by some AI tools, but I can not understand how do I wire it. I may be asking for some extra, but could you please provide a very simple drawing or edit my existing VI so that I can understand the idea behind it? In any case, thank you for your help.

0 Kudos
Message 4 of 8
(656 Views)

Here you go.

PinguX_0-1715958252190.png

 

As NIquist said, stay moderate with that.

 

0 Kudos
Message 5 of 8
(632 Views)

thank you again

 

0 Kudos
Message 6 of 8
(628 Views)

This is all I was talking about.

NIquist_0-1715959084303.png

It looks like you have bigger problems though.  You should not have an event structure with no timeout in one of your cases.  It will lock the code while it waits for "Speti" to be pressed.  

NIquist_1-1715959367043.png

It's generally best to just describe exactly what you need to code and then let us help you do it right.

 

EDIT:  Forgot to attach the code.

 

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 7 of 8
(622 Views)

As a rule of thumb, equal comparisons with orange data are extremely dangerous.

Message 8 of 8
(603 Views)