Zebra Plastic Card Printers.

Zebra Plastic Card Printers come in a variety of styles and price ranges, including single-sided printers, dual sided printers, and security printers

Healthy Solutions for Healthcare.

The healthcare industry benefits from barcoding. Barcoding enhances patient safety and operational efficiency.

Seagull Scientific Products

Seagull Scientific BarTender is an industry-leading label design and barcode software. Seagull Scientific also develops true Windows printer drivers for bar code and thermal printers.

MC 9190G

The Ability To Satisfy Your Company Software Requirements.

Wireless Broadband

The unrivalled Motorola portfolio of Point-to-Point (PTP), Point-to-Multipoint (PMP), and Mesh Wide Area Network (MWAN), WLAN and VoWLAN solutions make governments, enterprises, and service providers more agile by helping them deploy voice, video, and data applications right where they need them.

Showing posts with label TWedge Scripts. Show all posts
Showing posts with label TWedge Scripts. Show all posts

Tuesday, 24 April 2012

How to use Microvision ROV Bluetooth Barcode Scanner

Dealing with a Microvision ROV barcode scanner can be quite tricky. Of course, the device is scanning bar-codes immediately. But the data is sent in a special format and requires a confirmation by the receiver. That's the reason for this blog entry.

By default the ROV scanner (in our 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.

Now let's demonstrate how to configure TEC-IT's software wedge TWedge to work with a Microvision 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}");

Give it a try!

Download and check out the software wedge TWedge for free. The finished configuration file (TWI file) for this blog post is available here.

Comments and suggestions regarding this article are welcome. Please feel free to contact us via MSN or email if you are facing any problems.

Update

The post How to use a Microvision ROV bar-code scanner with Android explains how to configure the scanner to work without serial numbers, buffering or special protocol requirements.

About TEC-IT

WWW.TEC-IT.COM
TEC-IT Datenverarbeitung GmbH provides high quality software in the areas of bar-coding, barcode extensions for ERP systems, label and form printing, reporting and automated data acquisition. TEC-IT products are available for all major platforms, thus customers benefit from complete and versatile software solutions for all possible requirements. The company is located in Austria / Europe and can be reached via www.tec-it.com.
All trademarks are the property of their respective owners.

Monday, 9 November 2009

Reading RFID Tags with TWedge


TEC-IT's data acquisition software TWedge allows an easy implementation of RFID controller protocols. TWedge can be adjusted to communicate with RFID controllers in a bi-directional way. Reading and processing tag identifiers is as easy as reading/writing tag data!

The following TWedge script can be used to read RFID Tag IDs from EMS Datalogic RFID Controllers (utilizing the ABx Fast Protocol).

The following script performs the following functions:
1) Query the RFID controller by pressing the hotkey

2) When data is received test it for a valid response

3) Display data in MessageBox

Try it yourself - Download the software wedge for free! Keep in mind: V2.3 or higher is required!

Global Helper Functions

HEX Conversion

function encodeHex(input) {
hexOutput = "";
for (i=0; i < input.length; i++) {
hexOutput = hexOutput + ' ' + Dec2Hex(input.charCodeAt(i));
}
return hexOutput;
}

function encodeDec(input) {
decOutput = "";
for (i=0; i < input.length; i++) {
decOutput = decOutput + ' ' + input.charCodeAt(i);
}
return decOutput;
}

function Dec2Hex(Decimal) {
var hexChars = "0123456789ABCDEF";
var a = Decimal % 16;
var b = (Decimal - a)/16;
hex = "" + hexChars.charAt(b) + hexChars.charAt(a);
return hex;
}

Test for TAG ID

function IsRFIDTagID (data)
{
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13
// 02 02 00 09 0F E0 04 01 00 35 7F 5E 19 03

return data.length >= 14
&& data.charCodeAt(0) == 2
&& data.charCodeAt(1) == 2
&& data.charCodeAt(4) == 15;
}

Test for TAG Response

function IsRFIDReadResponse(data)
{
// 0 1 2 3 4 5 6 7 8 9 10
// 02 02 00 06 05 31 32 33 34 35 03

return data.length >= 6
&& data.charCodeAt(0) == 2
&& data.charCodeAt(1) == 2
&& data.charCodeAt(4) == 5;
}

Send RFID READ Request

var escZero = "\\0";
var escBack = "\\\\\\\\";

function SendRFIDReadRequest ()
{
var request;
// read 5 Bytes from address 1 with timeout 2000 msec
// 02 02 00 07 05 00 01 00 05 07 D0 03

//request = String.fromCharCode ( 2, 2, 0, 7, 5, 0, 1, 0, 5, 7, 208, 3 );
request = "\x02\x02" + escZero + "\x07"
+ "\x05" + escZero + "\x01" + escZero + "\x05"
+ "\x07\xD0\x03";

// MessageBox ('WriteToDevice: ' + request);
WriteToDevice (request, 2000);

}

Get RFID Response Data

