Retrieve Data Script (R-WDLOAD.MAC | R-WRLOAD.MAC)
![]()
This script is used to collect data from an external data collection source (typically a mobile data collector and scanner) and pass the scanned information back to the Warehouse Manager.
Description
Typically the collection process will involve the following steps:
1. Calling the software associated with the data scanner to retrieve the scanned information.
You
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.
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. |
|
Barcode |
The barcode that is to be scanned. |
|
Qty |
The quantity to scan. |
The
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-WDLOAD.MAC is used in dispatch mode, and the script file R-WRLOAD.MAC in receive mode.
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 retrieval 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
* Retrieve scanned data from Symbol P460 Mobile Scanner
* & Data Collector
* (c) 2002, COBS
Declare cFile Type Character
Declare PdaFile Type Character
Declare cPdaPath Type Character
Declare NewPdaFile Type Character
Declare cAlias Type Character
Declare aFields Type Array
Declare aTypes Type Array
Declare aLengths Type Array
Declare aDecimals Type Array
aFields := {"ORDER", "ITEM", "QTY"}
aTypes := {"C" , "C" , "C" }
aLengths := { 9, 40, 7 }
aDecimals := { 0, 0, 0 }
cPdaPath := "C:\MCL\PHASER\LinkLite_2.11"
PdaFile := cPdaPath + "\DATA\DATA.TXT"
NewPdaFile := PathCompany() + "DATA" + UserNumber() + ".TXT"
***** make sure application is running
If FindWindow(,"MCL-Link Lite For Phaser") == 0
If RunApplication(cPdaPath + "\MclLink.Exe", 5) < 32
Echo("Error launching MclLink.Exe")
Return ""
Endif
Endif
***** wait
Echo("Please send the file from the scanner to your PC and click on OK")
***** import
If isFile(PdaFile)
EraseFile(NewPdaFile)
CopyFile(PdaFile, NewPdaFile)
If ! isFile(NewPdaFile)
Echo("Scanned file could not be copied")
Return("")
Endif
cFile := "QPIM" + UserNumber()
If .Not. CreateTable(cFile, aFields, aTypes, aLengths, aDecimals)
Return ""
Endif
OpenTable(cFile)
If ! ImportAscII(cFile, NewPdaFile, "|")
***** failure
CloseTable()
EraseFile(PathCompany() + cFile + ".DBF")
EraseFile(NewPdaFile)
Return ""
Else
***** success
CloseTable()
EraseFile(NewPdaFile)
EraseFile(PdaFile)
Return PathCompany() + cFile + ".DBF"
Endif
Else
Echo("Data file not found")
Return ""
Endif
Return ""
____________________________
Related Topics:
Warehouse Manager Data Collection Scripts
![]() |