I have difficulties getting my scanner to beep using the ESC sequences listed in the manual.
I’m using a Quickscan QM2131 BK433 with a BC2030 cradle connected via USB/COM.
I set my scanner to OBEY host commands, as the BEL beep wouldn’t work in IGNORE mode either.
I’d like to send a command to the scanner/cradle to emit the bad read tone. I got it to beep on BEL, but it doesn’t seem to understand ESC sequences.
Here is my device configuration:
config.xml on gist
Here is my C# code:
SerialPort serialPort_ = new SerialPort();
serialPort_.PortName = "COM3";
serialPort_.BaudRate = 9600;
serialPort_.DataBits = 8;
serialPort_.StopBits = StopBits.One;
serialPort_.Handshake = Handshake.RequestToSend;
serialPort_.Parity = Parity.None;
serialPort_.ReadTimeout = 4000;
serialPort_.WriteTimeout = 6000;
serialPort_.Open();
List<byte[]> messages = new List<byte[]>();
// bel, cr "ascii bel beep" WORKS!
messages.Add(new byte[] { 0x07, 0x0d });
// ESC, [, 4, q, cr "bad tx beep" NOPE:
messages.Add(new byte[] { 0x1b, 0x5b, 0x34, 0x71, 0x0d });
// dc2, ESC, [, 4, q, cr "bad tx beep" NOPE:
messages.Add(new byte[] { 0x12, 0x1b, 0x5b, 0x34, 0x71, 0x0d });
foreach (var msg in messages)
{
serialPort_.BaseStream.Write(msg, 0, msg.Length);
System.Threading.Thread.Sleep(200);
}
serialPort_.Close();