04-26-2007 01:55 PM - edited 04-26-2007 01:55 PM
Hi everyone,
I need to read data from serial interface and write it to a text file. I’m using the VISA SERIAL READ inside a FOR loop, but I have to acquire data only in certain iterations (multiples of 5).
My problem is the case structure. I’m using a case structure to test the iteration number to execute the VISA READ VI and generate an array. How could I avoid the missing assignment to tunnel error? Because I don’t need to write any data at all during false case...
True case

False case: missing assignment to tunnel error

Thanks in advance,
Klein
Message Edited by Klein on 04-26-2007 01:58 PM
04-26-2007 02:09 PM
04-26-2007 02:18 PM
TigerB,
I tried this option, but it doesn't work. Because it create an empty line in my text file on every false case...
04-26-2007 02:25 PM - edited 04-26-2007 02:25 PM
The use default will not work. It will append empty rows in the false case.
You can use a shift register and pass the value through the false case.
Message Edited by Dennis Knutson on 04-26-2007 01:26 PM
04-26-2007 02:31 PM
04-26-2007 06:35 PM
Dennis,
Your solution works great. Again! Thanks a lot.
######################################
Matt,
Your first advice doesn't works with my code, because there's more code that I need to run inside the FOR loop and read serial data only on multiples iterations...
Second advice: "Some fancy work with reshape and index and build array should also work in this case". What I understood is to use case structure and insert empty lines inside the array. After all, I need to manipulate the array to remove these lines. Did I get it?
Third advice is: "Replace the autoindex with a shift register (fastest if you can preallocate the array, and just use replace array subset)". Is this solution different from Dennis's solution? I didn't understand this recommendation: just use replace array subset.
Thanks a lot, Matt.
Klein.
04-26-2007 07:52 PM
04-26-2007 09:05 PM
Ok, Matt.
I will take a look at your "global solution program" to verify the best solution
.
It really seems that Replace program is the fastest and the Build Array is the slowest.. I'm going to test in my code.
I'd like to thank you for your great help, Matt!
Klein