From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting NI Daq device name using C++

Solved!
Go to solution

Hi, I am having some issues using the nisysconfig API to programaticaly retrieve the DAQ's device name. What I mean is this:

 

When you open MAX and get the list of devices, they will have names such as "Dev1", "Dev2", etc. I am trying to retrieve this same information in C++. I am using NISysCfgGetResourceProperty but I can't seem to get this property to come back. I've been able to retrieve the serial #, product name, etc, but not this device name. Any ideas?

 

Here is a snippet of my code:

 

 

NISysCfgSessionHandle sessionHandle;
NISysCfgInitializeSession("localhost", NULL, NULL, (NISysCfgLocale)0, (NISysCfgBool)false, 100000, NULL, &sessionHandle);
std::cout << "Initialized session" << std::endl;
NISysCfgEnumResourceHandle resourceEnumHandle;
NISysCfgFindHardware(sessionHandle, NISysCfgFilterModeMatchValuesAny, NULL, NULL, &resourceEnumHandle);
std::cout << "Find hardware" << std::endl;
NISysCfgResourceHandle resourceHandle;

char productName[NISYSCFG_SIMPLE_STRING_LENGTH];
NISysCfgGetResourceProperty(resourceHandle, NISysCfgResourcePropertyProductName, &productName);

 

0 Kudos
Message 1 of 2
(3,868 Views)
Solution
Accepted by topic author peter_k_coder

You want the "Alias"  not the product name


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 2
(3,858 Views)