Driver Development Kit (DDK)

cancel
Showing results for 
Search instead for 
Did you mean: 

AI not workin on PCI-6221

I'm trying to get the analog input working for a 6221.  The board is on a Windows CE machine, so I can't use the DDk drivers.  Instead, I have written my own driver that allows me to read/write the registers directly.  I tested the digital I/O, and had no problems getting it to work, so I moved on to analog input.

 

For analog input, I used the method in aiex1.cpp, but I had to write my own code, because of the way my driver works(it's a stream driver, so I'm using lots of seeks and read/writes).  I believe I ported aiex1 without any obvious mistakes (although who knows...), however, when I run the program, all I get from the data FIFO is 0x0007FFFF (the maximum value).  

 

My input is a function generator creating a square wave from +7V to -7V at a bit less than 1Hz (so I don't think I'm having sampling issues).  The signal is input on pin 68, with the ground on pin 67.

 

I've looked at the status registers (joint_status 1 & 2 and ai_status_1) a bit, but I'm not really sure what I should be looking for. 

 

Does anyone have any general ideas for debugging this?   Any tricks I should be aware of?  

 

I tried changingAI_Output_Control.AI_CONVERT_Output_Select to kAI_CONVERT_Output_SelectActive_High (3) as discussed here:

http://forums.ni.com/ni/board/message?board.id=90&message.id=1041&query.id=1471127#M1041

but it didn't have any effect. 

 

0 Kudos
Message 1 of 4
(7,842 Views)
I should also add that I tested the board setup (by booting my hardware under XP and using the NI tools) to confirm that I really was getting the analog signal that I thought I was, so it's probably not a hardware/connection issue.
0 Kudos
Message 2 of 4
(7,823 Views)
Sorry for the delay, but has your driver's status or behavior changed? What have you tried and what did you expect to see but didn't?
Joe Friedchicken
NI Configuration Based Software
Get with your fellow OS users
[ Linux ] [ macOS ]
Principal Software Engineer :: Configuration Based Software
Senior Software Engineer :: Multifunction Instruments Applications Group (until May 2018)
Software Engineer :: Measurements RLP Group (until Mar 2014)
Applications Engineer :: High Speed Product Group (until Sep 2008)
0 Kudos
Message 3 of 4
(7,739 Views)
I actually managed to get it working, although I'm not sure what the bug was.  Basically, I refactored my code, and somehow in the process of that, the AI started working.  My guess is that I was writing to the wrong register, or something like that.  Anyway, I now have a functioning driver.
0 Kudos
Message 4 of 4
(7,735 Views)