|
Cognex Mobile Barcode SDK
SDK for supporting communication with Cognex Barcode Reader devices
|
The CMB SDK can be used to connect to Cognex Barcode readers and perform operations on these systems. You can retrieve read results, images, image graphics and read statistics. The SDK also allows you to configure your system or change individual settings. Refer to the DMCC Command Reference document for a complete list of DMCC commands that you can send to a Cognex system.
The SDK package contains a sample application that shows you the basic concepts and how to use the SDK.
The CMB SDK comprises the iOS SDK lib files and their documentation. The library files are available for iOS 10.1.
To use the DataMan SDK for an iOS project, you will need to add the following files to your XCode project:
After adding the files, make sure, that the libDataManSDK.a file is present in the Project Settings > Build Phases > Link Binary With Libraries section.
First of all use the following header file to access the DataMan SDK classes:
For communication with each DataMan device, you will need to create a CDMDataManSystem object. Here is a sample code showing how to connect to a device using its IP address.
To connect to an External Accessory device, like the MX-1000, you will need to include the DataMan External Accessory Protocol identifier in the Info.plist of your project:
Then you can enumerate the available connected devices with:
To initialize CDMDataManSystem object for a connected device:
Next, the result types needs to be specified:
To connect, the connect method will be called:
To send commands to the device and retrieve their responses through the DataMan SDK, you can use the sendCommand method:
To receive messages from a DataMan system, you will need to implement the CDMDataManSystemDelegate protocol and pass the class as a delegate when initializing the DataMan system. Here is a skeleton implementation of the delegate methods. Note that only the first four methods are required, the rest are optional methods.