Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA read/write woes with Harvard 33 Syringe Pump apparatus; RS-232

Hello!

 

I'm having trouble having my Labview 2011 communicate with a Harvard 33 Syringe pump. I'll list any/all information I think is salient, but I have relatively little Labview experience, so it may be that I'm not cognizant of the actual problem. I appreciate your help!

 

For reference, I'm using a set of VI's that the Harvard company sent me; their "Basic Program - Write and Read.vi" is included in the attached .rar file, along with the User Manual for the Harvard 33 pump. VISA 5.3 and NI Serial 3.9.1 drivers are also installed. 

 

I'm interfacing the pump with the computer via a USB/RS-232 converter and with the pump via an ethernet-jack type cord. The Windows Device Manager and MAX both recognize the existence of the device. Serial Settings like the BAUD rate, data bits, stop bits, parity, and flow control are all identical between what the Device Manager and MAX report. I can only set the Pump Address and the BAUD rate on the pump itself. 

 

Attempting to communicate with the pump in any manner yields a slew of errors: 

 

1) VI: After selecting the proper VISA resource name, attempting to run the Basic Read/Write program yields a "(Hex 0xBFFF0015) Timeout expired before operation completed" error that consistently points to the last VISA Read function in the Syringe Pump Read 2.vi

 

2) MAX: In Input/Output, hitting "Read Status Byte" yields an "(Hex 0xBFFF003A) Unable to start operation because setup is invalid (due to attributes being set to an inconsistent state)" error. "Write" operations go through with no error, but do nothing to the pump. "Query" and "Read" operations result in the same "(Hex 0xBFFF0015) Timeout expired before operation completed" error as in 1). 

 

Flow Control is off; I also have tried Termination Character enabled and disabled, with the same errors. The Harvard 33 appears to take a carriage return as the termination character, but I haven't had any success in utilizing MAX to send those through to the pump, if that indeed is the problem. 

 

Frankly, I'm at somewhat of a loss, and it's all overwhelming because I'm afraid I don't know how to troubleshoot the connection issue itself. 

Download All
0 Kudos
Message 1 of 3
(4,087 Views)

Hi

I had a problem with the wires in the jackplug when I soldered them to a 9pin subD connector. Easy to break.

But are you sure you have the correct send receive wiring.

 

I rewrote their vi's a bit but have them not available at the moment. Try to swap pin 2/3 with a null modem cable.

 

Another possibility is a misbehaving usb-serial adapter, Is this one normally working with other hardware?

 

 

greetings from the Netherlands
0 Kudos
Message 2 of 3
(4,081 Views)

First of all, neither device manager or MAX is recognizing the pump. All that they recognize is the USB-RS232 adapter that you have. Not a thing will change if you disconnect the pump itself. Second, NI-Serial is only for NI serial devices so unless that is the converter you are using, you might as well uninstall it. Third, reading status bytes is silly. You don't have a GPIB interface with status bytes.

 

The VI Send Command is appending a carriage return to each write so you don't need to do anything in the code to modify that. In MAX, you have to append a \r to every command. My guess is that your settings of the termination character changed just the read termination.

 

The example VI is poorly written and I would suggest you do all of your basic debug in MAX or with a terminal emulation program such as Hyperterminal. I would also recomend that you make sure the wiring of your custom cable is correct. It looks like a smaller telco jack and not an ethernet RJ-45. Also make sure you are plugged into port 1.

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