08-27-2018 12:42 PM
Using TestStand 2010 sp1. Have niScope 15.0. Create action step using C/C++ DLL adapter and calling niScope_GetAttributeReal64 from niScope_32.dll to get device (PXIe-5160) temperature. Parameter attributeID in step settings show it is a long data type. NI-SCOPE documentation show it is a viAttr data type and it looks like I would pass a value of "NI_ATTR_DEVICE_TEMPERATURE" to get the device temperature.
Can I get TS to recognize a viAttr data type? What value would I pass to the parameter if TS is expecting to be a long data type?
Solved! Go to Solution.
08-27-2018 05:11 PM
Hi SteveTomany,
That attribute appears to be an enumerated value (implemented as a macro value in C). I did some digging in the C source files for the driver and found that NISCOPE_ATTR_DEVICE_TEMPERATURE is defined as IVI_SPECIFIC_PUBLIC_ATTR_BASE + 86 in niScope.h and then in ivi.h IVI_SPECIFIC_PUBLIC_ATTR_BASE is defined as IVI_ATTR_BASE + 200000 where IVI_ATTR_BASE is 1000000. So, I'd try passing a numeric with the value 1000000 + 200000 + 86 (1,200,086) for the Parameter ID.
08-28-2018 11:23 AM
Andrew, thanks for the reply. I tried 1200086 for the attribute ID and got error -1074135028, IVI: (Hex 0xBFFA000C) Attribute ID not recognized.
Regards,
Steve
08-28-2018 01:03 PM
Steve,
I double-checked and I definitely appear to have swapped IVI_SPECIFIC_PRIVATE_ATTR_BASE with IVI_SPECIFIC_PUBLIC_ATTR_BASE when I was reading out those values:
NISCOPE_ATTR_DEVICE_TEMPERATURE = IVI_SPECIFIC_PUBLIC_ATTR_BASE + 86
IVI_SPECIFIC_PUBLIC_ATTR_BASE = IVI_ATTR_BASE + 150000
IVI_ATTR_BASE = 1000000
My apologies for the interchange. Does 1150086 generate expected results?
08-28-2018 02:23 PM
Yes, that worked. Thank you for the mapped value and thank you for explaining how/where you got it. Very helpful!
Regards,
Steve