OPOS Checkup - Visual Basic Scripting Sample Applications

Technote (FAQ)


Question

I am looking for some sample VBScript applications that use OPOS. Do you have any?

Answer

Three sample utilities have been written using Visual Basic scripting. They are also on our OPOS Checkup web page.
Before you run any of these applications...

  • Install OPOS support on your system
  • Attach required POS peripherals
  • Run AIPODEVICE to configure the names of the devices
  • Set your browser internet security to low for this exercise. ActiveX controls must be allowed to run

General Notes
  • Be sure to re-select DataEventEnabled after each scan or card swipe
  • After your finished, be sure to restore your browsers internet security settings
  • These applications have only been tested with Internet Explorer 9

Internet Explorer V10 and above
    IE must be loaded in ID9 mode to support VBScripts. To do this add these to lines in the html...

    <meta http-equiv="Content-type"  content="text/html; charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9">

    For example:
      <html>
      <head>
      <meta http-equiv="Content-type" content="text/html; charset=utf-8">
      <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9">
      <meta name="VI60_defaultClientScript" content="VBScript">
      <title>POSPrinter VBScript Example</title>
      </head>
      <body>

MSR Test
  • msrexample.htmlmsrexample.html
  • Enter assigned device name
  • Select Use Common Controls and DataEventEnabled
  • Click Open/Claim/Enable button
    You should see in the Results window...
    Open() = 0
    Claim() = 0
    DeviceEnabled = True
    DataEventEnabled = True
  • Swipe a card
    You should see in the Results window something like...
    B43056123412341234^BLACK/JAMES S^12341010000001234000000
  • Click the Close button
You should see the following when you click the Capabilities/Properties button
    *********** Properties and Capabilities ***********
    ControlObjectDescription: OPOS MSR Control 1.5.102 [Public, by CRM/RCS-Dayton]
    ControlObjectVersion: 1005102
    ServiceObjectDescription: IBM Msr Service Object
    ServiceObjectVersion: 1005001
    DeviceDescription: IBM Magnetic Stripe Reader
    DeviceName: IBM Msr
    AutoDisable: False
    BinaryConversion: 0
    CapPowerReporting: 1
    Claimed: True
    DataCount: 0
    DataEventEnabled: True
    DeviceEnabled: True
    FreezeEvents: False
    OpenResult: 0
    PowerNotify: 0
    PowerState: 2000
    ResultCode: 0
    ResultCodeExtended: 0
    State: 2
    CapISO: True
    CapJISOne: True
    CapJISTwo: True
    CapTransmitSentinels: False
    TracksToRead: 7
    DecodeData: True
    ParseDecodeData: True
    ErrorReportingType: 0
    Track1Data:
    Track2Data:
    Track3Data:
    Track4Data:
    AccountNumber:
    ExpirationDate:
    Title:
    FirstName:
    MiddleInitial:
    Surname:
    Suffix:
    ServiceCode:
    Track1DiscretionaryData:
    Track2DiscretionaryData:
    TransmitSentinels: False
    ***************************************************

Scanner Test
  • scannerexample.htmlscannerexample.html
  • Enter assigned device name
  • Select DataEventEnabled
  • Click Open/Claim/Enable button
    You should see in the Results window...
    Open() = 0
    Claim() = 0
    DeviceEnabled = True
    DataEventEnabled = True
  • Scan a barcode
    You should see in the Results window something like...
    Barcode = 04906906
  • Click the Close button

You should see the following when you click the Capabilities/Properties button
    *********** Properties and Capabilities ***********
    ControlObjectDescription: OPOS Scanner Control 1.5.102 [Public, by CRM/RCS-Dayton]
    ControlObjectVersion: 1005102
    ServiceObjectDescription: IBM Scanner Service Object
    ServiceObjectVersion: 1005001
    DeviceDescription: IBM Scanner
    DeviceName: IBM Scanner
    AutoDisable: False
    BinaryConversion: 0
    CapPowerReporting: 1
    Claimed: True
    DataCount: 0
    DataEventEnabled: True
    DeviceEnabled: True
    FreezeEvents: False
    OpenResult: 0
    PowerNotify: 0
    PowerState: 2000
    ResultCode: 0
    ResultCodeExtended: 0
    State: 2
    DecodeData: True
    ScanData:
    ScanDataLabel:
    ScanDataType: 0
    ***************************************************

Printer Test
  • posprinterexample.htmlposprinterexample.html
  • Enter assigned device name
  • Select Receipt
  • Enter text to print
  • Select font effects to print text with
  • Click Open/Claim/Enable button
    You should see in the Results window...
    Open() = 0
    Claim() = 0
    DeviceEnabled = True
  • Click PrintNormal button
    You should see text printed on the Receipt
  • Click the Close button
    You should see the following when you click the Capabilities/Properties button. This information will be printed on the receipt station if you click Print on POS Printer.
      *********** Properties and Capabilities ***********
      ControlObjectDescription: OPOS POSPrinter Control 1.5.102 [Public, by CRM/RCS-Dayton]
      ControlObjectVersion: 1005102
      ServiceObjectDescription: IBM Printer Service Object
      ServiceObjectVersion: 1005099
      DeviceDescription: IBM 4610 Point of Sale Printer
      DeviceName: IBM 4610 TI3/TI4 POS Printer
      BinaryConversion: 0
      CapPowerReporting: 1
      Claimed: True
      DeviceEnabled: True
      FreezeEvents: False
      OpenResult: 0
      PowerNotify: 0
      PowerState: 2000
      ResultCode: 0
      ResultCodeExtended: 0
      State: 2
      AsyncMode: False
      CartridgeNotify: 0
      CharacterSet: 437
      CharacterSetList: 101,102,103,104,437,819,850,
      852,855,857,858,860,861,862,863,864,865,866,
      869,998,999,1116,1117,1118,1119,1250,1251,1252,
      1253,1254,1257
      CoverOpen: False
      ErrorLevel: 1
      ErrorStation: 0
      ErrorString: [Error]
      FontTypefaceList:
      FlagWhenIdle: False
      MapMode: 1
      RotateSpecial: 1
      ***************************************************

    Cash Drawer
    cashdrawerexample.htmlcashdrawerexample.html

    Error Messages

    This is an acceptable error message if you have Internet Security set to low. Click YES.

    These error messages indicate your browser security setting is set too high. The VBScript application will not run.



    The source files for the applications are in this zip file.
    VBScriptSamples.zip

    This updated MSR example has the following changes from the original in the ZIP file.
    - only supports CCO's, not the IBM CO's
    - handles the error event properly
    (when using track reporting MSR data can arrive on the 2nd error event)
    - allows you to set what tracks to read (via TracksToRead property)
    - allows you to set what error reporting to use (via ErrorReportingType property)
    - allows you to clear the SO's buffered data (via ClearInput method)

    msrexample.1.html

    If you are using Internet Explorer 7 and have issues with the scripts, you may need to update the registry using the file below to change the Threading Model for the OPOS Service Object Interface.

    setthrdmodel.reg

    Rate this page:

    (0 users)Average rating

    Document information


    More support for:

    OPOS ('OLE for Retail' Point of Sale)
    Programming Tips

    Version:

    Version Independent

    Operating system(s):

    Windows

    Reference #:

    R1002425

    Modified date:

    2005-03-01

    Translate my page

    Machine Translation

    Content navigation