BarcodeReader.SetPortState Method

Sets the port state by port ID.

Namespace: Honeywell.Mobility.DataCollection

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

[C#]
public int SetPortState( int portID, int portState )
[Visual Basic (Declaration)]
Public Function SetPortState ( _ portID As Integer, _ portState As Integer _ ) As Integer

Parameters

portID
Type: System.Int32
Port ID to be changed.

portState
Type: System.Int32
Port state value from BarcodeReader.PortState.

Return Value

Returns zero if successful.

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();
                //enable port 1
                bcr.SetPortState(1, (int)BarcodeReader.PortState.Enabled);

            }
            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 BarcodeReader()
            'enable port 1
            bcr.SetPortState(1, BarcodeReader.PortState.Enabled)
        Catch bcrexp As BarcodeReaderException
            MessageBox.Show(bcrexp.Message)
        End Try
    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