Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

use serial pump labview back send

Hi.


I have a Cole Parmer pump, which accepts serial commands over DB-9 RS-232 (Manual attached as "ColePalmer-MasterFlex LS 7551-00 P3.pdf"). I have connected it to a laptop via a USB/Serial adaptor and I'm trying to send commands to it via MAX>>VISA Test Panel, or any other text interface for that matter. I can't communicate with it, except for one command.


Here's what I know/have done:

1- The manual specifies all the connection specifics: baud rate=4800 bps, 7 data bits, 1 stop bit, "one odd parity". "The serial data format is full duplex"

2- The manual provides a detailed description of a start up sequence.

3 - "Normal start up would consist of turning on all the satellite units first and then the control computer". This is not what I do (I don't want to restart my computer everytime I want to restart my work!) . I turn the pump on (keep it on), and then connect the RS-232 cable.

3 - "Each satellite will enable its receive and transmit buffers and activate its RTS line. The control computer would then send the enquire <ENQ> command in response to the active RTS line". Here satellite means a pump. I can send the <ENQ> command (ASCII 05, or CTRL+E in a text interface), and I receive "\x02P?0\r", which is the expected response. I do this in the VISA Test panel by writing "\05" to the port and reading the result. "\x02" is the "start of text" <STX> character and the response shows the kind of satellite at hand (here it's a 600 rpm pump).

4 - "The control computer would then send back <STX> Pnn<CR> with nn being a number starting with 01 for the first satellite and incrementing for each satellite up to 25 maximum". This is where it fails: I try sending "\02P01\r" in VISA Test panel and I don't get anything (well, I get "0xBFFF0015" Timeout expired before operation completed).

5 - The pump is supposed to perform other tasks after this point and take certain actions, but since I don't get there, I didn't report it (it's outlined in the attached manual).


I have had the same results either with the VISA Test panel, or using the "Basic Serial Write and Read.vi" provided with LabView (attached file Basic Serial Write and Read.vi). I have also attached a serial session capture of the above sequence (more or less) as 0406 capture.txt. I tried reading only 50 bytes to avoid a Timeout using the default 1024 read length. I have also tried the flow control options NONE and CTS/RTS, with no positive results.

The manual states that "Before a pump drive can be controlled, it must first be numbered. If any command is issued before this is done, the satellite will not respond.". So I guess that's why I had no luck with any of the other commands (like the one in the captured comm session).

 

The USB/Serial cable was a UPnP cable, but I installed its drivers, too. I take that the initial communication with the pump verifies that (1) the cable is ok (2) the port and the pump can hear each other. I have already contacted the manufacturer and waiting for their response. They don't have any LabView drivers (as far as ni.com can tell me). The pump is already set to remote mode.

 

It should be pretty obvious from above that I have zero LabView (or instrumentation and seril communications) experience and this was supposed to be my "intro to LabView"! I already searched the forums but it seems ost issues are realted to COM port recognition, cable problems or device-specific.

 

I would highly appreciate any feedback/tips/links to further reading, etc.

 

Cheers

Ali

 

0 Kudos
Message 1 of 8
(6,200 Views)
Using a VISA Test Panel is the way to go here. What should the response time of the pump be for the command that failed? In the I/O Settings tab in the VISA Test Panel, you can change the timeout value. You may want to consider increasing this value if there is a chance the pump does not have sufficient time to respond before that timeout value is reached. 
 
Since you can communicate with the device, it does not seem that this is a driver issue. Hence, as you have done, seeking further assistance with the pump manufacturer is probably the most valuable path forward.
0 Kudos
Message 2 of 8
(6,157 Views)
There is absolutely no indication that you are communicating to the device. There is nothing in MAX that confirms anything except that there is a com port. A write to a serial instrument will seldom produce an error, even with the instrument disconnected.
0 Kudos
Message 3 of 8
(6,149 Views)
I take back what I said. Your first read in the capture actually has data. The timeout is caused by expecting the wrong termination character. The default is a line feed and the instrument sends a carriage return. You need to change the default.
0 Kudos
Message 4 of 8
(6,142 Views)

Thank you all for the responses.

 

I found the solution myself, and it was much simpler than what I thought: The pump had to be in LOCAL mode, not remote. That's it! It wasn't explicitly mentioned in the manual (as far as I saw), so maybe that's a tip for future users. The remote mode is for analog control (voltage/current) via a different interface. It responds to text interfaces (Termite/PUTTY/...) now. Next step would be LabView.

 

Cheers

0 Kudos
Message 5 of 8
(6,134 Views)

Hi there, did you ever get your pump driver working?  If so would you be willing to share your driver with others?

0 Kudos
Message 6 of 8
(4,364 Views)

Hi,

 

I did get it to work, although I didn't write a proper driver. I just made up a set of simple sub-vi's that do all the actions the pump can do. What each vi does is simply take input (speed, start/stop, initialize, direction, etc.), generate a text string corresponding to that action and send it out to the serial interface. The VISA channels are openned up initially in the main program and so the sub-vi's take the VISA info from there.

 

I wanted to upload all that and the final pressure control program I made, but since I work for a company, I was told that I can't do it (IP/legal barriers!). Sorry!

 

I don't know what use you have in mind for the program, but if you want it to control anything, don't forget about the lag from serial commands. I was using the pump to control liquid flow, reading pressure values from a sensor and adapting the speed to keep the pressure constant. The way my (primitive) program worked, it introduced a huge amount of lag-time in the control loop, meaning that if the pressure spiked, the pump's response would be too slow to prevent overpressuring. I think it's because of the VISA interface. If I were doing it again, I would use the pump's analog interface.

 

Good luck!

0 Kudos
Message 7 of 8
(4,338 Views)

IP violations could get someone fired in blink of an eye 😞 If you are trying to save time by not having to build everything from scratch to control this pump, I'd recommend using a package on Tools Network called AutoSerial that speeds development up. If you have your pump commands ready, just plug them into this thing and avoid having to deal with low-level read/write: http://sine.ni.com/nips/cds/view/p/lang/en/nid/214248

One of my coleagues who is a beginner developer likes it since it helped him just try something on Putty and replicate it with this thing quickly. It looks like you are a pro in LabVIEW, so I'm pretty sure you can do everything that this package does too if you spend couple of hours.

Certified LabVIEW Architect (CLA), LabVIEW 2015.
0 Kudos
Message 8 of 8
(4,292 Views)