ScanDeviceManager GetConfigData
Gets a copy of the stored configuration data from the device.
Overloads
| public void GetConfigData(string deviceName, int iDataType, out string pstrData, uint uiTimeout) |
| public void GetConfigData(string deviceName, string strStorageName, int iDataType, out string pstrData, uint uiTimeout) |
Return value
| void |
Parameters
| string | deviceName | The unique name of the device. |
| string | strStorageName | File name of the stored configuration file |
| int | iDataType | The data type to request |
| string | pstrData | A string buffer to receive the data |
| uint | uiTimeout | a timeout value waiting for the response to return in milliseconds |
The iDataType is defined in the SMC software reference manual and categorize the type of data to be fetched.
| Fixed Data type | Data ID |
| Controller Configuration | 0x05 |
| Laser Configuration | 0x06 |
| Lens Configuration | 0x02 |
| Correction Table | 0x0D |
| User Configuration | 0x0F |
| Performance Adjustments | 0x10 |
| Admin Configuration | 0x0A |
| Servo Parameters | 0x20 |
| ScanPack Configuration | 0x21 |
Please refer SMC Software Reference Manual (6.3.1 ADMINISTRATION CONFIGURATION) for further information.
Exceptions
| CorrectionFileUploadFailedException | Throws if unable to fetch data from the device |
| DeviceNotFoundException | Throws when the device with the given name is not found |
Example
Copy
bool loadStatus = scanDeviceManager.CanLoadConfigurationDataFromScanDevice(GetselectedDeviceUniqueName());
if (loadStatus)
{
string ControllerConfiguration = "";
string LaserConfiguration = "";
string LensConfiguration = "";
string CorrectionTable = "";
try
{
scanDeviceManager.GetConfigData(GetselectedDeviceUniqueName(), 0x05, out ControllerConfiguration, 500);
//scanDeviceManager.GetConfigData(GetselectedDeviceUniqueName(), 0x0D, out CorrectionTable, 500);
//scanDeviceManager.GetConfigData(GetselectedDeviceUniqueName(), 0x06, out LaserConfiguration, 500);
//scanDeviceManager.GetConfigData(GetselectedDeviceUniqueName(), 0x02, out LensConfiguration, 500);
}
catch (Exception exp)
{
MessageBox.Show("Exception >> " + exp.Message);
}
if (!string.IsNullOrEmpty(ControllerConfiguration))
{
string newControlConfiguration = ControllerConfiguration;
// prepare new control configuration and send back
scanDeviceManager.SendConfigData(GetselectedDeviceUniqueName(), ControllerConfiguration, "newStorage", 500);
}
}