RhoElements Scan and Print issue

// Expert user has replied.
P Peter Arcuri 2 years 11 months ago
2 2 0

Wondering if anyone came across an issue with the scanner in RhoElements shared runtime 4.1 for WinCE on a MC92N0 device with printing capabilities. I've never had any issues with my javascript scanning function until including print methods. In fact both functionalities work fine independently but when merged I get a scan lockup immediately after printing to the portable printer.

I launch RhoE and scan a barcode without any issues. Then I print a label to a QL320 printer without any issues. But now my scanner trigger does not response. I've repeat execution of enableScanner() function immediately following a print and that seams to execute. But when pulling the trigger it doesn't make it to the callback onBarcodeEvent(). Any one would see from the code below that its pretty much straightforward: the ensableScanner() function executes upon page onload and printLabel() is called by a label prep function.

printLabel = function(format, copies) {
apd.PSExternal(261,"0000C53");
     if(!copies)
            copies = 1;
      for(var i = 0; i copies; i++)
      {
            if(apd.PSExternalEx(266, format) > 0)                          
                  //return nb.PSGetLastMessage();
                  continue;
            else
                  continue;
      }
      var navto = enableScanner(); //added this line in case the scanner disabled by the print function
      return true;
}
function enableScanner()
{
    var defaultScanner = Rho.Barcode.getDefault();
    defaultScanner.allDecoders = true;
    Rho.Barcode.setDefault(defaultScanner);
    Rho.Barcode.enable({}, onBarcodeEvent);
}
function onBarcodeEvent(barcode)
{
    document.getElementById('barcode-data').value = barcode.data;
}

All comments are welcome!

Please register or login to post a reply

2 Replies

P Peter Arcuri

Given there is no documentation on APD under RhoElements v4.1 I would presume it's not supported so shifting strategy to RhoElements ZebraPrinter APIs as per doc outlined here Rhomobile | PrinterZebra

However the doc covers only the BlueTooth Connection Type.

Rho.Printer.searchPrinters({
   connectionType:Rho.Printer.CONNECTION_TYPE_BLUETOOTH, 
   printerType: Rho.Printer.PRINTER_TYPE_ZEBRA
  },

Has anyone acquired knowledge on establishing a serial connection to a cable tethered printer???

G Glenn Sayer

Peter,

There is an issue with 4.1 when it looses focus from the screen and when you have debug buttons enabled.    Disable the debug buttons and see if it works.

CONTACT
Can’t find what you’re looking for?