7 Replies Latest reply on Feb 1, 2019 12:27 AM by Chris Oliver Binnefeld

    Allow Customer to Aim at Barcode before Scan on TC8000

    Uwe Reisewitz

      Hi,

      The EMDK defines several AimTypes and we have found one to allow the customer to "point and shoot" on nearly every device except on a TC8000.

      This device either does not scan or it automatically scans. We have not found any setting that allows us to point to the barcode we would like to read first.

      We had no problem with the same application on TC75, TC20, TC33. Only on TC8000 this doens't work.

       

      This is the code to Apply a new config (it is called from OnBarCodeScannerStatus when the scanner is in idle state):

              private void ApplyConfig()

              {

                  try

                  {

                      ScannerConfig.AimType aimtype;

       

       

                      switch (ZebraEmdkSettings.Default.AimType)

                      {

                          case ZebraEmdkAimType.ContinuousRead:

                              aimtype = ScannerConfig.AimType.ContinuousRead;

                              break;

       

       

                          case ZebraEmdkAimType.PressAndRelease:

                              aimtype = ScannerConfig.AimType.PressAndRelease;

                              break;

       

       

                          case ZebraEmdkAimType.TimedHold:

                              aimtype = ScannerConfig.AimType.TimedHold;

                              break;

       

       

                          case ZebraEmdkAimType.TimedRelease:

                              aimtype = ScannerConfig.AimType.TimedRelease;

                              break;

       

       

                          case ZebraEmdkAimType.Trigger:

                              aimtype = ScannerConfig.AimType.Trigger;

                              break;

       

       

                          default:

                              throw new InvalidEnumArgumentException("Invalid Enum value: " + ZebraEmdkSettings.Default.AimType.ToString());

                      }

       

       

                      ScannerConfig config = _barcodeScanner.GetConfig();

                      config.ReaderParams.ReaderSpecific.ImagerSpecific.AimType = aimtype;

                      config.ReaderParams.ReaderSpecific.ImagerSpecific.AimTimer = ZebraEmdkSettings.Default.AimTimer;

                      config.ReaderParams.ReaderSpecific.LaserSpecific.AimType = aimtype;

                      config.ReaderParams.ReaderSpecific.LaserSpecific.AimTimer = ZebraEmdkSettings.Default.AimTimer;

                      config.ReaderParams.ReaderSpecific.CameraSpecific.AimType = aimtype;

                      config.ReaderParams.ReaderSpecific.CameraSpecific.AimTimer = ZebraEmdkSettings.Default.AimTimer;

                      _barcodeScanner.SetConfig(config);

                  }

                  catch (Exception ex)

                  {

                      ScannerTrace.Default.WriteExceptionToLog(ScannerTrace.GetExceptionLogText(ScanEngineName, "Apply Config", ex));

                  }

       

       

                  ScannerTrace.Default.WriteScanTrace(ScanEngineName, "ApplyConfig::End");

              }

       

      Any help would be greatly appreciated.

       

      Best regards

      Uwe

        • Re: Allow Customer to Aim at Barcode before Scan on TC8000
          Uwe Reisewitz

          This drives me crazy.

          The DataWedge App on my TC800 runs fine. It works just as expected. I set AimType to TimedRelease. When I press the trigger I see the crosshair and I can point to my barcode. Releasing the trigger scans.

           

          Now with the EMDK (I modified the provided BarcodeSample1 application to set ImagerSpecific parameters):

          Everything is the same EXCEPT that the scanner does not scan. If I release the trigger the cosshair is switched of but nothing happens - no scan event is fired.

           

          Any ideas?

           

          Thanks in advance for any help

           

          Best regards

          Uwe

            • Re: Allow Customer to Aim at Barcode before Scan on TC8000
              Pietro Francesco Maggi

              Hi Uwe,

              I've done some tests modifying the BarcodeSample1 from our EMDK for Xamarin and I was able to have the AimType to work correctly on a TC8000 Lollipop GMS with BSP 02.10.02.

               

              Just check that you've the right EMDK runtime version installed on the device.

              You can install the latest LifeGuard Patch downloading it from Zebra Support Website. Keep in mind that you need to have a maintenance contract for accessing the downloads.

              What can be critical is WHEN you're updating these parameters. From the Barcode API Scanning Guide:

               

              The user must call the Scanner.setConfig(ScannerConfig) only when the scanner is enabled and in idle state. The modified settings applied will persist until the scanner object is released and this means that when user calls enable() after disable(), all the latest configuration parameter values will be set automatically. 

              Setting scanner configurations is not allowed while a read is pending. If a read is pending, the developer must call the Scanner.cancelRead() and must wait for the idle status through the register status listener before setting the configuration.

               

              For the actual code, I simply added the additional configuration to change the AimType in the SetDecoders() function in the BarcodeSample1:

               

                      private void SetDecoders()
                      {
                          if (scanner == null)
                          {
                              InitScanner();
                          }

                          if ((scanner != null) && (scanner.IsEnabled))
                          {
                              try
                              {
                                  // Config object should be taken out before changing.
                                  ScannerConfig config = scanner.GetConfig();

                                  // Set EAN8
                                  config.DecoderParams.Ean8.Enabled = checkBoxEAN8.Checked;

                                  // Set EAN13
                                  config.DecoderParams.Ean13.Enabled = checkBoxEAN13.Checked;

                                  // Set Code39
                                  config.DecoderParams.Code39.Enabled = checkBoxCode39.Checked;

                                  // Set Code128
                                  config.DecoderParams.Code128.Enabled = checkBoxCode128.Checked;

                                  config.ReaderParams.ReaderSpecific.ImagerSpecific.AimType = ScannerConfig.AimType.TimedRelease;
                                  config.ReaderParams.ReaderSpecific.LaserSpecific.AimType = ScannerConfig.AimType.TimedRelease;
                                  config.ReaderParams.ReaderSpecific.CameraSpecific.AimType = ScannerConfig.AimType.TimedRelease;

                                  // Should be assigned back to the property to get the changes to the lower layers.
                                  scanner.SetConfig(config);
                              }
                              catch (ScannerException e)
                              {
                                  textViewStatus.Text = "Status: " + e.Message;
                                  Console.WriteLine(e.StackTrace);
                              }
                          }
                      }

                • Re: Allow Customer to Aim at Barcode before Scan on TC8000
                  Uwe Reisewitz

                  Hi,

                  thank you for your reply. Sorry for the delay, since there is no email notification, I simply missed your reply.

                   

                  I've tried your suggestions, here are my findings:

                  Yes, the barcode sample scans like it should but totally unreliable. It scans successfully in about 1 in 10 tries. If I remove the AimType-code (defaulting to AimType.Trigger I suppose) it scans every time with full speed. Did that work on your side?

                  The sample contains a different version of the Symbol.EMDK library. This is very unfortunate. Why does Zebra ask developers to switch to NuGet and then update the libraries in the samples? It seems that this version changes something, too as the previous version did not work at all with AimType.TimedRelease.

                   

                  BTW, my device is running the latest LifeGuard update (8).

                   

                  How should we proceed?

                   

                  Thanks again for your help.

                   

                  Best Regards

                  Uwe