function GetRFIDDataFromResponse ( data )
{
// 0 1 2 3 4 5 6 7 8 9
// 02 02 00 06 05 31 32 33 34 35 03
var len;
var out = "";
if (data.length >= 5)
{
len = data.charCodeAt(2) * 256 + data.charCodeAt(3) - 1;
for (i=0; i< len; i++)
{
out = out + String.fromCharCode(data.charCodeAt(5 + i));
}

//MessageBox ('Len: ' + len + ', ' + out);
return out;
}
return null;
}

OnData Script

if ( IsRFIDTagID (DATA) )
{
SendRFIDReadRequest ();
}
if ( IsRFIDReadResponse (DATA) )
{
MessageBox (encodeHex(DATA) + ' (' + DATA.length + ' Bytes)');
MessageBox ('Nutzdaten: ' + GetRFIDDataFromResponse (DATA));
}

HotKey Script

SendRFIDReadRequest ();

Monday, 12 October 2009

Bluetooth Wedge Software


Want to capture data from Bluetooth devices? Then consider the software wegde TWedge. The latest version of TWedge supports direct Bluetooth connections - without virtual COM ports!

Just select the Bluetooth device of interest in the Interface dialog or enter the Bluetooth address directly (see screenshot). The software wedge TWedge connects to the device automatically and captures all data reliable.

What is the great advantage of direct Bluetooth support? The answer is easy - interrupted Bluetooth connections (e.g. because your bar code scanner is out of range) will be reconnected automatically.

Check out the new version TWedge V2.2: Download the Bluetooth Software Wedge.

Tuesday, 26 May 2009

Using a Software Wedge with Citrix XenApp

The Requirement:

Recently a customer of TEC-IT reported some troubles when using the software wedge TWedge on a tablet PC (running XP-based Windows Embedded) in combination with Citrix XenApp v11.0.0.x.
The customer was looking for a solution to connect a Bluetooth barcode scanner (from Intermec) with a legacy database application. Scanned data should be transferred to an input field followed by a TAB key. The database application in question is hosted by an ASP and provided to the tablet PC via XenApp from Citrix.

The Problem:

The initial problem was that the scanned barcode data was not reliable transferred to the database application - scanned data was not transferred completely.

The Solution:

The clipboard-functionality of TWedge solved the problem. Instead of simulating single keystrokes based on the scanned data the barcode value is copied into the clipboard and then pasted to the Citrix client. Thereafter a TAB key is simulated. One very important point in this approach is to use some short delays between the single commands. These delays are required to allow Windows and Citrix messaging to work correctly. Here is the OnData() script of TWedge:
CopyToClipboard (DATA);         // copy barcode data into the clipboard
Sleep (50); // allow clipboard value to settle
SendKeyStrokes (CTRL, "V"); // paste the clipboard to Citrix
Sleep (50); // wait until pasted
SendKeyStrokes ("{TAB}"); // press the TAB key
Sleep (20); // wait until TAB was processed
Hope this helps other customers too!

Wednesday, 20 May 2009

How to Suppress Duplicate Barcodes or RFID Tags with the Software Wedge?

The Problem:

Maybe you are familiar with this scenario: You are connecting a barcode scanner, an electronic scale or an RFID reader to your computer. When capturing data it turns out that the device is sending identical values multiple times. This happens if the user scans a barcode repeatedly, a scale sends the weight of the item periodically or if a RFID reader reports the value of a RFID tag at regular intervals.

The Solution:

TWedge provides a very flexible and elegant solution to this problem. The software wedge can be customized to suppress multiple, identical values easily: Just save the last data value received from the device and compare it with the current one. Forward the device data to target application only if these values are not identical. Here is the script:

The Software Wedge Script:

OnStart() is the perfect place to initialize the last received data value (sLastData) with a null value. OnStart is executed when device communication is initialized (e.g. the serial port was opened):
// This script is executed whenever communication is started.
// Use it to perform one-time initializations like opening a file or a database connection.
// message informaing the user what this sample is good for
MessageBox("This script demonstrates how to suppress duplicate data packets from a device.\n\nSometimes devices like barcode scanners or RFID controllers are sending the same data packet multiple times. This very useful feature just forwards unique values to the target application.");
sLastData = null; // initialize with a value which is never received from a device
nDuplicates = 0; // set the number of duplicates to 0

OnData() is executed whenever device data is received. Compare the current data value (stored in DATA) with the last one (sLastData). In this example keystrokes are only simulated if these two values are not identical:

// Check if the current device data is identical to the last one
if (DATA != sLastData)
{
SendKeyStrokes(DATA); // not identical: simulate keystrokes
sLastData = DATA; // set the last value to the current one
nDuplicates = 0; // increment the duplicate counter (for info only)
}
else
{
nDuplicates++; // duplicate received, just display an info-message
NotifyInfo ("Duplicate data received. The value " + DATA + " was suppressed " + nDuplicates + " times");
}

More information as well as the script explained in this post will be available soon on www.tec-it.com.