i got a laboratory power supply HCS 3202 (http://bit.ly/1e2wYE8 , http://bit.ly/11m9De) with a usb port. You can control and read the Volt and other thinks.
I am trying to get this done with my RPI and Python. The commands for the power supply are Strings.
I tried to use the pySerial Modul but it didint work. I cant write anything and the only thing the power supply sends is b'' or b''x00
(my code:
Code: Select all
>>>import serial
>>>ser = serial.Serial('/dev/ttyUSB0', 115200, timeout=2)
>>>ser.isOpen()
True
>>>ser.write("GMOD")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.2/dist-packages/serial/serialposix.py",
n = os.write(self.fd, d)
TypeError: 'str' does not support the buffer interface
>>>
>>>ser.read()
b''
>>>
- GMOD is a command from the power supply. It returns a number.
- i am not sure about the baud read. you cant find any informations about the baud rate if my device
Does someone know a console where i can test my commands at the pi, or even better, what i am doing wrong.