High-Speed Digitizers

cancel
Showing results for 
Search instead for 
Did you mean: 

Finding a logical name for PXI5112 modules to be used in niScope_Init

I need to dynamically allocate the number of PXI5112 modules on several PCs in a C++ program. After going through great length using VISA calls to obtain the VISA logical name ( PXI3::11::INSTR, etc.), I found out that niScope_Init is expecting an IVI or DAQ logical names. How does one go about to get the logical name for those PXI modules so niScope_Init can use? Hardcoding the name such as DAQ::1 is out of the question because the number of modules is different from test to test. Thanks.

Software:
niScope driver: 2.6
Microsoft Visual studio.net 2003
Measurement Studio 7.0
Windows XP SP2

Hardware:
Group1 : 5 PXI5112s
group2 : 3 PXI5112s
group3 : 7 PXI5112s
0 Kudos
Message 1 of 7
(7,553 Views)
National Instruments has released a utility called NI-ModInst that was designed specifically for this task. Please upgrade your version of NI-SCOPE to 2.8 at the following website, and NI-ModInst will be installed automatically:
http://digital.ni.com/softlib.nsf/websearch/64811A764E0EA23386256FD5006CD4A8?opendocument&node=132060_US

Then, find the NI-ModInst example at the following location (assuming you have LabVIEW 7.1 installed):
C:\Program Files\National Instruments\LabVIEW 7.1\examples\instr\niModInst

Thanks,
Josh
Message 2 of 7
(7,550 Views)
Thanks for the reply, Josh. Unfortunately I don't use Labview and I've already installed niScope 2.8 instead of 2.6 :). I went and checked the niScope example folder under the Measurement Studio 7\vcnet folder tree but there is no such niModInst folder under there. Just about every examples in that niScope folder was hardcoded with the "DAQ::1" name for the instrument! Any other suggestion?
0 Kudos
Message 3 of 7
(7,547 Views)
NI-ModInst is still the solution for you, we just don't have a C example yet. Please go to the NI High Speed Digitizers Help file from Start>>Programs>>National Instruments>>NI-SCOPE>>Documentation. The NI-ModInst Help file is located under "Programming". You should find everything you need in that document.
Thanks,
Josh
Message 4 of 7
(7,545 Views)
That was easy!! Wasn't it? Thanks a lot!!!
0 Kudos
Message 5 of 7
(7,542 Views)
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.
Message 6 of 7
(7,533 Views)
Should have read the new niScope guide when I installed the 2.8 version. Thanks again for all your help! I finally don't have to maintain three copies of my apps to support three different setups.
0 Kudos
Message 7 of 7
(7,525 Views)