You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of the strengths of the Dynamsoft Barcode Reader is its wide range of cuztomizable options that can optimize the performance of the SDK. Whether you are looking to prioritize read rate or speed, these settings can be used in many ways to match the targeted use case.
13
13
14
-
If you are looking to create your own custom template of settings to use with the [InitSettingsFromFile](https://www.dynamsoft.com/capture-vision/docs/server/programming/cplusplus/api-reference/capture-vision-router/settings.html?product=dbr&repoType=server#initsettingsfromfile) method, here are the steps:
14
+
If you are looking to create your own custom template of settings to use with the [InitSettingsFromFile][https://www.dynamsoft.com/capture-vision/docs/server/programming/cplusplus/api-reference/capture-vision-router/settings.html?product=dbr&repoType=server#initsettingsfromfile] methods, here are the steps:
15
15
16
16
1. Visit the main [online demo](https://demo.dynamsoft.com/barcode-reader/).
17
17
@@ -23,6 +23,6 @@ If you are looking to create your own custom template of settings to use with th
23
23
24
24
5. Copy the JSON code under *Template* and paste it into your own JSON file, or you can download the template JSON file straight from the demo.
25
25
26
-
Note: If you have a JSON file that you previously used in version 9 and would like to keep using that, please note that the format needs to change to be useable in version 10.x of the SDK. Please use the [TemplateConverter Tool](https://download2.dynamsoft.com/dcv/TemplateConverter.zip) to convert the template to Barcode Reader version 10 compatible template.
26
+
6. The template you downloaded is currently Barcode Reader version 9 template and the latest version is version 10. Use the [TemplateConverter Tool](https://download2.dynamsoft.com/dcv/TemplateConverter.zip) to convert the template to Barcode Reader version 10 compatible template.
27
27
28
-
And with that, you have your own template to use with the `InitSettingsFromFile` method!
28
+
And with that, you have your own template to use with the `InitSettingsFromFile` method!
## Managing Instance Limits and Parallel Tasks on a Device
81
+
82
+
Sometimes, a device may encounter an error indicating that the instance count has exceeded the permitted limit. This typically occurs when the total number of concurrently used instances surpasses the maximum number allowed for the device, either due to over-requesting instances or initiating more parallel decoding tasks than permitted.
83
+
84
+
### About `SetMaxConcurrentInstanceCount`
85
+
86
+
The `SetMaxConcurrentInstanceCount` function is used to **declare the maximum number of instances a device is allowed to use**. This count is **managed per device**, not per program.
87
+
88
+
- If multiple programs are running on the same device and each calls `SetMaxConcurrentInstanceCount`, the device will be allocated **the highest value** among the calls, **not the sum**.
89
+
90
+
- If `SetMaxConcurrentInstanceCount` is **not called**, the device will by default request **only one instance**, not the full number available from the purchased license quantity.
91
+
92
+
### About `MaxParallelTasks`
93
+
94
+
The `MaxParallelTasks` setting defines how many decoding tasks can run in parallel within a single `CaptureVisionRouter` instance. It controls the level of concurrency during barcode processing.
95
+
96
+
- Each `CaptureVisionRouter` instance will open up to `MaxParallelTasks` decoding tasks simultaneously.
97
+
- By default, if `MaxParallelTasks` is **not set, 4 parallel tasks** will be opened.
98
+
99
+
### How Instance Usage Is Calculated
100
+
101
+
The actual instance usage on a device is calculated using the following formula:
102
+
103
+
```text
104
+
Total Instance Usage = Number of concurrent programs ×
105
+
Number of CaptureVisionRouter instances per program ×
106
+
MaxParallelTasks per CaptureVisionRouter instance
34
107
```
108
+
For example, if two programs are running on the same device, and each creates 2 `CaptureVisionRouter` instances with `MaxParallelTasks = 4`, then the total instance usage is:
Sometimes, a device may encounter an error message indicating that the instance count has exceeded the limit. This occurs when a device attempts to request more instances than the license pool has available or to initiate more parallel tasks than requested.
112
+
### When Will an Error Occur?
37
113
38
-
By default, if `SetMaxConcurrentInstanceCount` is not called, your program will obtain the full number of instances from the license. If you request more instances than are available in your license pool, an error will be thrown.
114
+
An error will be thrown if the total instance usage on the device exceeds the maximum instance count declared via `SetMaxConcurrentInstanceCount`. This can happen in the following scenarios:
39
115
40
-
Additionally, if `maxParallelTasks` is not set, 4 parallel tasks will be opened to decode barcodes. If you configure the barcode reading settings to open up more parallel tasks than the number of instances obtained from `SetMaxConcurrentInstanceCount`, an error will be thrown.
116
+
- The device tries to open more decoding tasks (via `MaxParallelTasks`) than the number of instances allowed.
117
+
- Multiple programs together consume more instances than what the device was granted.
41
118
42
-
> If you attempt to run two programs on one device, the sum of the number of ParallelTasks opened by the two programs cannot exceed the maximum number of `SetMaxConcurrentInstanceCount` that the two programs set. For example, if one program sets `SetMaxConcurrentInstanceCount`(10) and another program sets `SetMaxConcurrentInstanceCount`(5), and your license has sufficient instances, the device will obtain 10 instances. If one program sets `setting.maxParallelTasks` = 6 and another program sets `setting.maxParallelTasks` = 5, an error will be thrown because the total number of parallel tasks (5+6) exceeds the MaxConcurrentInstanceCount (10).
119
+
>Example:
120
+
>Program A calls `SetMaxConcurrentInstanceCount(10)` and Program B calls `SetMaxConcurrentInstanceCount(5)`. The device will be allowed to use up to **10 instances**.
121
+
>If Program A uses `MaxParallelTasks = 6` and Program B uses `MaxParallelTasks = 5`, and both have only one `CaptureVisionRouter` instance, the total becomes `6 + 5 = 11` which exceeds the limit of 10, causing an error.
43
122
123
+
### Best Practices
44
124
125
+
- Always call `SetMaxConcurrentInstanceCount` early to explicitly declare your instance needs.
126
+
- Avoid exceeding the limit by carefully managing how many `CaptureVisionRouter` instances and `MaxParallelTasks` for each instance are being used across all running programs on a device.
127
+
- Monitor actual usage during development to avoid runtime errors in production.
Copy file name to clipboardExpand all lines: faq/general/error-license-buffer.md
+3-18
Original file line number
Diff line number
Diff line change
@@ -17,25 +17,10 @@ When initializing the license for cloud hosted services, it is common to come ac
17
17
18
18
This error occurs when Dynamsoft sdk attempts to write the license file to the local usr/home directory or Home directory, but is unable to do so due to lack of permission to read or write the license file in that directory.
19
19
20
-
To resolve this issue, please set the license file cache path to a directory that your program has read and write permissions for. Please place the code before license initializtion.
20
+
To resolve this issue, please set the license file cache path to a directory that your program has read and write permissions for.
For more language, please refer to [this page](https://www.dynamsoft.com/barcode-reader/docs/core/). Select the language and then navigate to API Reference -> DynamsoftLicense -> LicenseManager
8.[How does license tracking work with the three standard licensing options - Per Scan, Per Device, Per Concurrent Device?](how-license-tracking-works.html)
29
29
30
30
9.[When is a new license spot taken when using a per-device licensing model?](new-license-required-per-device-licensing.html)
31
-
32
-
10.[What will happen if licenses are not renewed in time?](what-happens-if-license-expires.html)
The documentation for editions `C`, `React Native`, `Flutter`, `Xamarin.Forms` and `Cordova` has been archived, but remains accessible through the following links:
If you are using a `concurrent instance license`, see [Concurrent Instance License Initialization](concurrent-instance-license.html) for more information.
124
+
If you are using a `concurrent instance license`, see [How to properly use concurrent instance license]({{ site.faq_general }}ensure-no-overuse.html) for more information.
0 commit comments