2 Replies Latest reply on May 6, 2013 7:53 AM by Rahul Kumar

    Increase emitting time red leser  beam of scanner

      I want to increase the emitting time of red laser beam for my scanner application for that thing i have tried with Scanner.scanTimeout=20000 but it is not not working.

      In my application scan button is present after click of that button  it is calling the take method of controller class.

      On click of Scan button only for 5 sec scanner isi emitting the red laser beam.

       

      I am using below code from  Sample Api demo provided by rhostudio for scanner functionality.

       

      def login

          if defined?(Scanner)

            Alert.show_popup("inside if")

            Scanner.decodeEvent = url_for(:action => :scannerEventListener) 

            Scanner.enable

            Scanner.scanTimeout=20000

          end

       

          @msg = @params['msg']

          render :action => :login

        end

       

       

      def take

            Barcode.take_barcode(url_for(:action => :take_callback), {})

            #Barcode.take_barcode(url_for(:action => :take_callback), {:camera => 'front'})

          WebView.navigate(url_for( :controller=> :Settings,:action=>:login))

           # redirect :action => :index

        end

       

        def take_callback

            status = @params['status']

            barcode = @params['barcode']

       

            puts 'BarcodeRecognizer::take_callback !'

            puts 'status = '+status.to_s unless status == nil

            puts 'barcode = '+barcode.to_s unless barcode == nil

       

            if status == 'ok'

                 show_barcode_info(barcode)

            end

            if status == 'cancel'

                 Alert.show_popup  ('Barcode taking was canceled !') 

            end

          WebView.navigate(url_for( :controller=> :Settings,:action=>:login))

            #redirect :action => :index

        end

       

          First tme=>        Scanner.scanTimeout=20000 but it was not working

       

        Second time I tried this=>   Scanner.scanTimeout='20000' but it is also not working.

       

      Please let me know how to increase the beam light emitting time?

        • Re: Increase emitting time red leser  beam of scanner
          Glenn Sayer

          check your aimType

           

           

           

          aimType:[Value] Describes the type of aiming to use.
          Possible values:
          trigger: Standard trigger mode. Holding the trigger will start a decoding session. The decoding session ends when a barcode is decoded, scanTimeout occurs or the trigger is released.
          timedHold: Aiming lasts for the time specified by 'timedAimDuration' before decoding. The decode will last until the barcode is decoded or scanTimeout occurs.
          timedRelease: Aiming lasts until trigger is released. If the timedAimDuration has expired when the trigger is released then a decode session is started until a barcode is decoded or for the remaining time equal to the scanTimeout value.
          presentation: Provided to support Kiosk devices. The scanner illuminates when movement is detected in the range of the scanner window. In order to use this mode the scanner must be initiated with a softscan using the scanner.start() method and again after each decode. The device must be equipped with a sensor to detect movement to use presentation mode. See examples below.
          pressAndRelease: Scan will continue after the trigger is released until scanTimeout occurs.
          continuousRead: Once the trigger is pulled barcodes will continue to be scanned whilst the trigger is held, enabling rapid scanning, to be used in conjunction with sameSymbolTimeout and differentSymbolTimeout. This value is ignored if viewfinderMode is set to 'dynamicReticle'Applicable scanner types: Laser and Imager / Camera
          Default: Device specific