Driver Development Kit (DDK)

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQCard ID

I have post the Question to the VC++ part. Now they told me I should be here.

I am working on a DAQCard-AI-16XE-50 under Window CE .net system, which run on PC104. I program using MS Embedded VC++. According to their advice, I download the DDK and install on the Desktop machine. it works for the NIRLP to load the DLL and detect the daq card. But When I try to acquire data from your sample code, it give the error. It is this part of the code:
//Each PCI card has an identifying 32bit PCI ID number.
//0x10930000 is the manufacturer ID number for all National Instruments cards
//0x000011c0 is the device ID number for the PCI-MIO-16E-1
bus = acquireBoard(0x109311c0);
if(bus == NULL){
printf("Error accessing the PCI device. Exiting.\n");
retu
rn 1;
}

What is the device ID number for DAQCard-AI-16XE-50?

Is any thing else I should config by the hardware?

HL
0 Kudos
Message 1 of 5
(8,754 Views)
The WinCE version of the MHDDK software does not use deviceID to locate the DAQCard in the system. If you go into the acquireBoards routine for WinCE, you see that the parameter is never used. Therefore it does not matter what value you pass to the function for this parameter.

The acquireBoards function will return the first device found by the NI RLP DLL. Following is the code for the acquireBoards function that should be called in your code.

Christian L
NI Consulting Services

//
// Return iBus for a PCMCIA card inserted in the WinCE system
//
// deviceID is ignored in this implementation
//
iBus* acquireBoard(const u32 deviceID)
{
//u32 devBAR0,BAR0sz,devBAR1,BAR1sz;
void *mem0,*mem1;
iBus *bus;

HANDLE dvrFile;

dvrFile
= CreateFile(L"RLP1:",GENERIC_READ| GENERIC_WRITE,FILE_SHARE_READ| FILE_SHARE_WRITE,
NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL,0);

if(dvrFile == INVALID_HANDLE_VALUE){
newprintf("error opening the driver\n");
return NULL;
}
newprintf("file handle is 0x%08x\n",(unsigned int)dvrFile);
mem1 = (void*)dvrFile;
mem0 = 0;

bus = new iBus(0, 0, mem0, mem1);

bus->osSpecific = (void*)dvrFile;

bus->_physBar[0] = (u32)NULL;
bus->_physBar[1] = (u32)NULL;
bus->_physBar[2] = (u32)NULL;
bus->_physBar[3] = (u32)NULL;
bus->_physBar[4] = (u32)NULL;
bus->_physBar[5] = (u32)NULL;
return bus;
}
authored by
Christian L, CLA
Systems Engineering Manager - Automotive and Transportation
NI - Austin, TX


  
Message 2 of 5
(8,753 Views)
I will go through the code to see where is error come from. Thank you

HL
0 Kudos
Message 3 of 5
(8,753 Views)
This line return the null

dvrFile = CreateFile(L"RLP1:",GENERIC_READ| GENERIC_WRITE,FILE_SHARE_READ| FILE_SHARE_WRITE,
NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL,0);


what is wrong?

HL
0 Kudos
Message 4 of 5
(8,753 Views)
Using GetLastError, I get error number 55 Dev not exist(some thing like this in help file). Is this means the register not correct? But I check the manual and compare the registy from EVC++, it is there. What wrong?

Thank you advance for your help

HL
0 Kudos
Message 5 of 5
(8,754 Views)