QuickStart Guide to: Barcode Scanning on Aceeca Meazura PalmOS Scanners
The Aceeca Meazura MEZ1000 RDA (Ruggedized Digital Assistant) from Aceeca International is an ultra-rugged waterproof PalmOS handheld designed for use in tough environments. It is available with an optional barcode scanner module, with both CCD and laser scanner options. This QuickStart Guide shows you how to add Aceeca Meazura barcode scanning support to your Satellite Forms application, quickly and easily.
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 Aceeca Meazura scanners should only take about 15 minutes.
In order to control the Aceeca barcode scanner, we'll utilize the Aceeca IDVERIFI Bar Code Scanner plugin extension that is included with Satellite Forms. The extension works with either the Aceeca BCS1 CCD scanner module, or the BCS2 laser scanner module. We'll demonstrte the BCS2 laser scanner module here.
Okay, let's build an Aceeca Scan Test sample application step by step:
Step 1. Start a new project in Satellite Forms MobileApp designer, and select the default Palm 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 Aceeca 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 a button control named btnScan, labeled SCAN, using the Bold 12 font, and enlarge it to make it easy to tap on with a finger. Leave the button action set to No Action for now. Your form should look like this:
Step 2. The next step is to add the Aceeca IDVERIFI Bar Code Scanner plugin extension to our project. Click on the Manage Extensions toolbar icon which looks like this: A list of available extensions is displayed. Select the Aceeca IDVERIFI Bar Code Scanner at the top of the list, then click OK:
Step 3. The Aceeca scanner extension is a plugin script extension, and is not a custom SFX control. It adds functions to the Satellite Forms script language, but does not appear as a visual control on the form. We'll use these script functions to enable/disable the scanner, make certain hardware buttons trigger the scan, and obtain the data from the scanner when it reads a barcode.
Now we're getting into the thick of things: here is where we decide how to trigger the barcode scan, and what to do when a barcode is scanned. Let's begin by enabling the scanner in the AfterOpen event of the form. We also want to configure the extension so that the barcode scanner is triggered when the center button on the Aceeca Meazura is pressed. Click on the Scripts tab of the Workspace Palette, at the bottom left of the MobileApp Designer window. Click on the + symbol by Form 1 in the list to expand it to show all of the event and control scripts on the form. Select the AfterOpen event script, and the script editor window will appear. Type in this AfterOpen script:
'confirm that we are running on an Aceeca device
if IDV_IsAceecaUnit() = True then
'specify the BCS2 laser scanner module
IDV_SetBCSType(2)
'use center button as scan trigger
IDV_SetScanTrigger(1, 516)
'enable the scanner now
IDV_EnableScanner()
else
edBarcode = "NOT an Aceeca scanner!"
'hide the Scan button
btnScan.visible = false
endif
Your screen should look like this:
Now, let's make sure that we disable the scanner when we close the form. Select the BeforeClose script from the list, and type in this script:
'confirm that we are running on an Aceeca device
if IDV_IsAceecaUnit() = True then
'disable the scanner now
IDV_DisableScanner()
endif
Step 4. Okay, now we need to add some script code to do something with the barcode data when it is scanned. The Aceeca Meazura scanner signals that a barcode has been scanned by posting a special MzBarcodeReceived virtual keypress (ASCII code decimal 7424) into the device's key queue. We need to monitor the key queue looking for that special virtual key, and grab the barcode data string when we see it. 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 OnKey event script code to type in (feel free to copy & paste right from this QuickStart Guide article):
Dim Asckey, Virtkey, Modkey
GetLastKey(AscKey, VirtKey, ModKey)
'watch for the MzBarcodeReceived virtual key (7424)
if AscKey = 7424 then
'get the barcode data
edBarcode = IDV_GetScan(5)
if edBarcode = "" then
'barcode read failed
edBarcode = "NO READ"
'play failure tone
Tone(400, 600, 64)
else
'play good read tone
Tone(3800, 100, 64)
endif
endif
Step 5. Okay, that is the bulk of it, but we still need to make the onscreen SCAN button trigger the scan, in addition to the center hardware button. Select the SCAN button on the form, and click on Edit Action in the control properties. Select Run Script from the list of actions, then click on Edit Script. Type in this script to trigger the scan when the button is tapped:
'trigger the barcode scan
IDV_Trigger(True)
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 Aceeca Scan Test, like this:
Click OK, and then save your project. Name it Aceeca 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, use the Handheld > Download App & Tables menu option (or press the F5 hotkey) to send the application to your Aceeca Meazura device. Connect the Meazura to the cradle or sync cable, and start the hotsync from the handheld. Assuming you've already installed the Satellite Forms SDK runtime engine on the Meazura, your application will be sent to the device during the hotsync. Launch the SatForms SDK app on the handheld, select Aceeca Scan Test from the list, and you are ready to scan.
Point the scanner at a nearby barcode, press center hardware button or the onscreen SCAN button on the Meazura, and the scanner should read the barcode and play a confirmation beep. Here's a sample screenshot from the Meazura after reading a barcode:
Congratulations! You've just learned how to scan barcodes on the Aceeca Meazura scanner 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\IDVERIFI Barcode\IDVScanTest.sfa
Keywords: Aceeca, Meazura, MEZ1000, IDVERIFI, barcode, scanner, quickstart, PalmOS
KB ID: 10080
Updated: 2007-11-30
Satellite Forms KnowledgeBase Online