LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multi condition looping

I making a program which has multi condition looping.

Please see the attached file and suggest, how can I make the program in Labview? Jump on true has numbers 1, 2,3 4 etc are the Vi conditions

The attached file is only one case, I have n number of cases.

Please suggest which loop structure is the best for such a VI.

0 Kudos
Message 1 of 13
(3,294 Views)

Hi,
I think you should use a StateMachine code.

 

Several options :

 - the classic Labview Statemachine (file new vi=> from template => state machine)

 - Jki state machine (string based), easy to maintain, document... etc. free, and available with VIPM.

 

Best regards,

V-F
0 Kudos
Message 2 of 13
(3,290 Views)

thank you for the suggestion but within one state machine or case o have  to run  several if else  loop. how can i create multiple conditions? for e.g:

case A: a>b then go to case B

              c+a<d then go to case C

             l=m then go to case B

              c=b then to go to case C

Case B:

c+a>d then go to case A

             l>m then go to case C

             a=5 go to case A

Case C: 

     lm =4then go to case B

         5    <a<20go to case A

so on...multiple loops within one case directing to different enum cases of state machine. please suggest which is the best method . or how to create if then else loop within state machine?

0 Kudos
Message 3 of 13
(3,259 Views)

Hi,
with jki, you can define several actions, and macros (which contains actions).
So you can do this with JKI state machine.

Start coding, and post if you have questions !

V-F
0 Kudos
Message 4 of 13
(3,251 Views)

please suggest some example vi with jki state machine or knowledge base or tutorial. how to use it?

0 Kudos
Message 5 of 13
(3,237 Views)

You could do some crazy comparisons like this...  The hidden cases have String constants that contain "Case A", "Case B" and "Case C".  Anything that isn't defined will result in the "Logic Error".

 

Example_VI_BD.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 6 of 13
(3,225 Views)

KRAZE4LV,

 

Here are some links that may be of use to you.

 

JKI State Machine

http://sine.ni.com/nips/cds/view/p/lang/en/nid/209025

 

LabVIEW 2012 Help:  Case Structure

http://zone.ni.com/reference/en-XX/help/371361J-01/glang/case_structure/

Josh B
Applications Engineer
National Instruments
0 Kudos
Message 7 of 13
(3,188 Views)

Thank you for the reply.

The JKI state machine looks little complex. I want some simple looping.

Please see the attached flow chart which is part of my VI.

0 Kudos
Message 8 of 13
(3,155 Views)

You just have to use a standard state machine from the template and the logic in a subvi to determine the next state. This below is just a shell, you will need to add the logic in to it and add states to the type defined control.

state machine.png


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
0 Kudos
Message 9 of 13
(3,145 Views)

Hello,

Thank you for the suggestion.

I have tried to use state machine with the program.

Please suggest for more improvements.

Also I am using RMC 150E tool which is available on the internet.

0 Kudos
Message 10 of 13
(3,107 Views)