Datalogic .NET SDK

SoftTrigger (Method)

 

Syntax

 

   public bool SoftTrigger(DecodeInputType inputType, int timeoutMilliseconds);

 

 

Class                           : DecodeHandle

Namespace                : Datalogic.API

Assembly                   : Datalogic.API.DLL

 

 

Description

Activates the trigger of a decoding device to begin data acquisition.

 

Parameters Table

 

Type

Parameter

Description

[in]

DecodeInputType

inputType

Specifies the input data type to begin acquiring.

[in]

int

timeoutMilliseconds

Amount of time, in milliseconds, to continue the attempt to acquire data. If data has not been obtained after this time period then the trigger will be deactivated.

[return]

bool

 

TRUE is returned on success, otherwise FALSE is returned. The method will return immediately.

[on error]

-

 

-

 

 

Example

This method can be used in stand-alone mode, but it make more sense to use it with some other kind of Datalogic.API’s features: in the example below we will show how to use the SoftTrigger method together with Events, Buttons, going through the DecodeRequest type.

 

 

    public partial class Form1 : Form

    {

        private DecodeEvent dcdEvent;

        private DecodeHandle hDcd;

 

        public Form1()

        {

            InitializeComponent();

            InitDecodeEngine();

        }

 

        public void InitDecodeEngine()

        {

            // Make a new decoder handler.

            hDcd = new DecodeHandle(DecodeDeviceCap.Exists | DecodeDeviceCap.Barcode);         

            // Make a new decoder request in PostRecurring mode

            DecodeRequest reqType = (DecodeRequest)1 | DecodeRequest.PostRecurring;

            // Make the new Event Object.

            dcdEvent = new DecodeEvent(hDcd, reqType, this);

            // adding the scanning event to the event queue.

            dcdEvent.Scanned += new DecodeScanned(dcdEvent_Scanned);

            // adding the timeout event to the event queue.

            dcdEvent.TimeOut += new DecodeTimeOut(dcdEvent_Timeout);

           

        }

       

        private void bScan_Click(object sender, EventArgs e)

        {

            // Start Scanning.

            hDcd.SoftTrigger(DecodeInputType.Barcode, 5000);

        }

       

        /* ... */
   
 }

 

 

 

See Also

DecodeInputType (Enum), DecodeRequest (Enum), DecodeDeviceCap (Enum), DecodeEvent (Class), Datalogic.API Delegates, Example #016.

 

 

Copyright © Datalogic ADC. All Right Reserved