0

I'm trying to send signal to barcodescanner Datalogic PowerScan PM9500

The manual says that to turn on the green LED I need sent ESC[6q ESC[3q ESC[7q message

my code:

import serial

SERIAL_PORT = serial.Serial('COM4', 9600, timeout=0.5)
SERIAL_PORT.write(data=(b'ESC [ 6 q ESC [3 q ESC [7 q\r'))

nothing happens.

Another tries were:


SERIAL_PORT.write(data=(0x1B, 0x5B, 0x36, 0x71, 0x0D))
SERIAL_PORT.write(data=('ESC [ 6 q ESC [3 q ESC [7 q'))

I figured out that if I send "B" to port, the scanner will beep once:

SERIAL_PORT.write("B".encode())

But I still cannot understand how to Turn on the LED.

Maybe somebody has some example or sought how it should work. Or maybe somebody has worked with barcode scanner communications. Any information on what is wrong would be helpful. Thank you in advance.

PS: I do not need fish, I just need fishing rod.

User1010
  • 789
  • 1
  • 6
  • 19
  • The byte sequence that you quote is a 12-byte command. Yet none of the examples that you used are 12 bytes long. If you cannot get your code working, then try using a terminal emulator program to send the commands. – sawdust Dec 03 '20 at 21:49
  • Are you sure you have the correct baudrate? The default is 115200, unless the interface is RS-485. – sawdust Dec 03 '20 at 21:56
  • @sawdust I put the same as was in Port Settings properties, but when I change it to 115200 the result the same - nothing happens. – Kirill Kriachenko Dec 04 '20 at 00:06

0 Answers0