Driver Development Kit (DDK)

cancel
Showing results for 
Search instead for 
Did you mean: 

NI 6110 Example 2 doesn't provide scan interval and samples like it should

Hello,

I'm developing software for NI 6110 with DDK and QNX Momentics 6.4.1.

I tried Example 2 (aiex2.cpp) but it didn't stop the Acquisition after 5 Scans, and the Sample Interval

isn't 1 ms (Fifo filled after 1us -> Fifo Size is 8192).

Does the example code work like it should? Has it already been tested?

 

I got this card as a loan to test it for our requirements.

Therefore I hope to get response soon before I  have to return it.

Thank you,

 

Best Regards,

Martin

 

0 Kudos
Message 1 of 13
(9,383 Views)
Hi Martin,

I'm sorry to hear you're having problems. I looked up the history of the 6110 examples, and they were tested and marked as working in May 2002.

What changes have you made to the example, and what kind functionality are you looking for from the hardware (number of channels, sampling speed, finite/continuous measurements, etc...)? Do any of the other examples work?

The next two weeks will be off-and-on for folks here at NI since we're coming up to a few large company holidays. How long do you have the hardware on loan?
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 2 of 13
(9,376 Views)

Hi Joe,

thank you for your instant reply. I have to return the card 30th December. But I try to  the get the card a bit longer.

 

I used the standard makefile of QNX Momentics and defined in ositypes.h:  kLittleEndian as default (x86) and kGNU =1 to get it compiled.

I didn't change the example code at first. 

The example finishes without exceptions . But after the acquisition (5 values) is finished, uStatus is 0x64a2 (fifo full) and not 0x10a2 (empty).

Moreover samples are not added every 1 ms (but much faster-> after AI_Start_The_Acquisition I call Status twice in a short time: 0x10a2->0x64a2!!).

Maybe there is something wrong with the Convert_Signal (AI_SI2_Load_A.writeRegister(1)).

Therefore I won't get the right timing properties to achieve my requirements.

My Requirements:

I just want to record analog inputs ( 2 Channels, 2MHz sample rate per channel, finite acquisition (at first)) and to read from the card very fast-> DMA.

 

Is it possible to manage DMA by using tDMAChannel and tDMABuffer because there is already allocDMA() and initMITE(bus) implemented?

Which methods do I need?

 

 Thank you for your efforts,

 

Best Regards,

Martin
0 Kudos
Message 3 of 13
(9,356 Views)
Hi Martin,

Sorry again for the delay. I hope you're having a pleasant new year so far.

Do you still have the 6110 on loan? Shall we continue troubleshooting your setup?
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 4 of 13
(9,260 Views)

Hi Joe,

I hope you had a pleasant new year so far as well.

The loan has been extended. So I would appreciate your support.

I tried a lot, but didn't find a solution yet. 

I checked the register values, changed the ConvertSignal to get values at a certain rate.

 

The aim is still the same:

A stable record with qnx 6.4.1 with no  buffer overflow and dma.

 

Is it possible for you to test the card with qnx 6.4.1?

 

 

I hope you continue helping me to configure my setup.

 

Best regards,

Martin

 

0 Kudos
Message 5 of 13
(9,233 Views)
Hi Martin,

I'm glad to hear that you have the card a bit longer so we can figure out what's going on. Thanks, too, for updating me on what you've tried to do so far.

Although I want to, I won't be able to mimic your setup for two reasons: I don't have a spare machine to use for testing, and the latest version of QNX available to me is 6.3. But, I will be able to test and troubleshoot in Linux (openSUSE 10.3), and since the OS interface componenent is independent of the S Series chip objects, the OS shouldn't matter.

Give me a few days to install the DDK on my Linux machine. The newer Linux kernels changed some of their organization, and the DDK doesn't compile out-of-the-tarball any more.
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 6 of 13
(9,218 Views)

Hi Joe,

 

This sounds great. 

Would you please try Example 2 (aiex2.cpp) and read uStatus after all 5 values are read (board->AIFifoData.readRegister()). What Status do you get: 0x10a2 or 0x64a2? What status do you receive 2ms later( usleep(2000);)?

 

Could you please give me a hint how I can use dma. Do I have to use allocDMA or should I use the dma objects like in the m series examples(tDMAChannel,tLinearBuffer,.....)?

 

Best Regards,

Martin

 

0 Kudos
Message 7 of 13
(9,182 Views)
Hi Martin,

I have an update for you 🙂 I've made the (surprisingly few) changes to the Linux 2.6 OS interface component so that it will compile on more recent kernels, and I have the DDK kernel module up and running and detecting a PCI-6110. I've also compiled the S Series examples and will be able to begin looking at aiex2.cpp tomorrow.
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 8 of 13
(9,133 Views)
Hi Martin,

So I've instrumented aiex2.cpp to get a closer look at what's happening in the example. I've attached the patch so you're welcome to apply it and modify it for QNX system calls if you want to try the same. Apply the patch with
patch -Np1 ./aiex2.cpp ./add-time-measurements.patch

Anyway, I've been able to confirm that the timing engine on the STC is not correctly driving the 6110's ADCs. The operation indeed finishes too quickly: see the output from the modfied example below. At this point, there are a two things we can do: continue troubleshooting this example to get it working and move forward from there, or discuss your application needs and try to solve the problem more directly.

I think the second option would be better since you also want DMA incorporated into your program. So, I know you want 2 channels sampled at 2 MHz, starting with finite acquisitions. Does this mean you want some kind of retriggerable operation or a continuous read later? What are you trying to do with the 6110?

I should also note now that this board was the first S Series board, so it is quite old, and has been with NI longer than me 😉 I'm not as familiar with the 6110 as I am with M Series (or TIO Series) devices, so I will be asking colleagues for their experience as we go deeper into the application. I want to be able to explain to you how to modify the examples or provide specific register information and programming logic so that you can make the changes that you need.

 

$ ./aiex2
loop: 0 has status 10a0
loop: 1 has status 00a2
loop: 2 has status 00a2
loop: 3 has status 00a2
loop: 4 has status 00a2
loop: 5 has status 00a2
loop: 6 has status 00a2
loop: 7 has status 64a2
start: 76506 s, 751025868 ns
end: 76506 s, 751037194 ns
span: 0 s, 11326 ns (0.000011 s)
Value 0 equals 65
Value 1 equals 1005
Value 2 equals 65
Value 3 equals 1005
Value 4 equals 65
Value 5 equals 1005
Value 6 equals 65
Value 7 equals 1005
Value 8 equals 65
Value 9 equals 1005
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 9 of 13
(9,122 Views)

Hi Joe,

 

thank you very much for your effort.

Glad to hear I'm not stupid and the behaviour of your card is the same as mine.

I think a retriggerable operation could be the answer.

2MHz Data Acquisition and Processing for a realtime application is the main aim.

Could we just start to get DMA working because this will be the bottleneck for our purpose.

Polled read like in example 2 lacks performance. 

 

Do you know another (newer) board which is capable of 2 MHz Data Acquisition and QNX Support?

 

Maybe with a fpga unit for data processing?

 

Best Regards,

Martin

0 Kudos
Message 10 of 13
(9,114 Views)