07-05-2016 09:03 AM
Hi all,
I am new in this forum and I have a question.
I have a case structure (with 10 cases) and I want only 2 of them to include in a loop.
how can it be done?
thanks.
mosheg.
Solved! Go to Solution.
07-05-2016 09:07 AM
You're going to have to elaborate. A case structure has a selector input for whichever case should be run. All cases will be ignored other than the specific case that is selected when the code is run.
Share what code you've tried so far.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
07-05-2016 09:22 AM
Thanks for the fast respone James.
OK, I'll be more specific.
the first 5 cases are preperations I am doing for a test.
6 and 7 are the actual testing (that is why I need to repeate them with different variables)
8 to 10 - are reporting and returning the system to initial state.
all cases are executed with no exceptions.
I can't loop 6 and than loop 7 (this is something I already did - for other needs) - I need a solution for looping them together.
Regards,
Moshe
07-05-2016 09:28 AM
Please include a Snippet of your code, or attach your VIs, so that we can better assist you. You can control which cases are operated based on your case selector... so I don't see what issue you're having.
"Give me six hours to chop down a tree and I will spend the first four sharpening the axe." - Abraham Lincoln
Here are some free training tools primarily focused on LabVIEW and NI hardware to help get started.
-MyRIO Project Essentials Guide (lots of good simple circuits with links to youtube demonstrations)
Learn NI Training Resource Videos
6 Hour LabVIEW Introduction
Self Paced training for students
Self Paced training beginner to advanced, SSP Required
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
07-05-2016 09:31 AM
Use Proper State Machine, where you can select cases based on your Needs
07-05-2016 09:32 AM
I would suggest you look at the State Machine template and use that, it is a while loop with a case structure inside of it. This way, you can use the State Machine messages define the next state (or "case number").
07-05-2016
10:05 AM
- last edited on
05-06-2025
02:28 PM
by
Content Cleaner
Sounds like what you really need is a State Machine. But without some real code to show what you are trying to do, we are just guessing here.