LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA problem when setting serial read buffer on MAC?

Hello,

I have the following rather strange problem with serial communication on a Macintosh:

1. I wrote a program using the simple serial VIs provided in LabVIEW and write and receive amounts of data up to about 25000 bytes. The serial buffers are both set to 32000 bytes. If I wait long enough everything works perfect (this was just a test VI for reference)
2. I wrote the same program using VISA calls, I initialize the port exactly the same (or so I think), set and flush both read and write buffers. Then I send the data, which seems to work, except that I have to increase the general time out of the VISA session (which is already odd as it should just be sent to the buffer). However the read oper
ation allways fails. It seems that no matter how long I wait after the write operation the buffer only contains 63 bytes, where is the rest going (from the program described above and the reaction of the instrument I know that everything is sent!)? What I read is the echo of what is sent plus one extra byte, it seems that those 63 bytes are the first 63 that are sent, the buffer is thus not overwritten as I would expect if the buffersize was to small.

If anyone could shed some light on this problem I would be very greatfull.

Best regards
Koen
0 Kudos
Message 1 of 2
(2,261 Views)
I haven't tried this yet but I had the same problem as you. This was
pasted from an earlier response from a post I made a month ago.

>There are 2 things to try here:
>1) Set the serial input end mode attribute to 0. The
>attribute/property name is either "ASRL End In" or "Serial End Mode
>for Reads".
>2) Use the "VISA Set I/O Buffer Size" function in the VISA Interface
>Specific subpalette. This will let you set the receive and/or
>transmit buffer size.

>LabVIEW VISA Software Dude...


Koen wrote:

> Hello,
>
> I have the following rather strange problem with serial communication
> on a Macintosh:
>
> 1. I wrote a program using the simple serial VIs provided in LabVIEW
> and write and receive amounts of data up to about 25000 bytes. The
> serial buffers are bo
th set to 32000 bytes. If I wait long enough
> everything works perfect (this was just a test VI for reference)
> 2. I wrote the same program using VISA calls, I initialize the port
> exactly the same (or so I think), set and flush both read and write
> buffers. Then I send the data, which seems to work, except that I have
> to increase the general time out of the VISA session (which is already
> odd as it should just be sent to the buffer). However the read
> operation allways fails. It seems that no matter how long I wait after
> the write operation the buffer only contains 63 bytes, where is the
> rest going (from the program described above and the reaction of the
> instrument I know that everything is sent!)? What I read is the echo
> of what is sent plus one extra byte, it seems that those 63 bytes are
> the first 63 that are sent, the buffer is thus not overwritten as I
> would expect if the buffersize was to small.
>
> If anyone could shed some light on this problem I would be
very
> greatfull.
>
> Best regards
> Koen
0 Kudos
Message 2 of 2
(2,261 Views)