Driver Development Kit (DDK)

cancel
Showing results for 
Search instead for 
Did you mean: 

Real-time Data accqusition using 651x

Hi,
 
We are using PCI6511/6513/6518  for digital input/output where we need to detect and report the status change with 1ms resolution. The OS is either Windows XP or Pharlap.
 
Do I need to use MHDDK or can I use DAQmx APIs directly? There could be up to 20 boards installed in the system(worst case), and the software will need to communicate with other devices at the same time. And if we have to use MHDDK, do we need to purcharse VISA or can we use VISA run time directly?

About the 1ms resolution in Windows. I was wondering if I could do it the following way:

- create a task to collect the input from all channels with a sample rate of 1000HZ

- set the filter enable for all channels

- specify a 100ms timeout routine that gets all the sample data from the task, and check when the input value changes

I suppose I could get the 100 ms timeout right if I use the multimedia timer in Windows, and if I have 64 input channels I need only to create a sample buffer to hold 100*64 data (or 120*64 to be safe). Then by checking the sample data buffer I would be able to know when the signal actually changes and therefore get a 1ms resolution.

Another option for me would be using third party tool like WinDriver. But hopefully we don't have to...
 
thanks,
 
J


Message Edited by JaneGuo on 04-07-2008 08:51 AM
0 Kudos
Message 1 of 7
(9,464 Views)

JaneGuo,

As I understand it, you are going to have a system full of Digitial I/O cards that will be acquiring on all channels?  If this is not correct then:

-  What other cards are in your system besides the digital I/O cards you mentioned in your previous post?

As far as the driver is concerned, you will be able to use DAQmx to program and configure the Digital I/O cards you mentioned according to their specifications.  Also, just to clarify if you do have a card in your system that will need NI-VISA to communicate (serial or usb port) then that is a free download from our website. 

On your timing requirements: DAQmx uses a double buffering method when acquiring data.  It stores the data on the onboard memory of the card and then it transfers that to LabVIEW memory automatically.  When working with timing requirements in Windows a thing to keep in mind is that anything that is software timed will be system dependent and the resolution for software timed events can be on the order of milliseconds or 10’s of milliseconds, sometimes slower. 

This will not affect your acquisition since there is an onboard clock for each digital I/O card, but any post processing done to the data will be affected by any software delays on your computer. 

I hope this helps!

Ryan N
National Instruments
Application Engineer
ni.com/support
0 Kudos
Message 2 of 7
(9,445 Views)

Thanks Ryan.

We will have Digital I/O cards and Analog I/O cards in the system. The reason I didn't mention analog I/O is that they don't have the timing requirements, so I guess it's easy to setup the task to read data from all channels.

In the past we use real-time OS and read/write the bus directly. But it seems to me that DAQmx API does not support direct access to the bus data, for example, it does not give me the PCI register address so that I could get the channel input by read from that address. Instead I will need to set up a data accquisition task and read from the buffer. So the question is: even if we use real-time OS with precise 1ms timer (Pharlap), is it safe to use DAQmxReadDigitalLines() to get the input value? If not, will I need MHDDK & VISA to gain direct access to the PCI resources? And if that's the case, do we need to pay for it? We don't need any fancy functionality at all, just need to get register address and read/write to it.

Since we just switched to NI boards we are looking into the possibility of running on windows directly. I guess the board is somehow "intelligent" and could sample and store the value locally, so I wonder even with windows I may still be able to get 1ms resolution if I set the sample rate to 1000hz in the board(Like what I mentioned above) or use the edge trigger interrupt to all the channels (DAQmxSetDIDigFltrEnable, but I understand that DAQmx does not support interrupt... so how?). Plus we don't need to handle the filter by software if these boards could handle the filter at low level.  Do you think it's possible at all?

Thanks again

J

 

0 Kudos
Message 3 of 7
(9,438 Views)

JaneGuo,

After looking at the boards you mentioned more closely, they only support software timed acquisition.  Due to this there is no guarantee of a 1ms resolution due to the reasons in my last post.  Even though you are setting the sampling rate to 1kHz you may not get that because of the software limitations.

If you want to use Pharlap then you also have to use LabVIEW Real Time, if this is not the case then you will not be able to use DAQmx.  If you are just using LabVIEW then based on your options Windows would be the best bet, but you will still encounter the software timed issue.

For better support on DDK and register level programming questions make sure to post to the DDK forum.

Ryan N
National Instruments
Application Engineer
ni.com/support
0 Kudos
Message 4 of 7
(9,429 Views)
JaneGuo,

My mistake, I was under the impression that we were on the HSDIO forum when I posted back.  Our NI DDK Engineers will try and post here in a short amount of time. 
Ryan N
National Instruments
Application Engineer
ni.com/support
0 Kudos
Message 5 of 7
(9,409 Views)
Thanks Ryan.
0 Kudos
Message 6 of 7
(9,375 Views)

Hi Jane-

If you only need to achieve a 1kHz loop rate you should have no problems, assuming your control algorithm can also keep up.  The actual operation of writing to or reading from the digital line should be much faster- typically on the average of 10's of uSec or less.

In order to achieve that operation you will have to use "good" coding practice for DAQmx performance.  The biggest requirement is that you start and stop the task only once and that your control loop itself only contain writes and/or reads (in addition to your control algorithm code).  Here's an example of what that might look like:

Hopefully this helps-



Message Edited by Tom W [DE] on 04-11-2008 10:24 AM
Tom W
National Instruments
0 Kudos
Message 7 of 7
(9,370 Views)