BarcodeReader Constructor

Default constructor uses the default buffer size (2 KB) for all scanners.

Namespace: Honeywell.Mobility.DataCollection

Assembly: Honeywell.Mobility.DataCollection.FF3.5 (in Honeywell.Mobility.DataCollection.FF3.5.dll)

[C#]
public BarcodeReader(
[Visual Basic (Declaration)]
Public Sub New

Parameters

None.

Remarks

Multiple simultaneous instances of this class are not supported. Before you create a new instance, call Dispose to dispose of the existing instance.

Examples

[C#]
using Honeywell.Mobility.DataCollection;
namespace DataCollection
{
    public partial class frmBarcodeReader : Form
    {
        private Honeywell.Mobility.DataCollection.BarcodeReader bcr;

        public frmBarcodeReader()
        {
            InitializeComponent();

            try
            {
                bcr = new Honeywell.Mobility.DataCollection.BarcodeReader();
                bcr.BarcodeRead += new BarcodeReadEventHandler(bcr1_BarcodeRead);
                bcr.PostRead = true;
            }
            catch (BarcodeReaderException bcrexp)
            {
                MessageBox.Show(bcrexp.Message);
            }
        }

        void bcr_BarcodeRead(object sender, Honeywell.Mobility.DataCollection.BarcodeReadEventArgs bre)
        {
            try
            {
                this.listBox1.Items.Add("strBarcodeData = " + bre.strBarcodeData);
                this.listBox1.Items.Add("SymbologyId = " + bre.SymbologyId);
                this.listBox1.Items.Add("SymbologyName = " + bre.SymbologyName);
                this.listBox1.Items.Add("DataType = " + bre.DataType);
                this.listBox1.Items.Add("BytesInBuffer = " + bre.BytesInBuffer);
                this.listBox1.Items.Add("PortID = " + bre.PortID);
                this.listBox1.Items.Add("PortName = " + bre.PortName);
                this.listBox1.Items.Add("PortDeviceType = " + bre.PortDeviceType);
            }
            catch (BarcodeReaderException bcrexp)
            {
                MessageBox.Show(bcrexp.Message);
            }
        }
    }
}
[VB.NET]
Imports Honeywell.Mobility.DataCollection
Public Class BarcodeReader
    Private WithEvents bcr As Honeywell.Mobility.DataCollection.BarcodeReader

    Private Sub BarcodeReader_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Try
            bcr = New Honeywell.Mobility.DataCollection.BarcodeReader()
            bcr.PostRead = True
        Catch bcrexp As BarcodeReaderException
            MessageBox.Show(bcrexp.Message)
        End Try
    End Sub

    Private Sub bcr_BarcodeRead(ByVal sender As Object, ByVal bre As Honeywell.Mobility.DataCollection.BarcodeReadEventArgs) Handles bcr.BarcodeRead
        ListBox1.Items.Add("strBarcodeData = " + bre.strBarcodeData)
        ListBox1.Items.Add("SymbologyId = " + bre.SymbologyId.ToString())
        ListBox1.Items.Add("SymbologyName = " + bre.SymbologyName)
        ListBox1.Items.Add("DataType = " + bre.DataType)
        ListBox1.Items.Add("BytesInBuffer = " + bre.BytesInBuffer)
        ListBox1.Items.Add("PortID = " + bre.PortID.ToString())
        ListBox1.Items.Add("PortName = " + bre.PortName)
        ListBox1.Items.Add("PortDeviceType = " + bre.PortDeviceType)
    End Sub
End Class

Exceptions

BarcodeReaderException throws an exception when an error has occurred on bar code read methods and properties.

More Information

BarcodeReader Class