In Series with a Keyboard (Keyboard Wedge)

<< Click to Display Table of Contents >>

Navigation:  Installation and Starting SpecView > Instrument Definition/Detection > Using a Barcode Scanner with SpecView >

In Series with a Keyboard (Keyboard Wedge)

Previous pageReturn to chapter overviewNext page

 

This method allows the barcode scanner to act exactly like a keyboard.

 

1.User must ensure SpecView is ready to accept keyboard entry.
2.Unsolicited keyboard entry

 

 

1. User must ensure SpecView is ready to accept keyboard entry.

 

This can be done by touching the variable or it can be linked to a button.

 

For example, the operator clicks a 'Ready to Start' button which turns on a SpecView Boolean that is watched by the Strategy Controller. The actions:

GDW Control: Swap to another GDW

Parameters: Alter Value Interactively

set SpecView ready to receive keyboard or barcode input.

 

2. Unsolicited keyboard entry

 

Alternatively, SpecView can support unsolicited keyboard entry from version 3.1.228 onwards by utilizing specific user variables.

 

Create a unique Text User Variable and name it 'SVKeyboardEntryText'. The variable name is case sensitive. For additional help with creating user variables, please read Variables List - SpecView Variables.

 

Click and drag SVKeyboardEntryText on to the screen and enter Runtime Mode.

 

If the scanner is correctly connected to the PC and is functioning as expected, then SVKeyboardEntryText should display scanned values without any further user input.

 

However, when scanning multiple barcodes, SVKeyboardEntryText will append the most recent barcode to the end of the previous barcode as seen below.

 

SVKeyboardEntryText_1barcode

Figure 1: SVKeyboardEntryText after scanning one barcode.

 

SVKeyboardEntryText_2barcode

Figure 2: SVKeyboardEntryText after scanning two barcodes.

 

To prevent this from occurring, Strategy Controller must be utilized to implement a few lines of strategy.For information on programming strategy controller, please read Programming the Strategy Controller.

 

One possible way to circumvent the barcodes appending to the end is described below.

 

Create a Boolean User Variable. The variable must be named 'SVKeyboardEntryEnter'. The name is case sensitive.

 

If a <CR> (Carriage Return) or <LF> (Line Feed) character is scanned, then SVKeyboardEntryEnter will automatically be turned ON.

The end of a barcode usually contains a <CR> or <LF>.

SVKeyboardEntryEnter will not automatically turn OFF.

 

Create another Text User Variable. This variable can be named appropriately, for example 'LastBarcode'.

 

Create a strategy event that looks for SVKeyboardEntryEnter to turn ON. The actions for that strategy event should be as follows:

 

Turn SVKeyboardEntryEnter OFF
Copy SVKeyboardEntryText to LastBarcode
Clear SVKeyboardEntryText by setting SVKeyboardEntryText to be a blank string.

 

If done correctly, when a barcode is scanned, SVKeyboardEntryEnter will be ON. SVKeyboardEntryText will be populated.

 

Strategy controller will notice that SVKeyboardEntryEnter is ON and turn SVKeyboardEntryEnter OFF, copy SVKeyboardEntryText to LastBarcode, and clear SVKeyboardEntryText.

 

At the end ...

 

LastBarcode will contain the value of the previously scanned barcode.

 

SVKeyboardEntryText will be blank and ready to be populated with the next barcode.

 

SVKeyboardEntryEnter will be OFF and will be ready to turn ON once a new barcode is scanned.

 

There is a video on SpecView's YouTube channel that illustrates this here: 7010 SpecView Version 3 Barcode scanner to Keyboard