I have a datalogic powerscan pm9500 connected through a serial port (COM2) I need to send him a command for turn on LEDs so when I read the correct code it shows the green led and the red for wrong code. Now,this is my question: I found this code for transmit that command with c sharp.
// ----------ORIGINAL NOT WORKING MISSING DC2----------------------------------
// 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);
// ---------POSSIBLE MODIFY 1 TEORICALLY WORKING-----------------------------------
// Send: DC2 ESC [ 6 q CR
_serialPort.Write(new byte[] { 0x12, 0x1B, 0x5B, 0x36, 0x71, 0x0D }, 0, 6);
// Send: DC2 ESC [ 3 q CR
_serialPort.Write(new byte[] { 0x12, 0x1B, 0x5B, 0x33, 0x71, 0x0D }, 0, 6);
// Send: DC2 ESC [ 7 q CR
_serialPort.Write(new byte[] { 0x12, 0x1B, 0x5B, 0x37, 0x71, 0x0D }, 0, 6);
// --------POSSIBLE MODIFY 2 IF IT NOT ACCEPT CR AS CHAR---------------------------
// Send: DC2 ESC [ 6 q ESC [ G
_serialPort.Write(new byte[] { 0x12, 0x1B, 0x5B, 0x36, 0x71, 0x1B, 0x5B, 0X47 }, 0, 8);
// Send: DC2 ESC [ 3 q ESC [ G
_serialPort.Write(new byte[] { 0x12, 0x1B, 0x5B, 0x33, 0x71, 0x1B, 0x5B, 0X47 }, 0, 8);
// Send: DC2 ESC [ 7 q ESC [ G
_serialPort.Write(new byte[] { 0x12, 0x1B, 0x5B, 0x37, 0x71, 0x1B, 0x5B, 0X47 }, 0, 8);
So, I know that i need to add DC2 and CR commands but what is the vbs equivalent of these lines?
What are the correct configurations of the reader?(variable = value)
PARTIAL SOLUTION:
I USED
were: portID is the com2 id macaddr is the mac addr of the scanner vbcr is the integrated vb char for carrage return
this code works and sends the read confirm after a read. but it didn't works if i need to add a command and sends only the read confirmation whitotu any command. someone have other ideas?