Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Recieving only one line from Serial Write.vi

I've got the particle counter to turn on and off, but now I've run into a new problem. It seems that I only get one line of data from Serial Write subvi. I've found that if I set number of bytes to be read to be 82 it will consistantly read the first line. However, if I give it a mulitpule of that number, I don't get mulitpule lines. I get a line of data somewhere in the set. I've tried extending the length of time to time out, but that didn't seem to matter. Thanks much in advance.
0 Kudos
Message 1 of 2
(3,006 Views)
I can't open your VI (I have version 6.0.2), but think I can take a stab at this problem. The read VIs read characters until they see a termination character. Then they return the value. It doesn't matter how many lines are in the buffer, only the characters before the termination character will be returned.
What you might want to do is put in a loop that reads a line, checks to see if there are still characters in the buffer and if so, read another line (use concatenate to add to your existing line). Use a shift register in the loop to keep the string. The loop terminates if there are no characters in the buffer. Use the Bytes at Serial Port.VI to check for number to read.

I have included my VISA serial read here. I hope this helps.
0 Kudos
Message 2 of 2
(3,006 Views)