Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with serial buffer on MAC still stands!!

This is a follow up on a previous question "Problem setting serial buffer size on MAC?"

To describe the problem:
I initialize the serial port with the following settings[57600 baud, 8 data bits, 1 stop bit, no handshaking, no flow control, serial end in to none, serial end out to none, termination character enable to false] I then set both buffers using "VISA set I/O buffer size", flush both buffers and writes 25000 bytes to the port. The program waits and after that should read 25001 bytes (the echo plus one extra byte). However it does not matter how long I wait the buffer only contains 63 bytes before the read operation and is empty after that. The information that is read is the first 63 bytes
of the echo and not the last 62 plus the extra byte, the buffer does not seem to be overwritten. Furthermore the EXACT same VI works on a windows platform.
I also tested the serial communication on the mac by writing a similar program that uses the old serial communication VIs. This program works, that is if I wait long enough before the read ALL data is read back as it should be.
I can not find any explanation why
1) the VISA program works on windows but not on MAC
2) the other test program works on MAC but not the VISA program

(these are all just test VIs but they have been extensively checked, double checked, triple checked...)
HELP!!!!
0 Kudos
Message 1 of 4
(3,807 Views)
Koen writes:

> This is a follow up on a previous question "Problem setting serial
> buffer size on MAC?"
>
> To describe the problem:
> I initialize the serial port with the following settings[57600 baud, 8
> data bits, 1 stop bit, no handshaking, no flow control, serial end in
> to none, serial end out to none, termination character enable to
> false] I then set both buffers using "VISA set I/O buffer size", flush
> both buffers and writes 25000 bytes to the port. The program waits and
> after that should read 25001 bytes (the echo plus one extra byte).

Above 9600 Baud I'd not trust a RS232 connection (PC) without
handshaking. The MAC serial ports use RS48X which works in
differential mode and is much less error prone.

Do you use the right data flow?
VISA Open
Property Node
Write
Read
Close
Error Handler

> However it does not matter how long I wait the buffer only contains 63
> bytes before the read operation and is empty after that. The
> information that is read is the first 63 bytes of the echo and not the
> last 62 plus the extra byte, the buffer does not seem to be
> overwritten. Furthermore the EXACT same VI works on a windows
> platform.

What's the serial hardware FIFO size on MAC's?

> I also tested the serial communication on the mac by writing a similar
> program that uses the old serial communication VIs. This program
> works, that is if I wait long enough before the read ALL data is read
> back as it should be.
> I can not find any explanation why
> 1) the VISA program works on windows but not on MAC
> 2) the other test program works on MAC but not the VISA program

A VISA Bug with these huge message sizes and timeouts?

25 kB @ approx. 5kB/sec = 5 sec. I'd check (and correct) the VISA
timeout setting.

Did you update your VISA versions?

What funny device gulps 25 kB of data and returns it (+1
byte?). Without adding the byte it's a simple wire loop (2 to 3). Some
people say RS232 was numbered this way for a reason: Solder 2 to 3 and
3 to 2 🙂

Just some thoughts

Johannes Niess
0 Kudos
Message 2 of 4
(3,807 Views)
Koen:

It turns out there was a problem with the call to VISA Set Buffer Size on the Macintosh. There is a patch on ftp://ftp.ni.com/support/visa/drivers/mac/2.5/patch/ that should fix the problem. Just copy it into the Extensions folder. It will now correctly handle receive buffer sizes up to 32KB. This will not work with versions of NI-VISA earlier than 2.5.

Dan Mondrik
Senior Software Engineer, NI-VISA
National Instruments
0 Kudos
Message 3 of 4
(3,807 Views)
Anyone coming across this thread nowadays should go to the http://www.ni.com/support pages, click the Drivers and Updates link, and see the Current Software Versions. As of my posting, we have NI-VISA 3.0 for Mac OS 8, 9, and X.

Regards,
Geneva L.
GPIB/Serial Product Support Engineer
National Instruments
http://www.ni.com
0 Kudos
Message 4 of 4
(3,807 Views)