05-02-2013 11:25 AM
Help,
I am updating my python drivers for our PXI rack, and I am implementing a fuction to get the serial numbers via niModInst_GetInstalledDeviceAttributeViString.
I can see in the help documentation, that this call has the parameter:
attributeID, the type is ViInt32, which is an integer, but the given valid values are:
NIMODINST_ATTR_DEVICE_NAME, NIMODINST_ATTR_DEVICE_MODEL, etc....
where do I find where, or how, these values are mapped to int32 values? So far I have not been able to find the info.
thanks,
05-03-2013 02:25 AM
Hi,
according to niModInst_GetInstalledDeviceAttributeViString
NIMODINST_ATTR_DEVICE_MODEL—the model of the device (for example, NI PXI-5122)
so the typ of NIMODINST_ATTR_DEVICE_MODEL is ViString
05-03-2013 02:35 AM
No, that is how it is described, but the type for that parameters is listed as ViInt32. So the type doesn't seem to match the description. passing a string does not work
05-03-2013 03:34 AM
//Get the size of the DeviceModel String;For e.g. get size of PXI-5122
buffersize_devicemodel=niModInst_GetInstalledDeviceAttributeViString (vi, index,NIMODINST_ATTR_DEVICE_MODEL,0, NULL);
attributeID | ViInt32 | The ID of the string attribute you want to query.
Valid ValuesNIMODINST_ATTR_DEVICE_NAME—the name of the device, which can be used to open an instrument driver session for that device NIMODINST_ATTR_DEVICE_MODEL—the model of the device (for example, NI PXI-5122) NIMODINST_ATTR_SERIAL_NUMBER—the serial number of the device |
05-03-2013 03:37 AM
The example Using NI-ModInst to query specific information in CVI demonstrates using NI-ModInst to get a list of devices that use a particular driver and obtain useful information about a specific device.
For example, you can use this example program to get a list of devices that use NI-DMM, along with their corresponding device numbers and serial numbers.
05-03-2013 04:05 AM
Attribute Definitions:
// ViString Attributes
#define NIMODINST_ATTR_DEVICE_NAME 0
#define NIMODINST_ATTR_DEVICE_MODEL 1
#define NIMODINST_ATTR_SERIAL_NUMBER 2
05-03-2013 04:08 AM
Thanks for the help, at the moment I just have an issue of setting up the pointer in python correctly, to pass to the DLL, then your suggestions should work.
05-03-2013 04:47 AM
you're welcome 🙂
I wish you much success