Here's a quick and dirty example of how to use the niModInst API in C:
---
ViSession sessionHandle = VI_NULL;
ViInt32 numberOfDevices = 0,
i = 0;
ViChar deviceNameBuffer[256] = "";
niModInst_OpenInstalledDevicesSession(
"niScope",
&sessionHandle,
&numberOfDevices);
for (i=0; i < numberOfDevices; i++) {
niModInst_GetInstalledDeviceAttributeViString(
sessionHandle,
i,
NIMODINST_ATTR_DEVICE_NAME,
256,
deviceNameBuffer);
printf("%s\n", deviceNameBuffer);
}
niModInst_CloseInstalledDevicesSession(sessionHandle);
---
The device names that you're printing out in this example can be used as the resourceName input to the niScope_init function.
In practice, though, be sure to check the status that is returned from each function. You can get further information about an error using the niModInst_GetExtendedErrorInfo function. All the functions I used above can be found in the niModInst.h file.
Hope that provides some more help.