Check runtime environment

Check runtime environment

I'm using Intel MCA Sdk from C++ and would like to check at runtime if i'm running on the SDK in loopback mode or on "real" hardware with platform driver.I didn't find any function to achieve this. Is there a way?

5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

There is not an API to check this. One way would be to check the value returned by the barcode and/or RFID to see if they are the loopback values:

Barcode results = ]C00128

RFID results = E05631AC56BD0000

Or, you could also check the IntelHealthcare.cfg for any number of entries that would indicate the system is running in loopback mode such as these:

/Intel/HealthcareSDK/ToolTray/ButtonHandler/ButtonHandler.dll/RF-FriendlyName = Rfid Loopback Device

/Intel/HealthcareSDK/ToolTray/ButtonHandler/ButtonHandler.dll/BC-FriendlyName = Barcode Loopback Device

/Intel/HealthcareSDK/ToolTray/DefaultHandler/RfidDefaultHandler.dll/RF-FriendlyName = Rfid Loopback Device

/Intel/HealthcareSDK/ToolTray/DefaultHandler/BarcodeDefaultHandler.dll/BC-FriendlyName = Barcode Loopback Device

/Intel/HealthcareSDK/Plugin[0]/Location = PIBarcodeLoopback.dll

/Intel/HealthcareSDK/Plugin[2]/Location = PIDeviceControlLoopback.dll

/Intel/HealthcareSDK/Plugin[0]/ParameterPrefix = /Intel/HealthcareSDK/PluginConfig/Barcode/Barcode Loopback Device/

/Intel/HealthcareSDK/Plugin[2]/ParameterPrefix = /Intel/HealthcareSDK/PluginConfig/Device Control/Device Control Loopback/

However, neither of these is foolproof but they might work for you.

If I may ask, why do you need to check for loopback mode? Our assumption is the MCA SDK and loopback mode would only be used in a development environment.



Thanks, i already considered these two options, but was hoping for a cleaner solution.The problem is that a surprisingly high number of customers of our software install the SDK on their machines (for whatever reason) and then complain that our software is not working properly.And it usually takes some time over the phone until they admit to have intalled the SDK over their platform drivers. (The difference between these two is not clear to endusers).So my intention was to check for the presence of the SDK and display an error message in release builds.Checking the configuration file might work, but maybe in the above scenario there are multiple versions of it on the machine. Is there a way to tell which the "active" one is?Checking the returned data from a barcode or RFID scan is not an option, because when running on "real" hardware this would cause a (visible) barcode scan at program startup or create a timeout when trying to do a RFID scan.

Best Reply

Hi mjx,

I am sure you know but for the benefit of the other forum users, with MCA v3.0 only one of the MCA products (Platform Driver or SDK) can be installed on a system. Either the MCA PD or MCA SDK can exist in the system, but not both together. If the MCA Platform Driver(PD) is installed on a system when the MCA SDK is already installed, the PD will overwrite the SDK. SDK components are uninstalled and PD components will be installed. If the PD is already on the system and then someone tries to install the SDK, the installation is not allowed.

However, as you pointed out, it does not prevent someone from installing the SDK first because they do not understand the difference between the MCA Platform Driver and the MCA SDK. Here are a couple of more possabilities to detect which is installed you may want to consider:

Option 1:

The easiest way is to find a registry key that differ for SDK and PD installations:


Here are the values for the registry key:

For MCA Platform Driver (PD), the string value is: "Intel MCA Platform Driver"

For MCA Software Development Kit (SDK), the string value is: "Intel MCA Software Development Kit (SDK)"

Option 2:

The other way can be to expand the environment variable MCA_INSTALL_DIR to get to know the MCA installation directory. Try to read the file property of the field FileDescription for the file IntelHealthcareSDK.dll. The value will be as below:

For MCA Platform Driver (PD), the string value is: "Intel MCA Platform Driver"

For MCA Software Development Kit (SDK), the string value is: "Intel MCA Software Development Kit (SDK)"


Sorry for the late reply.Thanks a lot, that helps!

Leave a Comment

Please sign in to add a comment. Not a member? Join today