Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Product number using NI-XNET

 

I'm trying to get the product number and name of the National
Instruments card installed on my computer. According to the manual when
I get the property for nxPropDev_Name I should get NI PCI-8512 (2 ports)
for an NI PCI-8512 device. Instead I get an empty Cstring. For
nxPropDev_ProductNum I should get 8512 for an NI PCI-8512 device, but
instead I get this number: 3435973836.

Below is a snippet of the code I'm using. Is there something I am doing
incorrectly?

Thanks

int propSize;
int cpropSize;
u32 propName;
CString cpropName;
char *l_pSelectedInterface = "CAN2";
char *l_pFrameArray = NULL;
char *l_pSelectedDatabase = ":memory:";
char *l_pSelectedCluster = "";

g_nxStatus = (*m_pNxCreateSession)(l_pSelectedDatabase,
l_pSelectedCluster,
l_pFrameArray,l_pSelectedInterface,
nxMode_FrameInStream, &SessionRef);

g_nxStatus = (*m_pNxGetPropertySize)(SessionRef, nxPropDev_ProductNum,
(u32)(&propSize));
g_nxStatus = (*m_pNxGetProperty)(SessionRef, nxPropDev_ProductNum,
(u32)(propSize),
&propName);
g_nxStatus = (*m_pNxGetPropertySize)(SessionRef, nxPropDev_Name,
(u32)(&cpropSize));
g_nxStatus = (*m_pNxGetProperty)(SessionRef, nxPropDev_Name,
(u32)(cpropSize), 
0 Kudos
Message 1 of 2
(5,384 Views)

Hi Carbert,

 

I know you're using visual studios so this forum could be applicable, but I believe you would get more help if you posted this question in the Automotive and Embedded Networks forum. There you will find a much deeper pool of expertise in XNET programming as well as quite a few VB programmers, and it will allow us to keep the forums organized for those looking for similar answers later.

 

Thanks!

Peter W.

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