Dev Center
Table of contents

Basic Settings Methods

Method Description
set_mode_argument Sets the optional argument for a specified mode in Modes parameters.
get_mode_argument Gets the optional argument for a specified mode in Modes parameters.
get_runtime_settings Gets current runtime settings.
update_runtime_settings Updates runtime settings with a given struct.
reset_runtime_settings Resets all parameters to default values.

set_mode_argument

Sets the optional argument for a specified mode in Modes parameters.

BarcodeReader.set_mode_argument(modes_name, index, argument_name, argument_value)

Parameters

[in] modes_name <*str*> : The mode(s) parameter name to set argument.
[in] index <*int*> : The array index of modes parameter to indicate a specific mode.
[in] argument_name <*str*> : The name of the argument to set.
[in] argument_value <*str*> : The value of the argument to set.

Return Value

error <*tuple*> : error_code = error[0], error_message = error[1], if error_code != EnumErrorCode.DBR_OK, you can get the detailed error message by error_message.

Code Snippet

from dbr import *
reader = BarcodeReader.get_instance()
if reader != None:
    settings = reader.get_runtime_settings()
    settings.binarization_modes[0] = EnumBinarizationMode.BM_LOCAL_BLOCK
    try:
        reader.update_runtime_settings(settings)
        error = reader.set_mode_argument("BinarizationModes", 0, "EnableFillBinaryVacancy", "1")
        if error[0] != 0:
            print(error[1])
        # add further process
    except BarcodeReaderError as e:
        print(e)
    reader.recycle_instance()

Remarks
Check the available modes and arguments below:

get_mode_argument

Gets argument value for the specified mode parameter.

BarcodeReader.get_mode_argument(modes_name, index, argument_name)

Parameters

[in] modes_name <*str*> : The mode(s) parameter name to get argument.
[in] index <*int*> : The array index of modes parameter to indicate a specific mode.
[in] argument_name <*str*> : The name of the argument to get.

Return Value

argument_value <*str*> : The value of the argument to get.

Exception

BarcodeReaderError : If error happens, this function will throw a BarcodeReaderError exception that can report the detailed error message.

Code Snippet

from dbr import *
reader = BarcodeReader.get_instance()
if reader != None:
    settings = reader.get_runtime_settings()
    settings.binarization_modes[0] = EnumBinarizationMode.BM_LOCAL_BLOCK
    try:
        reader.update_runtime_settings(settings)
        error = reader.set_mode_argument("BinarizationModes", 0, "EnableFillBinaryVacancy", "1")

        value = reader.get_mode_argument("BinarizationModes", 0, "EnableFillBinaryVacancy")
        print(value)
        # add further process
    except BarcodeReaderError as e:
        print(e)
    reader.recycle_instance()

Remarks
Check the available modes and arguments below:

get_runtime_settings

Gets current settings and saves them into a PublicRuntimeSetting object.

BarcodeReader.get_runtime_settings()

Return Value

runtime_settings <*class PublicRuntimeSetting*> : a PublicRuntimeSetting object with the current runtime settings.

Code Snippet

from dbr import *
reader = BarcodeReader.get_instance()
if reader != None:
    settings = reader.get_runtime_settings()
    print(settings.barcode_format_ids)
    print(settings.expected_barcodes_count)
    # add further process
    reader.recycle_instance()

update_runtime_settings

Updates runtime settings with a given PublicRuntimeSetting object.

BarcodeReader.update_runtime_settings(settings)

Parameters

[in] settings <*class PublicRuntimeSetting*> : a PublicRuntimeSetting object.

Exception

BarcodeReaderError : If error happens, this function will throw a BarcodeReaderError exception that can report the detailed error message.

Code Snippet

from dbr import *
reader = BarcodeReader.get_instance()
if reader != None:
    settings = reader.get_runtime_settings()
    settings.barcode_format_ids = EnumBarcodeFormat.BF_ONED
    settings.expected_barcodes_count = 4
    try:
        reader.update_runtime_settings(settings)
        changed_settings = reader.get_runtime_settings()
        print(changed_settings.barcode_format_ids)
        print(changed_settings.expected_barcodes_count)
        # add further process
    except BarcodeReaderError as e:
        print(e)
    reader.recycle_instance()

reset_runtime_settings

Resets all parameters to default values.

BarcodeReader.reset_runtime_settings() 

Code Snippet

from dbr import *
reader = BarcodeReader.get_instance()
if reader != None:
    settings = reader.get_runtime_settings()
    settings.barcode_format_ids = EnumBarcodeFormat.BF_ONED
    settings.expected_barcodes_count = 4
    try:
        reader.update_runtime_settings(settings)
        changed_settings = reader.get_runtime_settings()
        print(changed_settings.barcode_format_ids)
        print(changed_settings.expected_barcodes_count)

        reader.reset_runtime_settings()
        reset_settings = reader.get_runtime_settings()
        print(reset_settings.barcode_format_ids)
        print(reset_settings.expected_barcodes_count)
        # add further process
    except BarcodeReaderError as e:
        print(e)
    reader.recycle_instance()

This page is compatible for:

Version 7.5.0

Is this page helpful?

YesYes NoNo

In this article:

latest version

  • Latest version
  • Version 10.x
    • Version 10.2.0
    • Version 10.0.20
    • Version 10.0.10
    • Version 10.0.0
  • Version 9.x
    • Version 9.6.40
    • Version 9.6.30
    • Version 9.6.20
    • Version 9.6.10
    • Version 9.6.0
    • Version 9.4.0
    • Version 9.2.0
    • Version 9.0.0
  • Version 8.x
    • Version 8.8.0
    • Version 8.6.0
    • Version 8.4.0
    • Version 8.2.0
    • Version 8.1.2
    • Version 8.1.0
    • Version 8.0.0
  • Version 7.x
    • Version 7.6.0
    • Version 7.5.0
Change +