Barcode Scanning on Symbol Windows Mobile/PocketPC Scanners
Previous Topic  Next Topic 

QuickStart Guide to: Barcode Scanning on Symbol Windows Mobile/PocketPC Scanners

Symbol Technologies, now a unit of Motorola, manufactures numerous models of Windows Mobile/PocketPC rugged handhelds with integrated barcode scanning capability.  The Symbol SPT family of PalmOS powered barcode scanners is no longer manufactured, but there are thousands of those units in use and the same techniques shown here can also be applied to those SPT scanners.  This QuickStart Guide shows you how to add Symbol Windows Mobile/PocketPC barcode scanning support to your Satellite Forms application, quickly and easily.

NOTE: The Symbol Integrated Scanner control demonstrated in this article can also be used to control barcode scanning on the Janam XM60 Windows CE scanner.  Janam Technologies implemented their barcode scanning system so that it is compatible with the Symbol scanning functions, and therefore the same Symbol Integrated Scanner control in Satellite Forms can be used to control scanning on both Symbol scanners and Janam scanners!

This QuickStart Guide contains plenty of screenshots to guide you through the process step by step, but don't let the length of this article scare you: the entire process of building the barcode scanning test application for the Symbol PocketPC scanners should only take about 15 minutes.

In order to control the Symbol barcode scanner, we'll utilize the Symbol Integrated Scanner control extension that is included with Satellite Forms.  This control is available for the Symbol devices on both the Windows Mobile/PocketPC and PalmOS platforms, so you can create cross platform barcode scanning applications with ease.  This guide demonstrates the Windows Mobile/PocketPC platform only.

Okay, let's build a Symbol Scan Test sample application step by step:

Step 1. Start a new project in Satellite Forms MobileApp designer, and select the PocketPC platform target.  A default form named Form 1 will be created, ready for you to add controls to.  Click in the middle of the form, so that the Control Palette Toolbar becomes active.  Let's add a form Title control, with the title text set to Symbol Scan Test.  Next add a text control with the label Barcode: and below that add an edit control named edBarcode that stretches across the width of the form.  Let's add another text control below that labeled Type:, and below that another edit control named edBarcodeType that also stretches across the form.  Your form should look like this:

Step 2. The next step is to add the Symbol Integrated Scanner control extension to our project.  Click on the Manage Extensions toolbar icon which looks like this:   A list of available extensions is displayed.  Do not select the one at the top named Bar Code Reader.  Scroll down to the bottom of the list, and select the Symbol Integrated Scanner extension, then click OK:

Step 3. The Symbol Integrated Scanner extension is a custom SFX control, and not just a plugin script extension.  Although it is a custom control, the control is not actually visible to the end user: it is only visible in form design view of MobileApp Designer.  Because it is a custom control, an icon is added to the Control Palette toolbar so that you can click on the icon to add the control to your forms.  The SFX icon looks like this and is added to the right end of the Control Palette toolbar.  If you do not see it, there's a good chance that part of the Control Palette toolbar is simply being cut off because the MobileApp Designer window is not wide enough.  That's easy to solve, we'll just grab the Control palette toolbar "handle" and drag it down to the next line in the MobileApp Designer desktop.  Now we can see all the Control palette toolbar icons, like this:

Okay good, we can see all the toolbar icons now.

So, click on the SFX custom control toolbar icon so that we can add it to our form.  It's possible you might have more than one custom control on a form and they all share the same toolbar icon, so a selection box appears to let you choose the custom control you want, like this:

Click OK to select it, and the control then appears on our form as a little barcode symbol.  Remember, this custom control is not visible to the end user.  Let's move it out of the way so it does not overlap other controls, so your form should now look like this:

The default name that appears for the scanner control is BarCode1, and we'll leave it at that default.  With the scanner control selected, click the Edit Action button in the control properties, and select Run Script from the Action Type droplist.  This is the OnClick script for the scanner control, and this event will be fired when a barcode is scanned.

Step 4. Alright, now we're getting into the thick of things: here is where we decide what to do when a barcode is scanned.  Click on Edit Script and the blank script editor window will open up.  In this script, we are going to use script methods of the scanner control to obtain the barcode data that was scanned and place it into the edBarcode edit control on the form.  Let's display the barcode type into the edBarcodeType control as well, so we can see what kind of barcode was scanned.  We'll play a high pitched confirmation beep to indicate the successful scan, or a low frequency buzz if the scan was not successful.  Here's the script code to type in (feel free to copy & paste right from this QuickStart Guide article):

'the OnClick event is fired when a barcode is scanned

'if a good scan is received then put it into the

'edBarcode edit field elsesound a failure tone

if BarCode1.TermRecd then

       'put barcode into edit control

         edBarcode = BarCode1.GetScan(0)

       'what type of barcode was it

       edBarcodeType = BarCode1.GetType

       'good read tone

       Tone(3800, 150, 64)


       'bad read tone

       Tone(220, 500, 64)


Step 5. Okay, that is the bulk of it, but we need to do a couple more things to make barcode scanning work.  What we need to do is to make sure the device we're running on is really a Symbol barcode scanner, and if so, enable the scanner to be used.  We also need to disable the scanner when we leave the form.  So, in the form AfterOpen event script that gets fired when the form is opened, enable the scanner like this:

'if device is Symbol barcode scanner then

'enable scanner in the AfterOpen event and

'disable scanner in the BeforeClose event

if IsSymbolUnit = True then

       'enable scanning



       'warn user about no scanner

       edBarcode = "Barcode scanner not found"


And in the form BeforeClose event, disable the barcode scanner like this:

'if device is Symbol barcode scanner then

'disable scanner in the BeforeClose event

if IsSymbolUnit = True then

       'disable scanning



That's about it for the barcode scanning stuff.  Let's give the application a name, compile it, and test it out on the handheld.

Step 6. Click on the Edit > Project Properties menu, and give our application the name Symbol Scan Test, like this:

Click OK, and then save your project.  Name it Symbol Scan Test.sfa.

Now, compile the application by pressing the F7 hotkey (Rebuild All).  If the compiler finds any typos, fix them, and then Rebuild All again.  Next, connect the Symbol scanner to the cradle or sync cable, and use the Handheld > Download App & Tables menu option (or press the F5 hotkey) to download the application to your Symbol Windows Mobile/PocketPC scanner device.  Launch the SatForms SDK app on the handheld, select Symbol Scan Test from the list, and you are ready to scan.

Point the scanner at a nearby barcode, press one of the scan buttons on the Symbol unit, and you the scanner should read the barcode and play a confirmation beep.  Here's a sample screenshot from a Symbol MC50 screen:

Congratulations!  You've just learned how to scan barcodes on the Symbol Windows Mobile/PocketPC scanners with Satellite Forms!

There are plenty of additional functions in the scanner control to give you even more detailed control over the scanning process, but you've got the basic scanning function covered just by applying what you learned in the QuickStart Guide above.

Additional Sample Projects:        

       \Satellite Forms 7\Samples\Projects\Symbol Control App\ScannerDemo\SimpleScannerDemo.sfa

       \Satellite Forms 7\Samples\Projects\Symbol Control App\Barcode\SymbolBarcode.sfa

       \Satellite Forms 7\Samples\Projects\Symbol Control App\Function Test\SymbolFunctionTest.sfa

Keywords:      Symbol, barcode, scanner, quickstart, PocketPC, Windows Mobile, MC50, MC70, Janam, XM60

KB ID: 10079 

Updated: 2008-05-27

Satellite Forms KnowledgeBase Online

Satellite Forms Website Home