*** How to use Microvision ROV Bluetooth Barcode Scanner ***

By default the ROV scanner (in this case a MS2200-BT) buffers all scanned bar codes internally. 
The receiver (e.g. your PC or smartphone) is required to confirm each received bar code to delete 
it from the ROV's memory. If such a confirmation is missing the ROV scanner sends the same bar 
code over and over.

The ROV scanner appends a 4 digit serialization number to each scanned bar-code. This serialization 
number is sent (along with the barcode data) to the receiver. The receiving device is required to 
acknowledge the bar-code by sending back the serialization number along with an appended ACK 
character (hex 06) to the ROV scanner.


*** Use a Microvision ROV Scanner With TWedge ***


TWedge is a software solution for reading data from RS232, USB (via virtual serial ports), TCP/IP 
and Bluetooth devices. The built-in scripting capabilities enable you to process the received data 
(e.g. send the data to any application by simulating keystrokes) or to implement the confirmation 
scenario outlined above.

Use this JavaScript snippet for the OnData section in the script editor of TWedge (you may also 
download the TWI).

*** TWedge OnData Script for Microvision ROV MS2200-BT ***

var myData;
var SerializationNumber;

myData = DATA.replace (/\x02/g, "");        // remove {STX}
myData = myData.replace (/\x0D\x0A/g, "");  // remove {CRLF}

// Microvision's documentation says the following:
//
// The serialization number are represented by the last four digits of the bar code.
// Send the serialization number with an ACK (hex 06) character to the
// scanner to acknowledge and delete the bar code. If the scanner has bar
// codes buffered then it sends the first stored bar code, deletes that
// bar code after it is acknowledged, and then sends the next stored bar
// code. This process continues until all bar codes have been sent.
SerializationNumber = Right (myData, 4);
WriteToDevice (SerializationNumber + "\x06", 500);  

// Prepare the read data to simulate keystrokes (remove Serialization Number)
myData = Left (myData, myData.length - 4);

SendKeyStrokes(myData.replace (/\x00/g, " "));
SendKeyStrokes("{ENTER}");