03-31-2009 12:01 PM
OK. If you have about 10 digits per data line the total time to transmit all 21 lines would be around 0.3-0.4 seconds, provided the instrument does not pause between lines. Then you have more than half a second with nothing coming in. Here is how I would handle something like this:
1. Put empty string into shift register. Set timeout counter to zero (also in a shift register).
2. Read all available bytes with a timeout of 0.1 s. Append bytes read to string.
3. Did Read timeout?
If timeout then increment counter, else go to 2.
4. If counter >=3, then exit loop, else go to 2.
Then put string into Spreadsheet String to Array to get 21 element array. If the data contains non-numeric characters, set the datatype of the array to string.
This would work even if the strings are almost twice as long as what I estimated above. The timeout and count can be adjusted to meet the specifics of your system.
Lynn
03-31-2009 12:13 PM
03-31-2009 12:24 PM
You should get a timeout error. I do not know what the error code is, but you can find out by test easily enough.
To handle the error, wire the error out to logic to handle that error. This will override the automatic error handling for that VI.
Lynn
03-31-2009 09:33 PM