generate/cbs2.gif Send Data Script (R-WDSEND.MAC | R-WRSEND.MAC)

generate/enh73.jpg


 

This script is used to send data from the Warehouse Manager to an external data collection device, typically a mobile data collector and scanner.

Description

Normally the collection process will involve the following steps:

1. Calling the software associated with the data scanner to retrieve the scanned information.

generate/notepad2.gifYou may use CBS functions such as Shell() or RunApplication() to do this.

2. Once the information is retrieved, it must be converted into a standard CAPITAL DBF file, which the Warehouse Manager will then import. (CAPITAL Business Script comes equipped with various functions to translate ASCII text files into DBF files.)

3. The script returns the path and filename of a DBF file containing three fields. The order number, barcode to scan and quantity to scan.

Field

Purpose

Order

The order number of the purchase order or sales order. E.g., "30110".

Barcode

The bar code that is to be scanned. This can be up to 40 characters wide.

Qty

The quantity to scan, which is required to fulfill the order.

generate/notepad2.gifThe Order and Barcode fields must be character type. The Qty field may be character or numeric type. Also note that the order of the fields within the DBF file is important. The first field must be Order, followed by Barcode and then Qty.

The script file R-WDSEND.MAC is used in dispatch mode, and the script file R-WRSEND.MAC in receive mode.

Entry Values

Variable

Purpose

Filename

The name of the DBF data table that must be translated and sent to the data collection device. (This includes the file extension, which is .DBF.) Within the script, the table may also be referred to as QPExport. For example, QPExport->Order or QPExport->Barcode.

Returns

A character string containing the path and file name. For example, "C:\GETDATA\ITEMLIST.DBF" or "F:\CAPITAL\MYDATA.DBF".

The return of an empty string ("") informs the Warehouse Manager that the send process has failed. Or a return value of FALSE is also acceptable.

You can also launch this script remotely. Consult the topic: Start-up Switch Settings for more information.

Example

The sample script has been developed for the Symbol Phaser 460, accessed via the Windows program MCLLINK.EXE.

R-WRSEND.MAC and R-WDSEND.MAC first check if the Phaser interface application is running. If it is not, they launch the application so that it is ready to process the "Load File" request from the Phaser data collector.

Next, the table created by the Warehouse Manager is sorted to appear in ascending order, as required by the Phaser 460. (This is to allow the Phaser to perform a search once the table is loaded into the Phaser's memory. This step may not be required, if the phaser program is other than the sample Phaser application.)

The Phaser 460 also requires that the data file to be loaded is stored in a fixed length text file. The script copies the content of the sorted table to such file, named ORDERS.DAT.

The name of the file (ORDERS.DAT) is set in the sample Phaser application as required, and the location of that file (the subdirectory \DATA ), is as per the requirement specified in the Phaser documentation. (This is the special directory under the Phaser software (MCLLINK.EXE) installation directory, where this software will exchange input and output files.

The user is then asked by the script to commence loading data into the device, by selecting an appropriate menu option found in the Data Collection Device.

At this point the sample script terminates, and it returns TRUE, as the data was successfully prepared and transferred to the Phaser software.

On return from the script, Warehouse Manager closes and deletes the table used to export the data.

Symbol MclLite.Exe

This application is used to communicate between the PC and Phaser 360 and 460 barcode scanners.

The application assumes that for loading data to the Phaser, the subdirectory \DATA will be used. Files downloaded from the scanner also end up in the same directory with the name DATA.DAT. Files destined for the scanner may have any name as programmed in the phaser application, but must be present in that directory for upload. Please refer to your Phaser scanner manual for specific details.

generate/notepad2.gifThis is the default setting for MCLLITE.EXE.

Phaser 460 application

The Phaser 460 application has built in "Send File" and "Load File" functions. When "Load File" is selected, the Phaser 460 enters communication mode with MCLLINK.EXE and it requests that the ORDERS.DAT file be loaded in its memory. MCLLINK.EXE looks for ORDERS.DAT in its \DATA sub-directory.

The file ORDERS.DAT contains order numbers, barcodes and quantities. It is used by the sample Phaser application as a lookup table. Lookup tables cannot be altered by the Phaser 460 application. As the scanning progresses, a parallel table is built which contains the scanned and validated data for later sending to the PC as DATA.DAT. The sample application verifies all scanned data against the look up table, to ensure that the scanned items are valid.

The Phaser sample application contains the menu item "Send File", which is used to send collected data back to your PC.

* variable FileName declared in the main program

* it is the name of the temporary DBF file.

* the file is open, alias QPEXPORT

* structure of FileName:

* ORDER C 9

* ITEM C 40

* QTY C 7

Declare nCount Type Numeric

Declare cTextRec Type Character

Declare lSuccess Type Logical

Declare cPdaFile Type Character

Declare cPdaPath Type Character

cPdaPath := "C:\MCL\PHASER\LinkLite_2.11"

cPdaFile := PathCompany() + "ORD" + UserNumber() + ".DAT"

lSuccess := FALSE

nCount := 0

****** sort it by order and item

IndexTable("QPEXPORT", "ORDER+ITEM")

QPEXPORT->(GotoTop())

****** create Symbol PDA data file

If ! CreateFile(cPdaFile)

   Return lSuccess

Endif

****** copy records to Symbol file

:Next

If QPEXPORT->(EOF())

   GOTO Done

Endif

cTextRec := Left(QPEXPORT->ORDER, 9) + Left(QPEXPORT->ITEM, 13)

cTextRec := cTextRec + Left(QPEXPORT->QTY, 7) + Chr(13) + Chr(10)

If WriteFile(cPdaFile, cTextRec)

   nCount := nCount + 1

   QPEXPORT->(Skip(1))

   GOTO Next

Endif

:Done

****** cleanup

CloseFile(cPdaFile)

If nCount > 0

   CopyFile(cPdaFile, cPdaPath + "\DATA\ORDERS.DAT")

   EraseFile(cPdaFile)

   If isFile(cPdaPath + "\DATA\ORDERS.DAT")

      lSuccess := TRUE

      If FindWindow(,"MCL-Link Lite For Phaser") == 0

         If RunApplication(cPdaPath + "\MclLink.Exe", 5) < 32

            Echo("Error launching MclLink.Exe")

            Return FALSE

         Endif

      Endif

      Echo("The data for your scanner is ready." + CHR(13) + CHR(10) + 'Connect the scanner and select "Load File" from scanner menu')

   Else

      Echo("Error copying file!")

   Endif

Else

   Echo( "No data found" )

Endif

Return lSuccess

____________________________

Related Topics:

Warehouse Manager Data Collection Scripts

Warehouse Manager Reference



Help Topic Map