Driver Development Kit (DDK)

cancel
Showing results for 
Search instead for 
Did you mean: 

DDK Examples Not Working With DAQCard 6036e

I am working with a PCMIA DAQCard 6036E on a WinCE.net  device (Inhand Elf3) using Embedded Visual C++ 4.0 to compile and run the AIEX1.cpp example. This example simply acquires one sample from channel 0.

The issue I'm having is that no matter what voltage I apply to the channel 0 inputs I receive the same input value (31745). I have similar issues with the other examples (input values never change and sampling takes a very long time, ~1 sec per sample).

As far as I can tell I've done things correctly. I downloaded the DDK and ESeries chip objects, successfully compiled and installed the driver, etc...

Is there any sort of diagnostics or tests that I can do to check if I'm actually able to do to ensure the board can be accessed and is working? What other steps should I take in order to find the problem? Any help or tips would be appreciated.


Dave Humphrey
humphrey@ppic.com
----------
Dave Humphrey
humphrey@ppic.com
www.ppic.com
0 Kudos
Message 1 of 6
(8,820 Views)
I would suggest trying a digital example first.  Only hits 2 registers.  This is the easiest way to determine if you are communicating with the device correctly.  If the digital example works, then we can move into troubleshooting the ai example.
-Alan A.
0 Kudos
Message 2 of 6
(8,807 Views)
Neither the digital or analog output examples appear to work (no signal changes observed on the appropriate pins). I've checked all the 'obvious' things (to me anyways): the cable connecting to the card seems fine (pin-to-pin resistances match what they should be) and I've followed all the setup instructions in "WinCE RLP Instructions.pdf".

What's I'm going to do next is install the NI-DAQmx and the DAQ diagnostic on a laptop with a PCMIA slot and see if that works. This should help narrow down whether the problem is the card or the hand-held.

Dave Humphrey
humphrey@ppic.com
----------
Dave Humphrey
humphrey@ppic.com
www.ppic.com
0 Kudos
Message 3 of 6
(8,795 Views)
It seems the problem was just that the DAQ PCMIA card did not like being plugged into the handheld while the unit was on. If I insert the card and then reset the device (or cycle the power) the examples work just fine.
----------
Dave Humphrey
humphrey@ppic.com
www.ppic.com
0 Kudos
Message 4 of 6
(8,757 Views)

It is unclear from your description if the board is even being recognized by the OS upon insertion.  If it is being recognized, it's possible that the DAQ board is not being powered up properly by the device.  If this is the case, a soft reset of the DAQ board may suffice.  Below is information on how to perform this soft reset using the Configuration Option Register.  The soft reset sequence has to be implemented in nirlpdriver.dll, where you have access to the device.  You could add the soft reset in the driver initialization function (RLP_Init) which gets called after the driver is loaded (after the device plugged in or after suspend).  I hope this helps.

 

Configuration Option Register

The configuration Option register contains a bit to do soft reset to the board, as well as other bits required by PCMCIA. This register is located in configuration space.

Address: Base address + 0 (hex), Configuration Space (Memory Interface)

Type: Write/Read

Word Size: 8-bit

Bit Map:

7

6

5

4

3

2

1

0

SRESET

LevIRQ

FCI5

FCI4

FCI3

FCI2

FCI1

FCI0

Bit Name Description

7 SRESET This bit resets the board when set to 1. It resets all the functions and registers of the board, except for this bit. To exit the reset state, a 0 needs to be written to this bit.

6 LevIRQ This bit is implemented but is not functional. It can be written and read back but will have no effect on how the interrupts work. Its intended function is to select between level and pulse interrupts. The board works on level mode only.

5-0 FCI(5:0) The Function Configuration Index bits are intended to set the board in a certain configuration mode. When the bits are all set to 0 either by the user or by a reset, the board will ignore all accesses to the I/O interface. The default is 0, so before doing any I/O access to the board a value different than 0 must be written to the board. The value itself does not have any effect.

0 Kudos
Message 5 of 6
(8,708 Views)

The function to access the configuration registers is 'CardAccessConfigurationRegister'. In nirlpdriver this function is accessed using 'pfnAccessConfigurationRegister'. Here's how to reset.

unsigned char cor_data = 0;

cerr = pfnAccessConfigurationRegister(hPcmcia,hSock,CARD_FCR_READ,FCR_OFFSET_COR ,&cor_data);

cor_data |= FCR_COR_SRESET;

cerr = pfnAccessConfigurationRegister(hPcmcia,hSock,CARD_FCR_WRITE,FCR_OFFSET_COR ,&cor_data);

cor_data &= ~FCR_COR_SRESET;

cerr = pfnAccessConfigurationRegister(hPcmcia,hSock,CARD_FCR_WRITE,FCR_OFFSET_COR ,&cor_data);

0 Kudos
Message 6 of 6
(8,709 Views)