0

I have to get pressure informations from the Vacom VAX controller. In the manual is an example to get the pressure of channel 2. You can download it on the homepage of Vacom. The example doesn't work with pyserial in python.

I have downloaded the Vacom VVD.exe, a little demonstation programm. It works. So i know the baudrate of the controller and i see the pressure of channel 2.

import serial.tools.list_ports as serial_ports
from serial import Serial


ports = serial_ports.comports()
for each in ports:
    if each.manufacturer[:12] == 'VACOM Vakuum':
        ser = Serial(port=each.device, baudrate=19200, timeout=1, bytesize=8, parity='N', stopbits=1)
        print(each)

command='A5500000200802000000000000000000000000000000357A'
ser.write(command.encode())
print(ser.readline())

#answer:
#COM3 - VaX Serial Port (COM3)
#b''

I want to get the pressure but i get nothing and i don't know how to convert the command. Is there an other choice than encode() or what is the mistake? Thank you for your help!

smartini
  • 3
  • 3

1 Answers1

0

I cannot give you a complete answer (I don't have any of those pressure controllers and I've never used this protocol), but this might take you onto the right path.

This VVD.exe software seems to be sending this frame on the port:

0a30313a32383a20a550000002000000000000000000000000000000000099ab

Maybe you can try it and see what happens. At first glance it makes no sense to me, at least it's nothing like what it should be according to the manual.

screenshot sniffing on the serial port

To get it I've used this procedure. You might want to give it a try with the device connected and try to figure out what is really going on.

EDIT: Rereading my answer I just joined the dots, there seems to be a prefix to the frame:

    {0a30313a32383a20}{a550000002000000000000000000000000000000000099ab}

I don't know if that prefix is being discarded by the instrument. I did not see any mention to something like that in the manual, but it did not read it carefully.

Marcos G.
  • 3,371
  • 2
  • 8
  • 16
  • thank you very much. the binascii.unhexlify() works well! one more problem: how do i get to know that the payload '5A FB AA 3B 02 00 00 00 00 00 00 00 00 00 00 00' equals a pressure 5,217952E-3 mbar? – smartini Aug 12 '19 at 14:42
  • thank you for your time you downloaded the VVD.exe and tested it :-) – smartini Aug 12 '19 at 14:43
  • i got it! i had to switch the order of the hex code – smartini Aug 12 '19 at 15:22