Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

RS-232 communication error

Hi,

I am driving our laser power supply (SpectraPhysics, model Topaz T10-106c) in LabVIEW with thye RS-232 protocol, and experiencing weird. errors.

The RS-232 is set to 9600 baud, no parity, 8 databits, 1 stop bit and RTS flow control, asynchronously.
The RS-232 command set of the power supply is very straightforward: '?P;' for power info, '?C;' for current info, etc. Setting those parameters is done by saying 'Pxxxx', or 'C1:167' etc.

This all works fine for a while, but then all of a sudden the laser skips one answer to an information request, and then lags behind until I reboot the laser power supply...

The weird thing is that there is no data still waiting ('no bytes at serial port'). When I give the same info
rmation request repeatedly, then clear the queue by reading all the bytes at the serial bus, and then give another info request, the thing will first respond to the latter request, and then the new one.

I always wait for about 100 ms for my data, and my timeout is set to 1500 ms (typical data sizes are 10 bytes), so I doubt that the data is not yet ready.

I really hope someone recognizes the problem, or even better: knows a solution....

Thanks in advance.

Joost van Mameren
0 Kudos
Message 1 of 3
(4,804 Views)
Hello-

It may help to verify the connections the null modem cable. Be sure that RTS and CTS are connected to each side (Pin 7 connects to pin 8 on the other side).

A couple utilities that will help in troubleshooting. If VISA serial is being used, NI-Spy can give some fundamental information. Also, sysinternals.com has a portmon utility that can monitor all serial calls in the OS. Maybe keeping a close eye on the serial port can demystify this issue.

Randy Solomonson
Application Enginner
National Instruments
0 Kudos
Message 2 of 3
(4,804 Views)
Have you monitored (measured) both the signals you send and receive? You could use an easy terminal program or a digital oscilloscope (or LabVIEW on a free RS-232 port). First check your own system before blaming the instrument.
0 Kudos
Message 3 of 3
(4,804 Views)