Enable DPM Mode on the WASM Platform
What is DPM Mode for WASM? #
Direct Part Marking (DPM) mode is a feature designed to scan barcodes that are directly marked on an item, usually etched or printed onto a surface, instead of printed on a paper label. This mode is particularly useful in industries where items need to be tracked throughout their lifespan. To enable DPM mode, the DataMatrix decoding is enabled and the DPM mode is set to 1. For best results, the decoding speed is set to SLOW and the barkoder resolution is set to HIGH. A Region of Interest (ROI) is also set to optimize the viewfinder for scanning.
How to enable DPM?#
Enabling via individual methods:
Barkoder.setEnabledDecoders(Barkoder.constants.Decoders.Datamatrix);
Barkoder.setDatamatrixDpmModeEnabled(true);
Barkoder.setRegionOfInterest(35, 40, 30, 14);
Barkoder.setDecodingSpeed(Barkoder.constants.DecodingSpeed.Slow);
Barkoder.setCameraResolution(Barkoder.constants.CameraResolution.FHD);
Or enable it via configureBarkoder:
let config = new Barkoder.configTypes.BarkoderConfig({
barkoderResolution: Barkoder.constants.CameraResolution.FHD,
decoder: new Barkoder.configTypes.DekoderConfig({
datamatrix: new Barkoder.configTypes.DatamatrixBarcodeConfig({
enabled: true,
dpmMode: 1
}),
general: new Barkoder.configTypes.GeneralSettings({
decodingSpeed: Barkoder.constants.DecodingSpeed.Slow,
roiX: 35,
roiY: 40,
roiWidth: 30,
roiHeight: 14
})
})
});
Barkoder.configureBarkoder(config);
Alternatively, enabling via pre-defined template file:
[template.json]
{
"dpm": {
"decoder": {
"Datamatrix": {
"enabled": true,
"dpmMode": 1
},
"general": {
"decodingSpeed": 2,
"roi_x": 35,
"roi_y": 40,
"roi_w": 30,
"roi_h": 14
}
},
"barkoderResolution": 1
}
}
Barkoder.applyTemplate('template.json', 'dpm');