Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

The specified attribute is not relevant

I have a PXI-1000B chassis, along with a 8330 MXI-3, a 6608 System Timer, a 6040E Multifunction I/O, and a 6533 Digital I/O.

Using Visual C++ vrsn 6.0, NIDAQ vrsn 6.9, and ComponentWorks vrsn 2.0.1, I am trying to build my first program to communicate with the devices listed above. I am starting out with the command 'Get Device Info'. However I can not retrieve any information from the devices. I keep getting the message "The specified attribute is not relevant" regardless of the attribute I try to retrieve. Can someone help me out please.

I have the proper include statements (nidaq.h, nidaqcns.h, nidaqerr.h, nidaqex.h), and I have added the two nidaq library files and header files to my project.

I have been told that
I should be using ComponentWorks++ and not ComponentWorks with Visual C++ 6.0. Is this true??? I should also note that I started out by altering the GetScxiInfo example provided on the NI website. Any help in solving my problem would be greatly appreciated.

I have included my function code below:


void CGetScxiInfoDlg::OnGetinfo()
{

COleVariant Info;

long Status;

CString cInfo="";
CString StringBuffer="";

long DeviceNumber = 1;
long InfoType = ND_DEVICE_SERIAL_NUMBER;

// Read the chassis string from the dialog box
// UpdateData(TRUE);
// cInfo = m_Info;

// Get information from Device
Status = m_CWDaqTools.GetDAQDeviceInfo (DeviceNumber, InfoType, Info);

// ...Code for displaying information...
}
0 Kudos
Message 1 of 2
(2,996 Views)
Using ComponentWorks in Visual C++ is fine. National Instruments has developed native Visual C++ tools that are included with Measurement Studio which would simplify Visual C++ development, but it is perfectly fine to use the ComponentWorks controls in Visual C as well. If you would like more info on what is included with Measurement Studio go to http:\\www.ni.com\mstudio. Also, you can upgrade from your CW 2.0.1 to Measurement Studio at http:\\www.ni.com\upgrade if you decide you want it.

With that explained, let me address your problem. First, are your DAQ boards showing up fine in Measurement & Automation Explorer (MAX)? If they are there, check the device numbers and make sure device 1 is correct for the board you want to talk to. As for retrie
ving the serial number, many device do not support this and will return "0" as it says in the NI-DAQ help:
"Serial number of the device you indicate in deviceNumber. Devices that do not have a programmatically-accessible serial number return a serial number value of 0 (zero) and a status of noError."

Try getting the device name and it should work.

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 2 of 2
(2,996 Views)