From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview 8 with GPIB-RS232 to control serial instrument

I have Labview 8.2 running a custom optical instrument using GPIB (Agilent 34970A) and serial (Sutter Lambda 10-2 filter wheel).  I built the Labview code from certified drivers.  I now need to move the serial instrumet to GPIB (or possibly ethernet) to allow it to be integrated into a calibration setup at NIST (Labview code communicating via ethernet).  I can use a GPIB-ENET to control the Agilent 34970.  However, I'm having issues getting the Sutter device to work when connecting through a newly purhased NI GPIB-RS232 (configured to the serial setup of the Sutter and running in mode D).  The GPIB-RS232 GPIB side is connected to a PCI-GPIB card in the PC (the Agilent is connected to the same GPIB interface on a separate address).  The Sutter responds to the first byte sent (0xee) that commands it to use serial rather than parallel (front panel display "parallel" changes to "serial").  The Labview code fails after that when using GPIB (via the GPIB-RS232) but runs fine over COM1.  The Sutter controller responds to single byte commands sent via serial and echos the byte over serial after the command finishes.

 

Agilent is on GPIB address 9 and the GPIB-RS232 is on GPIB address 6.

 

Can someone suggest how to debug or otherwise solve the problem?  I'm a bit of a Labview novice.

 

Thanks,

 

Stuart

 

Note - I have code written in C to control another Sutter (same model) connected to an older NI GPIB-232 box.  That code runs well under Solaris and works with the Sutter and 34970A connected to the GPIB-ENET that connects to the Solaris 10 (SPARC) box.  That code recompiled on Windows works to communicate with both the Sutter and 34970 that I'm having issues with using Labview and GPIB so I know the hardware (GPIB-RS232, Sutter Lambda 10-2, Agilent 34970A, PC (fully updated XP), and PCI-GPIB in the PC) works.

0 Kudos
Message 1 of 4
(3,773 Views)

Stuart,

 

A great way to troubleshoot your serial or gpib communication would be to use NI-SPY to see what exactly is being sent over your communication busses.  NI-Spy is installed with the VISA driver, and should be on your computer at Start » All Programs » National Instruments » NI Spy.

 

For this issue though, when you say that the LabVIEW code fails after the first byte is sent, does the program stop or throw an error?

 

Eric K

0 Kudos
Message 2 of 4
(3,743 Views)

The error message (in a dialog box with a red X) I get is:

 

Error -1073807339 occurred at VISA Read in su10x Configure Shutter.vi->Sutter_test.vi

and

VISA:  (Hex 0xBFFF0015) Timeout expired before operation completed.

 

I guess I'm confused about how to convert the error number (quite large) to text explaining what happened.

 

Thanks for the tip about NI Spy.  It apparently shows that the gpib read after sending a command to open

a shutter fails (it works over serial directly and fails with over GPIB with the GPIB-RS232). The red line

in the spy capture (I don't know how to cut and paste all of it - I can highlight only one line):

 

> 9.  VISA Read ("GPIB0::6::INSTR", 100)
> Process ID: 0x00001030         Thread ID: 0x00000CE0
> Start Time: 16:31:30.247       Call Duration 00:00:10.001
> Status: 0xBFFF0015 (VI_ERROR_TMO)
 

So it appears that the byte from the Sutter controller doesn't make it to the computer GPIB interface.

Directly connected to COM1 the byte makes it back in response to the read (no time out) and the

program continues on.  It also works using an ethernet to serial (digi terminal server with a virtual

com port (RealPort)) adapter using COM9.

 

I still don't know how to approach fixing this.

 

Thanks for the help,

 

Stuart

 

 

 

0 Kudos
Message 3 of 4
(3,732 Views)

You should be comparing the VISA Write with the converter and with a direct serial connection. Many times the reason you get a read timeout is because the instrument does not get the correct command. See if the termination character is being sent correctly.

 

You could have simply attached the NI-Spy file. No need to cut and paste.

0 Kudos
Message 4 of 4
(3,721 Views)