Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

how do I find the int value of nimodinst_attr_device_model

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,

0 Kudos
Message 1 of 8
(3,572 Views)

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

0 Kudos
Message 2 of 8
(3,559 Views)

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

0 Kudos
Message 3 of 8
(3,555 Views)

 

 

//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 Values

NIMODINST_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

0 Kudos
Message 4 of 8
(3,547 Views)

 

 

 

 

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.

0 Kudos
Message 5 of 8
(3,545 Views)

 

Attribute Definitions:

 

 

// ViString Attributes
#define NIMODINST_ATTR_DEVICE_NAME                 0
#define NIMODINST_ATTR_DEVICE_MODEL               1
#define NIMODINST_ATTR_SERIAL_NUMBER             2

0 Kudos
Message 6 of 8
(3,539 Views)

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.

0 Kudos
Message 7 of 8
(3,537 Views)

you're welcome 🙂

I wish you much success

0 Kudos
Message 8 of 8
(3,532 Views)