Zebra Barcode Scanner DataReceived events not firing by using Scanner SDK for Windows in c# .Net 6 or 8

V Vinod Bhoite 6 months ago
148 0 0

Problem Statement: Zebra Barcode Scanner DataReceived events not firing by using Scanner SDK for Windows in c# .Net Console App and Windows Form App.

Details: I am using below hardware and Packages 

  1. Zebra Barcode (USB) DS2208.
  2. Zebra_Scanner_SDK_(64bit)_v3.06.0034.exe
  3. Machine - Windows 10
  4. .Net 6 and 8
  5. Language: C# 

Only one scanner is connected by USB to laptop

 I have also tried to downloaded "Scanner-SDK-for-Windows-master" (Windows form application) and "Scanner-SDK-for-Windows-Code-Snippets-master\CSharp\RegisterUnregisterForEvents" console application and run at my PC but no luck. No DataReceived event is firing.

I  have also tried to used SDK with CCoreScanner library and code sample is:

{
	// Instantiate CoreScanner Class
	CoreScanner.CCoreScanner cCoreScannerClass = new CCoreScanner();

	
	// Call Open API
	short[] scannerTypes = new short[1];    // Scanner Types you are interested in
	scannerTypes[0] = 1;                    // 1 for all scanner types
	short numberOfScannerTypes = 1;         // Size of the scannerTypes array 
	int status;

	
	int[] connectedScannerIDList = new int[10];    /// Extended API return code
	string outXML;                             // Extended API return code

	
	cCoreScannerClass.Open(0, scannerTypes, numberOfScannerTypes, out status);
	cCoreScannerClass.GetScanners(out numberOfScannerTypes, connectedScannerIDList, out outXML, out status);
	Console.WriteLine(outXML);
	// BarcodeManager barcodeManager = (BarcodeManager)emdkManager.getInstance(FEATURE_TYPE.BARCODE);

	
	// Subscribe for barcode events in cCoreScannerClass
	cCoreScannerClass.BarcodeEvent += new _ICoreScannerEvents_BarcodeEventEventHandler(OnBarcodeEvent);
	// cCoreScannerClass.BarcodeEvent.WaitOne();
	//Thread.CurrentThread.Join(); // Waits forever
	Console.WriteLine("Testing ZEBRA SDK");
}
 void OnBarcodeEvent(short eventType, ref string pscanData)
 {
     string barcode = pscanData;
     Console.WriteLine("Barcode Scanner evnet fired...");
     Console.WriteLine("Barcode container below value:...");
     Console.WriteLine(barcode);
 }

Tried all options but barcode events aren't firing?

In Windows form, Event after priting value after scanning in Textbox, no event firing.

In console App, no luck. 

Can we display value directly to lable and not textbox? If yes, can you share more insites.

 

CONTACT
Can’t find what you’re looking for?