The text of a manual · part 2 of 2
Windows DLL Functions for Developers of TimeWand I and DuraWand Applications (Windows 95/98/NT), pages 7 to 11
Pages 7 to 11 of 11
The original document is the PDF (39 KB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Videx DuraWand Scanner and Videx TimeWand I
Page 7
Application File Format: The format of the application file expected by the InitializeWand function is similar to that expected by the DOS command line utility dload.exe. This is done for compatibility reasons. This file consists of text lines of parameters separated by spaces and terminated with a carriage return and line feed. The menudriven communications software (TW1.EXE or DW.EXE) creates this file automatically and calls it TW1LIST.TXT. The application file has the format: <wand ID><reloadFlag><initialize flag><program><param addr><param length><parameters><cr/lf> where: <wandID> - must be the same ID as sent in the parameter list to the InitializeWand function. <reloadFlag> - 1 or 0 (ignored by DLL) <initialize flag> - 1 or 0 (ignored by DLL) <program> - the symbology file name to be loaded (is checked to be the same as the symPath parameter which is passed to InitializeWand). Like symPath, the program parameter must include the full path, for example: c:\videx\3of9hcy.twp. Long names in the path are acceptable, but spaces in the names will cause communication to fail. <param addr> - must be 2816 <param length> - the number of parameters that will be sent to the wand. If loading a Hierarchy, this number is 19. If loading a Sequence, this number is 44. <parameters> - The remaining parameters control the sequence in which the barcodes will be scanned. For a hierarchy application: The first parameter represents the number of levels used in the hierarchy. For example, if the hierarchy consists of A, B, and C, then the first value would be 3. The 2nd through 17th parameters represent the level characters in the hierarchy. These parameters are the decimal values of the ASCII characters (i.e., the decimal value of the A character is 65). If there is no character, use the value 255 as a placeholder. The alpha characters must be uppercase, as Code 3 of 9 does not support lowercase. The 18th parameter controls the ability to read bar codes outside of the hierarchy after the last level of the hierarchy is read. The value 00 enables this ability and 255 disables it. The 19th parameter controls whether the scanpad is turned on or off. The value 255 enables the scanpad and 00 disables it. For a sequence application: The first parameter, which is the same as in the hierarchy example, is the number of levels used in the sequence. The 2nd through 43rd parameters represent the level characters in the sequence. The 44th parameter controls the ability to have multiple reads of the last level of the hierarchy. The value 00 disables this ability and 255 enables it. For example, to program the wand with a hierarchy to read three levels of A, B, and C, with a wand ID of 1234, a symbology of 3of9hcy.twp, and with outside and scanpad reading enabled, the aplPath application file will contain: 1234 0 0 c:\videx\3of9hcy.twp 2816 19 3 65 66 67 255 255 255 255 255 255 255 255 255 255 255 255 255 00 255<cr><lf>
TimeWand I/DuraWand Windows DLL
7
Page 8
Declaration statements for Visual Basic: Declare Function InitializeWand Lib "DLOAD32.DLL" (ByVal WandID As Long, ByVal symPath As String, ByVal aplPath As String, ByVal ComPortNumber As Long, ByVal initTime As Long, ByVal traceDebug As Long, ByVal IOdebug As Long) As Long Declare Function DownLoadWand Lib "DLOAD32.DLL" (ByVal WandID As Long, ByVal DataFileName As String, ByVal ComPortNumber As Long, ByVal OverWriteData As Long, ByVal MemoryDump As Long, ByVal ClearMemory As Long, ByVal DLtime As Long, ByVal traceDebug As Long, ByVal IOdebug As Long) As Long Declare Function DownLoadWandList Lib "DLOAD32.DLL" (ByVal WandIDList As String, ByVal DataFileName As String, ByVal ComPortNumber As Long, ByVal OverWriteData As Long, ByVal ClearMemory As Long, ByVal DLtime As Long, ByVal traceDebug As Long, ByVal IOdebug As Long) As Long Declare Function SerOpen Lib "DLOAD32.DLL" (ByVal ComPortNumber As Long) As Long Declare Function SerClose Lib "DLOAD32.DLL" (ByVal ComPortNumber As Long) As Long Declare Function SetStatusMode Lib "DLOAD32.DLL" (ByVal statusMode As Long) As Long Declare Sub SetProgress Lib "DLOAD32.DLL" (ByVal userFunction As Long)
TimeWand I/DuraWand Windows DLL
8
Page 9
Sample Function Calls for Visual Basic: To initialize a wand with an ID of 1000 and a hierarchy application, the syntax would be: returnValue = InitializeWand (1000, "c:\videx\3of9hcy.twp", "c:\videx\app.txt", 2, 70, 0, 0) where the file app.txt contains: 1000 0 0 c:\videx\3of9hcy.twp 2816 19 3 67 84 69 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 In this example, the wand is on com port 2, a timeout of 70 seconds is used, and the wand is programmed with a three-level hierarchy application with character values of C, T, and E. To initialize the same wand to read Code 39 barcodes, but with no application, the syntax would be: returnValue = InitializeWand (1000, "c:\videx\3of9kp.twp", "", 2, 70, 0, 0) To download data from this wand, the syntax would be: returnValue = DownLoadWand (1000, "data.bcd", 2, 0, 0, 1, 70, 0, 0) The data from a wand with an ID of 1000 is appended to a file data.bcd. The wand is on com port 2, a timeout of 70 seconds is used, and the wand’s data is cleared after a successful download. To download data from three wands with ID’s of 1000, 2000, and 4000, the syntax would be: returnValue = DownLoadWandList ("wands.txt", "data.bcd", 2, 0, 1, 70, 0, 0) where the file wands.txt contains: 1000 <cr> <lf> 2000 <cr> <lf> 4000 <cr> <lf> The data from these three wands is appended to a file named data.bcd. The wands are on com port 2, a timeout of 70 seconds is used, and the data is cleared from the wands after a successful download.
TimeWand I/DuraWand Windows DLL
9
Page 10
To allow the user to cancel communication, it is necessary to define a callback function. This function will check for an event (for example, clicking on a command button), and then set a flag that will stop a communication in progress. The code to do this in Visual BASIC looks like:
Dim quitFlag as Boolean Private Sub cmdDownloadWand_Click( ) Dim returnValue as Long InitDownload returnValue = DownLoadWand ( 1000, "data.bcd", 2, 0, 0, 1, 70, 0, 0 ) If returnValue < > 0 Then MsgBox "Download Error: " + Str (returnValue) Else MsgBox "Download Successful" End If End Sub Private Sub cmdCancelDownload_Click( ) quitFlag = True End Sub Private Sub InitDownload( ) quitFlag = False SetProgress AddressOf CancelCheck End Sub Public Function CancelCheck ( ByVal dummy1 As Long, ByVal dummy2 As _ Long ) As Long On Error Resume Next DoEvents If Form1.quitFlag Then CancelCheck = 1 Else CancelCheck = 0 End If End Sub
Windows DLL for TimeWand I and DuraWand GCO# 1120 Copyright © 1999 by Videx, Inc. 1105 NE Circle Blvd., Corvallis, OR 97330 USA Phone: (541) 758-0521 Fax: (541) 752-5285 www.videx.com Videx, TimeWand, and DuraWand are registered trademarks of Videx, Inc.
TimeWand I/DuraWand Windows DLL
10
Page 11
TimeWand I/DuraWand Windows DLL
11