Search code examples
c#barcode

Send beep signal to Datalogic Barcodescanner in C#


This is my last hope, Datalogic support did not respond... I just want to send a 'Beep' signal to a Datalogic PM9300 wireless scanner in C#. It is connected with RS232 to the PC. The manual says I have to send it like this: [Scanner address] [Delimiter] DC2 MESSAGE

I just want to send an LED signal or beep, like this: ESC [ 6 q ESC [3 q ESC [7 q
(LED on, beep, LED off).

I tried a lot of snippets like:

_serialPort.Write(new byte[] { 27 }, 0, 1);
_serialPort.Write(new byte[] { 91 }, 0, 1);
_serialPort.Write(new byte[] { 51}, 0, 1);
_serialPort.Write(new byte[] { 113}, 0, 1);
_serialPort.Write(new byte[]  {13}, 0, 1);

Etc. Etc. The scanner did not do anything... Input from RSs232 is OK of course.

Have anyone experience with C# + Datalogic scanners? Thank you very much for your help.


Solution

  • Well, your code doesn't look like it is sending the right codes. Have you tried:

    // Send: ESC [ 6 q CR
    _serialPort.Write(new byte[] { 0x1B, 0x5B, 0x36, 0x71, 0x0D }, 0, 5);
    
    // Send: ESC [ 3 q CR
    _serialPort.Write(new byte[] { 0x1B, 0x5B, 0x33, 0x71, 0x0D }, 0, 5);
    
    // Send: ESC [ 7 q CR
    _serialPort.Write(new byte[] { 0x1B, 0x5B, 0x37, 0x71, 0x0D }, 0, 5);