LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to obtain data from true case structure which is in a for loop and discard the data in false case structure .

HI All
I have a problem.It will be very kind of you, If you pleople can help me. I have a FOR loop and inside this loop i have a case structure. I am checking some condition and if this condition is true i obtain calculate someting inside true case structure and then i write that thing into a measurement file. Now the problem is i do not want to write anyting in the measurement file which is coming from false case. I am attaching a file to explain my problem. In the attached file there is for loop running for 100 number of times and each time it check for the condition if i is equal to i+i and this will hapen just one time that is when i=0. So in my measurement file i want just 1 data which comes out of true case and not 100 data value which is coming in this problem.This is because i have to attach somthing to the wire for false case also.  In simple words i want to write data to the measurement file which is coming from true case and not the data which is coming from false case of the case structure in a for loop or while loop. Thanks to all in advance.
Regards
Chauhan
0 Kudos
Message 1 of 5
(2,942 Views)
You could just tuck the "write measure file.vi" into the case statement.  That would call it only when you wanted to write, and not call it when you didn't.

Just an idea,
~milq
0 Kudos
Message 2 of 5
(2,934 Views)

If you autoindex at the output tunnel, you get as many elements as you have iterations.

If you only want to add selected elements to the array, you need to built it in a shift register as e.g. in the attached image (the other case (default) just has the array wired across and does not add anything).

Message Edited by altenbach on 03-27-2007 10:45 AM

0 Kudos
Message 3 of 5
(2,930 Views)
Thanks a lot for your reply friends. It solved my problem. Thanks again.
Chauhan
0 Kudos
Message 5 of 5
(2,900 Views)