11-19-2012 02:46 AM
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.
11-19-2012 02:50 AM
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,
11-21-2012 06:54 AM
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?
11-21-2012 07:08 AM
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 !
11-21-2012 07:56 AM
please suggest some example vi with jki state machine or knowledge base or tutorial. how to use it?
11-21-2012 09:24 AM
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".
11-26-2012 12:43 PM
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/
11-29-2012 05:32 AM
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.
11-29-2012 05:57 AM
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.
11-30-2012 03:55 AM
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.