CMagLib library
City
Address
Section titled “Address”Returns the Address value in string format (read-only)
Syntax
Address As StringParameters
None
Return Values
Returns the Address value
Returns the City value in string format (read-only)
Syntax
City As StringParameters
None
Return Values
Returns the City value
Returns the Class value in string format (read-only)
Syntax
Class As StringParameters
None
Return Values
Returns the Class value
DateOfBirth
Section titled “DateOfBirth”Returns the DateOfBirth value in string format (read-only)
Syntax
DateOfBirth As StringParameters
None
Return Values
Returns the DateOfBirth value
Endorsements
Section titled “Endorsements”Returns the Endorsements value in string format (read-only)
Syntax
Endorsements As StringParameters
None
Return Values
Returns the Endorsements value
ExpirationDate
Section titled “ExpirationDate”Returns the ExpirationDate value in string format (read-only)
Syntax
ExpirationDate As StringParameters
None
Return Values
Returns the ExpirationDate value
Returns the Eyes value in string format (read-only)
Syntax
Eyes As StringParameters
None
Return Values
Returns the Eyes value
GetRawData
Section titled “GetRawData”Returns the text data from the magnetic reader device without additional processing
Syntax
GetRawData(sData As String) As LongParameters
| Parameter | Description |
|---|---|
| [in] Data |
Return Values
| Value | Description |
|---|---|
| MAG_ERR_NONE | Data retrieved successfully |
| MAG_ERR_CARD_NOT-DETECTED | Buffer is empty |
Returns the Hair value in string format (read-only)
Syntax
Hair As StringParameters
None
Return Values
Returns the Hair value
Height
Section titled “Height”Returns the Height value in string format (read-only)
Syntax
Height As StringParameters
None
Return Values
Returns the Height value
InitLibrary
Section titled “InitLibrary”Scans COM1 – COM16 and searches for the magnetic reader device. After it is found, the reader is initialized and the library loads and is initialized.
Note: This function must be called before calling any other function in the library.
Syntax
InitLibrary(license As String) As LongParameters
| Parameter | Description |
|---|---|
| [in] license | Null-terminated string that contains the license key value |
Return Values
| Value | Description |
|---|---|
| LICENSE_VALID | License is valid and library is ready to use |
| LICENSE_INVALID | License invalid; all scanner operations disabled |
| LICENSE_EXPIRED | License expired; all scanner operations disabled |
| LICENSE_DOES_NOT_MATCH_LIBRARY | License invalid for this library; all library operations disabled |
| GENERAL_ERR_PLUG_NOT_FOUND | Returned if the attached scanner is not one of the following: ScanShell 600 | ScanShell 800XX | ScanShell 1000 | ScanShell 2000XX | ScanShell 4000 | ScanShell 5000 |
| MAG_ERR_NO_READER_FOUND | Magnetic reader device not found on any of the PC ports |
IsReaderValid
Section titled “IsReaderValid”Detects if the magnetic stripe reader is connected and functioning. The reader is searched for in the COM port which is found in the InitLibrary function.
Syntax
IsReaderValid() As LongParameters
None
Return Values
| Value | Description |
|---|---|
| MAG_ERR_NO_READER_FOUND | Reader not connected to PC |
| MAG_ERR_NONE | Reader connected to PC and functioning correctly |
IssueDate
Section titled “IssueDate”Returns the IssueDate value in string format (read-only)
Syntax
IssueDate As StringParameters
None
Return Values
Returns the IssueDate value
license
Section titled “license”Returns the license value in string format (read-only)
Syntax
license As StringParameters
None
Return Values
Returns the License value
NameFirst
Section titled “NameFirst”Returns the NameFirst value in string format (read-only)
Syntax
NameFirst As StringParameters
None
Return Values
Returns the NameFirst value
NameLast
Section titled “NameLast”Returns the NameLast value in string format (read-only)
Syntax
NameLast As StringParameters
None
Return Values
Returns the NameLast value
NameMiddle
Section titled “NameMiddle”Returns the NameMiddle value in string format (read-only)
Syntax
NameMiddle As StringParameters
None
Return Values
Returns the NameMiddle value
NameSuffix
Section titled “NameSuffix”Returns the NameSuffix value in string format (read-only)
Syntax
NameSuffix As StringParameters
None
Return Values
Returns the NameSuffix value
Process
Section titled “Process”Processes the recently swiped card raw data. The raw data is scanned for format detection. If a specific format is detected, the data is parsed further and loads the library properties.
Syntax
Process() As LongParameters
None
Return Values
| Value | Description |
|---|---|
| LONG_AAMVA | Standard AAMVA format (includes channel1, channel2 and channel3) |
| SHORT_AAMVA | Short AAMVA format (includes channel1 and channel3) |
| OLD_CA_DMV | Old DMV format (California) |
| OLD_LA_DMV | Old DMV format (Louisiana) |
| UNKNOWN_FORMAT | Unknown format; no further processing performed |
ProcessEx
Section titled “ProcessEx”Processes the recently swiped card raw data. The raw data is scanned for format detection. If a specific format is detected, the data is parsed further and loads the library properties.
Syntax
ProcessEx(strData As String) As LongParameters
| Parameter | Description |
|---|---|
| [in] strData |
Return Values
| Value | Description |
|---|---|
| LONG_AAMVA | Standard AAMVA format (includes channel1, channel2 and channel3) |
| SHORT_AAMVA | Short AAMVA format (includes channel1 and channel3) |
| OLD_CA_DMV | Old DMV format (California) |
| OLD_LA_DMV | Old DMV format (Louisiana) |
| UNKNOWN_FORMAT | Unknown format; no further processing performed |
Restriction
Section titled “Restriction”Returns the Restriction value in string format (read-only)
Syntax
Restriction As StringParameters
None
Return Values
Returns the Restriction value
Returns the Sex value in string format (read-only)
Syntax
Sex As StringParameters
None
Return Values
Returns the Sex value
Returns the State value in string format (read-only)
Syntax
State As StringParameters
None
Return Values
Returns the State value
WasCardSweeped
Section titled “WasCardSweeped”Call this function periodically to find out if a new card swipe was performed. If no new swipe was performed, the function returns MAG_ERR_CARD_NOT_DETECTED. If the reader detects a new swipe, it returns MAG_ERR_CARD_DETECTED. If the system is in error condition (due to bad initialization or disconnection of the reader from the PC), the function returns one of the other values.
Syntax
WasCardSweeped() As LongParameters
None
Return Values
| Value | Description |
|---|---|
| MAG_ERR_NO_READER_FOUND | Reader is not connected to the PC |
| SERIAL_NOT_INIT | Serial port not initialized |
| SERIAL_PORT_NOT_OPEN | Serial port could not be opened |
| SERIAL_PORT_CONFIG_FAIL | COM port configuration failed |
| SERIAL_COM_TIMEOUT_FAIL | COM port timeout failure |
| MAG_ERR_CARD_NOT_DETECTED | No new card swipe detected from last call to this function |
| MAG_ERR_CARD_DETECTED | Recent card swipe detected and data available for processing |
Weight
Section titled “Weight”Returns the Weight value in string format (read-only)
Syntax
Weight As StringParameters
None
Return Values
Returns the Weight value
Returns the Zip value in string format (read-only)
Syntax
Zip As StringParameters
None
Return Values
Returns the Zip value
ReleasePort
Section titled “ReleasePort”Releases the USB port and uninitializes the magnetic library
Syntax
ReleasePort()Parameters
None
Return Values
None