Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Read stops after 22 byte

I use VISA Read to read values from a scales. The scales sends 22 signs a time, terminated by a carriage return and a line feed. It is set to "send always".
Although I did the following things, I only receive 22 bytes in the read buffer of VISA Read.
The things I did:
- Configuring the Port in frame 1 of a stacked sequence
- Immediately after configuration I put a property node where I set the Termination Character Enable attribute to false and the Serial End Mode for Reads to None
_ Write \1BP\n tp the Serial port (= send always)
- VISA Close
- in frame 2 of the stacked sequence I put VISA Read (in a while loop), the "bytes at port"-count is at the entrance of VISA Read
If I put a probe on the bytes to read (which are the bytes at port) I can see that this number increases and I only read 22 bytes at each loop iteration

What else is to do? Is the carriage return in the signal from the scales the problem? What do I do to read it without stopping?
0 Kudos
Message 1 of 8
(3,690 Views)
Hi,

please, attach your sample vi
regards,
Thomas Sandrisser
0 Kudos
Message 2 of 8
(3,668 Views)
Hi, here is my sample vi.

Regards, Zane
0 Kudos
Message 3 of 8
(3,660 Views)
hi,

start the ni example finder and choose the search tab - write "visa" and choose the "advanced serial write and read.vi".
in this exmaple you should see the principle for visa read


regards,
Thomas Sandrisser
0 Kudos
Message 4 of 8
(3,651 Views)
Hi,
thanks for your help.
But the way it is done in the example that is exactly the way I did it. I mean I set the "Enable Termination character" to false (have a look at the sample I attached). I thought that visa would transfer all signs then. Nevertheless it does not work. Do you have another idea?

Kind regards, Yane
0 Kudos
Message 5 of 8
(3,640 Views)
hi,

another thing in your vi is:
you close the visa session in first sequence (take it at the end of your program) and you havn't a set i/o buffer size function...

regards,
Thomas
0 Kudos
Message 6 of 8
(3,634 Views)
Hello
thanks for your ideas.
I wrote an extra programm only for COM1 and only with the VISA Read task and tried two things:
1. When I close the VISA session immediatelly after configuring the port, disableing the termination character, setting the buffer size and writing the print order the following thing happens (this is the way a had done until now): I can read only 22 byte, independent of how many bytes are at the port (bytes at port = byte count at the VISA Read vi, but this number is not equal to the read count at the VISA Read vi)
2. I closed the VISA session after the while loop with the Read vi, I mean at the end of the programm. In this case I can read as many bytes as exist at the port. (bytes at port = byte count at the VISA Read vi = return count at the VISA Read vi) But the string I read are squares and strange signs but no numbers.
I'll attache the 2. version.

Zane
0 Kudos
Message 7 of 8
(3,605 Views)
For those who are interested:

a possible solution can be found here:

http://forums.ni.com/ni/board/message?board.id=140&message.id=9744
0 Kudos
Message 8 of 8
(3,558 Views)