Hello,
I'm having some serious trouble reading/writing to PCIe M-Series cards on both PPC and Intel OSX boxes. I am not using the DDK directly, as I cannot use c++ from my code. However, I have successfully ported the code both from the DDK and the examples, all of which works wonderfully for e-series pci cards, but fails utterly with pci-e m series cards (6221 & 6251).
I am able to initialize BAR0 (mite), as it makes BAR1 (daq-stc2) available, but I cannot confirm that anything I am writing to BAR1 is being recorded. All of the status registers ( AIStatus1, JointStatus1, JointStatus2, etc ) return 0x0, regardless of the commands sent to the card. Also, the AIFIFOData queue returns the same value ( 0x02f4000a ) and is impervious to the Clear FIFO command.
I have a log of bytes sent to/from the card, and I have painstakingly checked to be sure that the bit values are correct, which they are, so I can't see the problem. Attached you will find the log. If anyone sees anything glaring, please let me know. I apologize for the hex output, but all bits correspond directly to the commands sent in aiex1.cpp.
NIDAQ Test Program
Found 1 Card(s):
NI 6221M
2007-07-17 17:53:10.422 NITest[2644] Wrote 0x90001080 to 0x000000c0 // init MITE (this function works)
2007-07-17 17:53:10.422 NITest[2644] [ NI 6221M reset ]
2007-07-17 17:53:10.422 NITest[2644] Wrote 00 to 0x07
/ ... /
2007-07-17 17:53:10.429 NITest[2644] Wrote 00 to 0x267
2007-07-17 17:53:10.429 NITest[2644] [ NI 6221M open ]: TRUE!
2007-07-17 17:53:10.429 NITest[2644] [ NI 6221M test1 ]: Start! // aiex1.cpp
2007-07-17 17:53:10.429 NITest[2644] [ NI 6221M configureTimebase ]
2007-07-17 17:53:10.429 NITest[2644] Wrote 0x0800 to 0x0170 // slow internal timebase
2007-07-17 17:53:10.429 NITest[2644] [ NI 6221M resetPLL ]
2007-07-17 17:53:10.429 NITest[2644] Wrote 0000 to 0x01c4
2007-07-17 17:53:10.429 NITest[2644] Wrote 0000 to 0x01c6
2007-07-17 17:53:10.430 NITest[2644] [ NI 6221M resetAnalogTrigger ]
2007-07-17 17:53:10.430 NITest[2644] Wrote 0x0020 to 0x017a
2007-07-17 17:53:10.430 NITest[2644] Wrote 0x03 to 0x8c
2007-07-17 17:53:10.430 NITest[2644] Wrote 00 to 0x44
2007-07-17 17:53:10.430 NITest[2644] Wrote 00 to 0x46
2007-07-17 17:53:10.430 NITest[2644] Wrote 0000 to 0x017a
2007-07-17 17:53:10.430 NITest[2644] [ NI 6221M aiReset ]
2007-07-17 17:53:10.430 NITest[2644] Wrote 0x0001 to 0x0190 // ai reset
2007-07-17 17:53:10.430 NITest[2644] Wrote 0x0010 to 0x0190 // configuration start
2007-07-17 17:53:10.430 NITest[2644] Wrote 0000 to 0x0192
2007-07-17 17:53:10.430 NITest[2644] Wrote 0x3f80 to 0x0104
2007-07-17 17:53:10.430 NITest[2644] Wrote 0x0008 to 0x0118
2007-07-17 17:53:10.430 NITest[2644] Wrote 0000 to 0x011a
2007-07-17 17:53:10.430 NITest[2644] Wrote 0000 to 0x01ae
2007-07-17 17:53:10.430 NITest[2644] Wrote 0000 to 0x0178
2007-07-17 17:53:10.430 NITest[2644] Wrote 0000 to 0x019a
2007-07-17 17:53:10.430 NITest[2644] Wrote 0000 to 0x017c
2007-07-17 17:53:10.430 NITest[2644] Wrote 0000 to 0x017e
2007-07-17 17:53:10.430 NITest[2644] Wrote 0x0100 to 0x0190 // configuration end
2007-07-17 17:53:10.430 NITest[2644] [ NI 6221M aiPersonalize ]
2007-07-17 17:53:10.430 NITest[2644] Wrote 0x0010 to 0x0190
2007-07-17 17:53:10.430 NITest[2644] Wrote 0x0302 to 0x0178
2007-07-17 17:53:10.430 NITest[2644] Wrote 0x0400 to 0x019a
2007-07-17 17:53:10.430 NITest[2644] Wrote 0x0100 to 0x0190
2007-07-17 17:53:10.430 NITest[2644] [ NI 6221M aiClearFIFO ]
2007-07-17 17:53:10.431 NITest[2644] Wrote 0x0001 to 0x01a6
2007-07-17 17:53:10.431 NITest[2644] Read 0000 from 0x0104 // ai_status_1 is empty
2007-07-17 17:53:10.431 NITest[2644] Read 0x02f4000a from 0x0000001c // ai_fifo_data has garbage in it
2007-07-17 17:53:10.431 NITest[2644] Read 0000 from 0x0136 // joint_status_1 is empty
2007-07-17 17:53:10.431 NITest[2644] Read 0000 from 0x013a // joint_status_2 is empty
2007-07-17 17:53:10.431 NITest[2644] AI_Status_1: 0, AIFIFOData: 49545226, Joint_Status_1: 0, Joint_Status_2: 0
There is much more, but I won't bore you with those details. At this point though, ai_fifo_data should be empty, and ai_status_1 should reflect that, but it doesn't. Any thoughts?
NITest has exited with status 0.
----
Rob Dotson
Asst. Research Scientist
Center for Neural Science
New York University