Serial Teams for BrainTree Scientific, Inc. Syringe pump (model bs-8000) rs232

UPDATE: After my commands, serial config and terminator ('\ r') were correct, I got this work on 1 out of 5 computers. This makes me think this is an adapter issue. I plan to call the company to find out about ordering a USB / RJ11 adapter (I used Keyspan USB-> DB9-> RJ11 adapter on my mac)


I read this , but I still can not communicate with this pump. This is a modified python script ( source ),

import time import serial # configure the serial connections (the parameters differs on the device you are connecting to) ser = serial.Serial( port='/dev/tty.USA19H142P1.1', # /dev/tty.KeySerial1 ? baudrate=19200, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS ) if not ser.isOpen(): ser.open() print ser commands = ['dia26.59', 'phn01', 'funrat', 'rat15mm', 'vol0.7', 'dirinf', 'phn02', 'funrat', 'rat7.5mm', 'vol.5', 'dirinf', 'phn03', 'funrat', 'rat15mm', 'vol0.7', 'dirwdr', 'phn04', 'funstp', 'dia26.59', 'phn01', 'funrat', 'rat15mm', 'vol1.0', 'dirinf', 'phn02', 'funrat', 'rat7.5mm', 'vol.5', 'dirinf', 'phn03', 'funrat', 'rat15mm', 'vol1.0', 'dirwdr', 'phn04', 'funstp'] for cmd in commands: print cmd ser.write(cmd + '\r') time.sleep(1) out = '' while ser.inWaiting() > 0: out += ser.read(1) if out != '': print '>>' + out 

tty ports:

 $ ls -lt /dev/tty* | head crw--w---- 1 nathann tty 16, 0 Oct 13 14:13 /dev/ttys000 crw-rw-rw- 1 root wheel 31, 6 Oct 13 14:12 /dev/tty.KeySerial1 crw-rw-rw- 1 root wheel 31, 8 Oct 13 13:52 /dev/tty.USA19H142P1.1 crw-rw-rw- 1 root wheel 2, 0 Oct 13 10:00 /dev/tty crw-rw-rw- 1 root wheel 31, 4 Oct 12 11:34 /dev/tty.Bluetooth-Incoming-Port crw-rw-rw- 1 root wheel 4, 0 Oct 12 11:34 /dev/ttyp0 crw-rw-rw- 1 root wheel 4, 1 Oct 12 11:34 /dev/ttyp1 crw-rw-rw- 1 root wheel 4, 2 Oct 12 11:34 /dev/ttyp2 crw-rw-rw- 1 root wheel 4, 3 Oct 12 11:34 /dev/ttyp3 crw-rw-rw- 1 root wheel 4, 4 Oct 12 11:34 /dev/ttyp4 

I'm not even sure that he sends commands. Do not get any errors or feedback. Nothing happens on the pump and nothing returns (the out line is always empty)

This is my conclusion:

 (sweetcrave) nathann@glitch sweetcrave (master) $ python pumptest.py Serial<id=0x1093af290, open=True>(port='/dev/tty.USA19H142P1.1', baudrate=19200, bytesize=7, parity='O', stopbits=2, timeout=None, xonxoff=False, rtscts=False, dsrdtr=False) dia26.59 >> phn01 funrat rat15mm vol0.7 ^CTraceback (most recent call last): File "pumptest.py", line 28, in <module> time.sleep(1) KeyboardInterrupt 

My ultimate goal:

  • pump settings
  • Three phases are indicated:
  • Phase 1: Press the fluid onto the end of the tube.
  • phase 2: dispensing a fluid at a specific speed and volume
  • phase 3: pull the fluid back
  • the liquid comes back (phase 3) so that it does not drip from the collector, and therefore the object cannot suck it out. So phase 1 is needed to click
  • the fluid returns to the outlet point.
  • volume and speed of distribution can be changed. Use the following formula:
  • rate = volume / sec * 60
  • example: .5 / 4 x 60 (deliver 5 ml in 4 seconds) = 7.5
+5
source share
1 answer

Pumps talk very easily, but if you have a lot of problems, then there is a problem that needs to be fixed.

Before worrying about sending commands to the pumps from your programming code, it is recommended that you check whether the pump is ready to connect to the computer.

From years of experience working with these pumps, I can say that broken cables are a common problem when you experience this level of complexity associated with pumps, number 2 connects them to the correct hole on the back of the pump.

I propose to capture a well-known working application from a third party - like my http://www.SyringePumpPro.com , installing it and using it to confirm that your pump will communicate with a known functional part of the software. If all is well with pumps and cables, SyringePumpPro will detect and display your pump's action in seconds. It will not cost you anything, and it will let you know that the pump, serial adapter and cables are working properly.

Your program ...

I will leave aside the question of whether your tty port, etc., is open, however, if you send to the pumps everything that they will answer - usually with a sequence like

00s? for an unknown team.

Looking at your Python code - I am worried that you are repeating commands twice. The pump only needs these commands to be loaded once and will remember them according to the power cycles.

Assuming that your commands hit the pump, none of them started the pump β€” they load the pump’s memory with what needs to be done, but they don’t actually do it. You need a RUN command to make the pump run what you load.

Pump commands can be loaded into a single boot, and then RUN. Then all this concerns pump and stimulation synchronization in your python code.

This pumping sequence above can be performed in the PPL or pump program language file and loaded once.

Here's an example of PPL files at the back of the pump manual and an example that might interest you is example 2.

He caused a second hand with suction back.

Be that as it may, I made a video about it, which is on youtube. This can really help explain how pumps work, how the pump programming language works, and how to load pump programs.

Good luck.

+3
source

Source: https://habr.com/ru/post/1233657/


All Articles