NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

niScope_32.dll niScope_GetAttributeReal64 attributeID data type

Solved!
Go to solution

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?

0 Kudos
Message 1 of 5
(2,930 Views)

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. 

Regards,
0 Kudos
Message 2 of 5
(2,912 Views)

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

0 Kudos
Message 3 of 5
(2,898 Views)
Solution
Accepted by topic author SteveTomany

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?

 

Regards,
Message 4 of 5
(2,892 Views)

Yes, that worked. Thank you for the mapped value and thank you for explaining how/where you got it. Very helpful!

 

Regards,

Steve

0 Kudos
Message 5 of 5
(2,885 Views)