ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to use error line through loop?

Hi,
I am trying to control the flow of my program using error lines. As shown in the attached pic, I want to do my sampling subVI say 3 times then move to the next location, sample 3 times there and move, etc. I couldn't figure out how to iterate over the sampling VI multiple times using a for or while loop, because the error out at the tunnel out of the loop becomes an array of error lines and I get a type mismatch when I try to wire to the move subVI. I tried array-to-cluster and then trying to separate out the error line from the last loop iteration from which to continue the flow of the program, but no success.

So, I think I can do it inelegantly with sequences and sequence locals but I'd like to expand this program into a snake traverse (i.e. measure points across 1 row, up one, back across the row, up one, etc.). Is there a better way than sequences?

Hope that was clear,
William.
0 Kudos
Message 1 of 3
(3,629 Views)
Hi,

Use shift regsiters in your loops, that way only the last error is comming out and from iteration to iteration you always have the previous occurence and not the first.
Check annex.

Hope this helps,
Paulo.

PS. don't post bmp's... use a compressed format instead.
Message 2 of 3
(3,621 Views)
The elegant way to pass the error cluster through a loop is to use a shift register. Right click on the exit point of the loop and select "Replace with Shift Register". You'll then have to click on the point where the error cluster enters the loop to complete the shift register. If you're using an older version of LabVIEW, then just do it manually by selecting Add Shift Register and rewiring. With a shift register, if there is an error generated, it will be passed to the next iteration of the loop. You should also know that you can turn off the autoindiexing feature of a for loop. Just right click on the point it exits and select Disable Indexing. Another basic thing is that if you only want a single element of an array, use Index Array to get a specific element.

And please, in the future, don't attach a bmp file. They take too long to download. Paint supports saving jpeg files.

Message Edited by Dennis Knutson on 06-03-2005 09:18 AM

Message 3 of 3
(3,622 Views)